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: support PR comments for push events #390
feat: support PR comments for push events #390
Conversation
Since GitHub no longer shows commit comments in the pull request timeline [^1], it needs to find a PR associated with a commit in a push event and then post a PR comment if found in order to show comments in the pull request timeline. [^1]: github.blog/changelog/2022-08-04-commit-comments-no-longer-appear-in-the-pull-request-timeline Signed-off-by: micnncim <micnncim@gmail.com>
Thank you for your contribution! |
pkg/notifier/github/commits.go
Outdated
prs, _, err := g.client.API.PullRequestsListPullRequestsWithCommit(ctx, sha, nil) | ||
if err != nil { | ||
return 0, err | ||
} | ||
for _, pr := range prs { | ||
if pr.GetState() != "closed" { | ||
if pr.GetState() != string(state) { |
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.
Could you check Pull Request's UpdatedAt
?
How to handle when multiple pull requests are associated
Choose the latest updated pr
I don't know the order of 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.
Done: d359a60
(#390)
Signed-off-by: micnncim <micnncim@gmail.com>
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!
@suzuki-shunsuke Thanks for your quick review! When are planning to release a new version? |
I have already released v3.4.0. |
I missed the release. Thanks a lot again. |
Since GitHub no longer shows commit comments in the pull request timeline 1, it needs to find a PR associated with a commit in a push event and then post a PR comment if found in order to show comments in the pull request timeline.
See #387 for more details.
Footnotes
https://github.blog/changelog/2022-08-04-commit-comments-no-longer-appear-in-the-pull-request-timeline ↩