Enable catching non pull request commits in repositories#1
Open
Enable catching non pull request commits in repositories#1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding a --catch-non-pr-commits or -C flag when running Reposense.jar or adding a yes in the Catch Non PR Commits column in repo-config.csv will trigger reposense to detect the number of commits each person has made that did not go through a pull request.
I remember that such commits in CS2103T are frowned upon a lot and noticed that reposense has no way of automatically catching such commits. After looking through developer tools in the browser I realized that github checks if a commit belongs to some pr through a certain URL and utilized that in the implementation of this enhancement.
I have only managed to implement the backend aspect of this and have yet to integrate it with the frontend. Proof that it works:
Commit which was directly pushed into repo without a pull request:
Commit URL: FH-30/Test-Repo@ab16e85
Commit which went through a pull request:
Commit URL: FH-30/Test-Repo@b21b50a
I have also compiled everything into a map which is displayed at the end of the commits.json file RepoSense generates as can be seen in the picture below:
Commits.json file inside a zip file relevant to discussion:
commits.json.zip
I have yet to add tests, documentation and have not checked checkstyle tests. I won't mind doing it if you would like!
Hope this clarifies!