Skip to content

Commit

Permalink
Update ishanSrt's report
Browse files Browse the repository at this point in the history
  • Loading branch information
ishanSrt committed Aug 20, 2018
1 parent dcc4c15 commit fae5891
Showing 1 changed file with 202 additions and 20 deletions.
222 changes: 202 additions & 20 deletions _reports/ishanSrt.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ organisation_link: https://coala.io
report_year: 2018
project: Quickstart Green Mode
project_link: https://summerofcode.withgoogle.com/projects/#5792652830703616
tarball: https://cdn.rawgit.com/ishanSrt/ishanSrt.github.io/d859b05e/ishanSrt.tar.gz
sha256sum: 4dcee0f017d832965ca44a76d0a8b20f92d68fd2fb820975984a51b4ff34806a
tarball: https://cdn.rawgit.com/ishanSrt/ishanSrt.github.io/443d578d/ishanSrt.tar.gz
sha256sum: 54bc146da5f1f958991087d7457d58e2fa39a539856fb8da7fd65245099d5345
mentors: >
[Satwik Kansal](https://github.com/satwikkansal) &
[Adhityaa Chandrasekar](https://github.com/adtac) &
[Adhityaa Chandrasekar](https://github.com/adtac)
phase:
- Bonding: https://gitlab.com/coala/GSoC/GSoC-2018/milestones/46
- Phase 1: https://gitlab.com/coala/GSoC/GSoC-2018/milestones/56
Expand Down Expand Up @@ -79,34 +79,201 @@ activity:
- 6:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/a725f019c898a3422c856e1deae9cca906594883
- link: https://github.com/coala/coala-quickstart/commit/9d52cb1b4595a56f863c7a9593b85cc4b9da4998
- details: >
green_mode.py: Run BEAR_DEPS bears while testing
[Bonding Period Work] EditorconfigParsing.py: Correct function name
- 7:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/9e91285ac87cd36ee846743f1c9d891c324f8c18
- link: https://github.com/coala/coala-quickstart/commit/b45476bdf3559b728eca3e2bc029a7c8be612301
- details: >
bear_settings.yaml: Fix wrong bear for settings
[Bonding Period Work] .coafile: Remove the deprecated [Default] section
- 8:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/6bf20749002220d134fe775cf978ff5b2e2e9da2
- link: https://github.com/coala/coala-quickstart/commit/6fbaebd6c5dd7a5a3b961d85b9194cba3254d594
- details: >
Project.py: Fix bug while printing languages
[Bonding Period Work] .coafile: Enable Quotes Bear
- 9:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/8bbd4dab13853e61a1cd1a2634d0c6da72b09716
- link: https://github.com/coala/coala-quickstart/commit/d8d66b9abe15abaca52d8925a4ead81fda3b52c1
- details: >
green_mode_core.py: Fix a bug
[Bonding Period Work] README.rst: Change instructions for dev version
- 10:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/f507765f434f41e9eef7c3e16368ad03eea39bad
- details: >
Add 3 test bears
- 11:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/d3f96eeaa472ef96dc5fc67976ffb4ff38d51536
- details: >
Add 4 test bears
- 12:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/d20297eb4f506ed7aabf96c8f59bf185a3f44358
- details: >
Add some general purpose functions and tests
- 13:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/e819b0ee1d198cfc795184dd4cab5d928052e4b1
- details: >
Add SettingsClass and tests
- 14:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/bed7e51280f8aad3763efc4323a17967d7ae6019
- details: >
Add the green_mode tag
- 15:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/3d27455f9436a7d8ce74cd1564ee9eac7829f9d5
- details: >
SettingsClass.py: Remove unused function argument
- 16:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/933d159c24d828e0c4b99ccee412795649d922bd
- details: >
SettingsClass.py: Parse generate_config() also
- 17:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/bf9413f3d5dfb8b9e319b31b2c2c853519e6bed6
- details: >
SettingsClass.py: Get optional settings of deps
- 18:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/6d02841ed75f6a52c9f15d6d082b6c4f3400da3a
- details: >
FileGlobs.py: Recursively look for gitignore files
- 19:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/468893fe4c6b64882a6e1b63b8edfac6ac18dd2c
- details: >
Add GREEN_MODE_COMPATIBLE_BEAR_LIST
- 20:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/a18281c56e759f2880af9b4519a1ec65bd3ac29b
- details: >
Add bear_settings.yaml
- 21:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/836df04a161ffd84ac3fe035bac45ea975812a76
- details: >
Add QuickstartBear
- 22:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/9354c3062cef7f4309c801870e172d3ff180440c
- details: >
.moban.yaml: Increase pytest timeout
- 23:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/72de228a299c07d4d0f42196ce4a706b2b6febab
- details: >
Add filename_operations.py
- 24:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/6bf20749002220d134fe775cf978ff5b2e2e9da2
- details: >
Project.py: Fix bug while printing languages
- 25:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/ffaff5c4f86039d58860a0afe00ff1721860f22e
- details: >
bear_settings.yaml: Add green_mode.py
- 26:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/a725f019c898a3422c856e1deae9cca906594883
- details: >
green_mode.py: Run BEAR_DEPS bears while testing
- 27:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/f26b264c72dedcb518aef209035349dd239539e9
- details: >
Add green mode incompatible bears list
- 28:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/81e8a6179a6a93a9b4e68b0e1f138655578220ba
- details: >
Project.py: Ask to select languages
- 29:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/94e9eda139234e8b9183ce5462bd7c9a9d97e197
- details: >
Aggregate green mode per file results
- 30:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/8bbd4dab13853e61a1cd1a2634d0c6da72b09716
- details: >
green_mode_core.py: Fix a bug
- 31:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/6bf20749002220d134fe775cf978ff5b2e2e9da2
- details: >
Project.py: Fix bug while printing languages
- 32:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/9e91285ac87cd36ee846743f1c9d891c324f8c18
- details: >
bear_settings.yaml: Fix wrong bear for settings
- 33:
- repo: coala-quickstart
- link: https://github.com/coala/coala-quickstart/commit/a725f019c898a3422c856e1deae9cca906594883
- details: >
green_mode.py: Run BEAR_DEPS bears while testing
- 34:
- repo: mobans
- link: https://gitlab.com/coala/mobans/commit/94daf3a9ffb8141f639d0211560d7bc67cba38b0
- details: >
appveyor.yml.jj2: Force pip 9
- 35:
- repo: mobans
- link: https://gitlab.com/coala/mobans/commit/4dc3f18dbc2f63a124fdf672d8cc6b05d82688fa
- details: >
coala-setup.py.jj2: Add maintainer_list
- 36:
- repo: coala-utils
- link: https://gitlab.com/coala/coala-utils/commit/12e49833b41c562377c53eefbbe88a736a2de6ee
- details: >
Setup.py: Edit the maintainer field
- 37:
- repo: coala-utils
- link: https://gitlab.com/coala/coala-utils/commit/badfccccf0cf1ceba1ee65a54da98eeb7773be07
- details: >
Add function for sorted glob.glob() output
- 38:
- repo: coala-utils
- link: https://gitlab.com/coala/coala-utils/commit/ccb153f9d59da0e33e4ef19cd824f30770662ea7
- details: >
FilePathCompleterTest.py: Fix test
---

Expand All @@ -117,34 +284,39 @@ activity:

During the first phase my main objective was to collect metadata from the
various bears for coala to know about the type of values they accept for
their settings. I grouped the settings into various types eg the ones
which accept bool values, the one which accept int or float i.e infinite
their settings. I grouped the settings into various types eg. the ones
which accept bool values, the one which accept `int` or `float` i.e infinite
set of values or the ones which accept some discrete set of strings like the
error codes for pycodestyle. I then collected these settings as a dict
error codes for `pycodestyle`. I then collected these settings as a `dict`
with all possible acceptable values as values to the dict, and made all
combinations of setting values as those bears. I then ran coala again and
again until i got a set of settings which produce no errors. I also added
some bears like the QuickstartBear which aided me i guessing the values
some bears like the `QuickstartBear` which aided me in guessing the values
of those settings which can potentially take an infinite set of values.
The last phase was involved with creating coala configuration files i.e.
`.coafile`s out of the collected green (i.e. non erroneous data)

#### Challenges

Seperating the bear settings was a challenge in itself as it was not scalable
due to missing type annotations in many bears. It was impossible to guess
due to missing type annotations / defualt values in many bears. It was
impossible to guess
whether a setting would take infinite values or a discrete set of values just
from the type annotations. For eg tab spaces don't take infinite values but
maximum line lengths for files on a particular project can.
from the type annotations. For eg. tab spaces don't take infinite values but
maximum line lengths for files on a particular project can. Things were
getting discussed about how we could use type annotations in bears to
specify the default values, leading to an easy identificaton of discrete type
settings.

The next challenge was launching the bears in a multiprocessing environment
and to decrease the run time of the coala-quickstarts's `--green-mode` as
much as possible.
much as possible. Dealt with generators along with multiprocessing and got
to know that they don't go well together.

The last challenge was creating configuration files out of the green results
and aggregating various settings into config file sections. Various tree
data structues and Trie data structures were involved to aggregate the per
file results (as we needed to config files to be as specific as possible)
file results (as we needed the config files to be as specific as possible)
into globs and sections.

#### Work to be done
Expand All @@ -160,3 +332,13 @@ them to run coala with just a single command: `coala`.

Tests should be improved by actually devising a way to clone a repo and run
`--green-mode` on it to increase the project's test coverage.

The config files can be produced in many ways. There is always a trade off
between the length of the `files` field or the length of the `ignores` field
or there may be infinitely many sections present. And anything that's too
much can overwhelm the user. Things need to be discussed whether different sub
modes of `--green-mode` can be made or to reach some sweet middle ground
between all the three factors.

### Link to detailed analysis, explanations and example runs of `--green-mode`
https://bitbucket.org/snippets/ishanSrt/qedaoo

0 comments on commit fae5891

Please sign in to comment.