Google Summer of Code 2018 Work Product Submission



coala

Kriti Rohilla

I am in my pre-final year at University Institute of Engineering and Technology, Panjab University. As part of my GSoC 2018 project, I worked on VCS related bears in coala-bears. The main task was to detect special git commits like git revert, git merge and commits that skip CI build and inspect such commits to see whether they meet the requirements of the project.


Patches Tarball


SHA-256:

3137a69affc6b9bc9d5a04b068b5e3deaa63d0393fcefdea5d4338cb81d754f2

Bonding

Phase 1

Phase 2

Phase 3


Links to commits and repositories I've worked on:

Repository Link to Commit/s Description
p  projects View

commit-content-checks.md: Add issue link to project description.

p  projects View

igitt_scm_support.md: Add a new project named IGitt scm support.

c  cEPs View

cEP-0016.md: Add cEP for the project.

c  coala-bears View

CommitBear.py: Fix regex for issue id in CommitBear.

c  coala-bears View

GitCommitBear.py: Add settings to ignore GitHub PR merge commits.

c  coala-bears View

VCSCommitMetadataBear.py: Add new metabear to analyze git commits.

c  coala-bears View

generate_package.py: Replace touch function with library function Path.

c  coala-bears View

GitLinearCommitBear.py: Add new bear to inspect git merge commits.

c  coala-bears View

CISkipInspectBear.py: Add bear to inspect commits that disable CI builds.

c  coala-bears View

GitRevertInspectBear.py: Add new bear to inspect git revert commits.


Git Commit Content Inspection

Work Done

  1. A metadata bear called VCSCommitMetadataBear has been implemented which analyzes the commit at HEAD and returns all relevant information about it as HiddenResult to the bear using it.

  2. GitHub PR merge commits were responsible for Travis CI build failure. Settings have been included in GitCommitBear to detect such commits and ignore them. The bear now performs checks on the parent commit instead.

  3. GitLinearCommitBear has been implemented to detect git merge commits and inform the author to perform git rebase instead in order to keep the history clean.

  4. Commits that diable CI builds are inspected with CISkipInspectBear. Files that cannot disable CI build can be controlled by specifying filename patterns in .coafile.

  5. git revert commit must be exactly the revert of the commit it reverts. For this inspection, GitRevertInspectBear has been implemented.

Challenges

The major challenge I faced when doing this project was to come up with a proper design since there were some bears already available for handling git commits. So it required making a perfect balance between using the available code while still keeping the new bears independent. When design was clear on paper, the next challenge was to actually implement it. I had never been practically exposed to object oriented programming in such great detail before so it was great to convert all the theoretical knowledge into practical use.