Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to compare between fork point #46

Merged
merged 24 commits into from
Dec 23, 2020
Merged

Conversation

jonnycaley
Copy link
Contributor

@jonnycaley jonnycaley commented Dec 23, 2020

Addresses #4

Adds the ability to compare between the fork point of the current branch.

Added a compareFrom configuration so the user is able to enter the desired behaviour when comparing the current branch changes to either:

  • Previous commit
  • Fork point commit

I made a CommitShaProvider interface which contains a function which takes the CommandRunner and returns a Sha. I would have preferred to have the CommitShaProvider return a single command without the CommandRunner parameter (as suggested here) but nested commands aren't supported by the ProcessBuilder (e.g.

git merge-base $(git rev-parse --abbrev-ref HEAD) $(git show-branch -a | grep '\*' | grep -v `git rev-parse --abbrev-ref HEAD` | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//')

) so I opted for the current solution.

…he branch changes should be made against. Currently supports comparing against PreviousCommit and ForkCommit
…t the end of each line, executeAndParseFirst returns the first line of stdout without the new line character - lets us clean up some common code to remove this new line character etc
Revert "App Change"

This reverts commit 4a34ec51
@codecov
Copy link

codecov bot commented Dec 23, 2020

Codecov Report

Merging #46 (5fc7d50) into main (54bf063) will increase coverage by 2.09%.
The diff coverage is 66.66%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main      #46      +/-   ##
============================================
+ Coverage     44.05%   46.15%   +2.09%     
- Complexity       28       39      +11     
============================================
  Files             8       11       +3     
  Lines           404      429      +25     
  Branches         88       95       +7     
============================================
+ Hits            178      198      +20     
- Misses          197      200       +3     
- Partials         29       31       +2     
Impacted Files Coverage Δ Complexity Δ
...in/com/dropbox/affectedmoduledetector/GitClient.kt 10.29% <14.28%> (+1.06%) 0.00 <0.00> (ø)
...x/affectedmoduledetector/AffectedModuleDetector.kt 38.54% <33.33%> (-0.35%) 1.00 <0.00> (ø)
...tedmoduledetector/commitshaproviders/ForkCommit.kt 72.72% <72.72%> (ø) 6.00 <6.00> (?)
...ectedmoduledetector/AffectedModuleConfiguration.kt 100.00% <100.00%> (ø) 11.00 <3.00> (+3.00)
...ledetector/commitshaproviders/CommitShaProvider.kt 100.00% <100.00%> (ø) 0.00 <0.00> (?)
...oduledetector/commitshaproviders/PreviousCommit.kt 100.00% <100.00%> (ø) 2.00 <2.00> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 54bf063...5fc7d50. Read the comment docs.

@digitalbuddha
Copy link
Contributor

Wow thank you for all the hard work! I'll review in the next few days. Doing holiday stuff now

@jonnycaley
Copy link
Contributor Author

jonnycaley commented Dec 23, 2020

No need to thank, was a pleasure to contribute 😄 Sounds good! Have a merry Christmas! 🎅

Copy link
Contributor

@changusmc changusmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, thank you for this PR and especially for increasing code coverage!

I have 1 small request.

@jonnycaley
Copy link
Contributor Author

I don't have write access to this repo. Is someone able to merge this for me? Or alternatively, grant me write access

@changusmc changusmc merged commit f3ade73 into dropbox:main Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants