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
feat(api): add commit fields to access authors and PR number #1717
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks for this! One comment about the behavior of associated pull requests, otherwise this feature looks good.
associatedPRs.forEach(pr => { | ||
pr.commits.nodes.forEach(node => { | ||
node.commit.authors.nodes | ||
.map(author => author.name) | ||
.forEach(authors.add, authors); | ||
}); | ||
}); |
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.
I think this will grab authors that are not necessarily intended. Associated pull requests include any PRs that are mentioned in the commit message, not necessarily the PR that created it.
So if we mention another PR by another author, this will grab that PR's author who should not necessarily be attached to the current PR.
This weird behavior is why we have that logic to find the associated pull request whose merge commit SHA matches the commit SHA (skip the mentioned PRs)
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.
I'm a little puzzled, and I'm a little curious about what scenario this will happen in. Can you tell me how to trigger this problem?
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.
If you reference another PR in the PR body like See #1234
, then graphql will return that as an associatedPullRequest.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #1716