-
Notifications
You must be signed in to change notification settings - Fork 379
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
fix: associated pull requests should match merge commit sha #817
Conversation
…pull request for a commit
…ha matches the commit sha
Codecov Report
@@ Coverage Diff @@
## master #817 +/- ##
=======================================
Coverage 93.56% 93.56%
=======================================
Files 64 64
Lines 8870 8880 +10
Branches 930 883 -47
=======================================
+ Hits 8299 8309 +10
Misses 568 568
Partials 3 3
Continue to review full report at Codecov.
|
cc @kolea2 |
const pullRequest = graphCommit.associatedPullRequests.nodes.find( | ||
pr => { | ||
return pr.mergeCommit && pr.mergeCommit.oid === graphCommit.sha; | ||
} | ||
); | ||
if (pullRequest) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense though I'd be curious to understand better what a pr.mergeCommit.oid
is in different cases of how the PR could have been merged (e.g. traditional "create a merge commit", vs "squash", vs "rebase"). I guess whatever the PR-Merge strategy, this logic will find the PR that literally is the reason for this graphCommit.sha/pr.mergeCommit.oid
to exist in the history of the branch at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should fix some misidentified release PRs. Sometimes, multiple pull requests are associated with a commit. In those cases, match the merge commit sha against the commit sha to find the pull request that made that commit.
Fixes #818