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.
3137a69affc6b9bc9d5a04b068b5e3deaa63d0393fcefdea5d4338cb81d754f2
Copy Hash valueRepository | 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 |
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 |
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.
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.
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.
Commits that diable CI builds are inspected with CISkipInspectBear
. Files
that cannot disable CI build can be controlled by specifying filename patterns
in .coafile
.
git revert
commit must be exactly the revert of the commit it reverts. For
this inspection, GitRevertInspectBear
has been implemented.
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.