Google Summer of Code 2018 Work Product Submission



coala

Nitanshu Vashistha

I am a sophomore year student studying Information Technology at Manipal University, Jaipur. I participated in GSoC and worked with coala to make enhancements in corobo which is a bot used by the coala community to onboard newcomers and automate development tasks. My project was dedicated to make corobo secure by reducing its surface vulnerability. I also implemented a better testing infrastructure to test the plugins, as well as to make the existing plugins configurable so that they can also be adapted by other communities to cater their needs.


Patches Tarball


SHA-256:

dc41eb4ec8294e6033209162eba25b55710894174e3f00a6b2f407a60c607b49

Bonding

Phase 1

Phase 2

Phase 3


Links to commits and repositories I've worked on:

Repository Link to Commit/s Description
c  cEPs View

cEP-0015.md: corobo enhancement

c  corobo View

labhub_test: Ignore test temporarily

e  err-backend-gitter View

gitter: Fix Room.occupants API request

c  corobo View

err-backend-gitter: Bump up to latest commit

c  corobo View

requirements.txt: Bump IGitt version

c  corobo View

labhub: Modify invite permissions

c  corobo View

labhub: Update newcomer issue assignment rule

c  corobo View

labhub: Hello World msg and invite modification

c  corobo View

tests: Remove unnecessary self handling of TestBot

c  corobo View

Ban: Add plugin to ban/unban users

c  corobo View

labhub_test: Increase timeout limit

c  corobo View

LabHub: Remove redundant teams list

c  corobo View

.coafile: Include tests

c  corobo View

labhub: Make labhub private to org members

c  corobo View

moban: Moban Sync

c  corobo View

requirements.txt: Unpin pyopenssl

e  errbot View

TestBot: Implement inject_mocks method

e  errbot View

TestBot: Add multi-line command test support

c  corobo View

requirements.txt: Update Errbot

c  corobo View

tests: Implement CoroboTestCase

c  corobo View

config.py: Create empty data sub-directory

c  corobo View

configuration: Implement DefaultConfigMixin

c  corobo View

SpammingAlert: Adapt to DefaultConfigMixin

c  corobo View

GitStats: Remove LabHub inheritance

c  corobo View

LabHubTestCase: LabHub testing setup

c  corobo View

LabHub: Use activate and configuration templates

c  corobo View

tests: Isolate tests from loading labhub

c  corobo View

DefaultConfigMixin: Modify implementation

c  corobo View

WolframAlpha: Adapt to use CONFIG_TEMPLATE

c  corobo View

Answer: Adapt to use CONFIG_TEMPLATE

c  corobo View

LabHub: Make noisy commands private to org members


Corobo Enhancement - Security, Testing and Configurability

Work Done

  1. Security Enhancements:
    1. Gave developers the right to invite newcomers.
    2. Removed automatic invite through ‘Hello World’ and ‘invite me’
    3. Newcomers won’t get assigned to more than one newcomer issue.
    4. Added a bot command to ban and unban a user from all the rooms at once.
    5. Made important plugins private to members of the organization.
  2. Testing Enhancements:
    1. Implemented functionality in Errbot to inject mock objects in a plugin while testing.
    2. Implemented functionality in Errbot to test multi-line commands.
    3. Implemented a custom CoroboTestCase to ease testing of plugins.
    4. Implemented a custom LabHubTestCase to test labhub dependent plugins.
    5. All the tests now use TestCases rather then handling the bot themselves.
  3. Configurability:
    1. Implemented a DefaultConfigMixin to configure the plugins at the time of deployment.
    2. LabHub now uses activation method instead of init.
    3. Answer, LabHub, SpammingAlert and WolframAlpha can now be configured through chat and can be adapted by other organizations.

Challenges

Most things went smoothly. The biggest challenge for me was to design the testing infrastructure to make testing of plugins easier but I am grateful to my helful mentors for supporting and making the task easier.

Work to be done

Teams in LabHub plugins are still coala specific and need to be made configurable. Community stats should be moved out of LabHub and to be made configurable along with explain plugin.