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
Show GitHub comments in PR timeline for push events #387
Comments
Thank you for your proposal. |
Let's consider the specification. Default behavior
Strictly this may be a breaking change, but I think we don't have to treat this as a breaking change. Configuration
We can support configuration later. How to configure
How to handle when multiple pull requests are associated
How to handle when it fails to get associated pull requests
|
@suzuki-shunsuke Thanks for your consideration. Overall, I agree with all your points.
Since the GitHub change occurred just 2 days ago and the existing users have seen comments in the PR timeline for push events so far, most of them would expect
Opt-out will be able supported later but it should be noted that comments will be being shown as the PR comments for new users, who might be confused.
Yeah, posting commit comments should be fallback because it's quite common that commits aren't associated with a PR (e.g. merge commits, commits before creating a PR). Are you willing to work on implementation? If you're busy, I'm happy to get it work. |
Thank you for your feedback.
I really appreciate if you work on this issue. |
Published a prerelease https://github.com/suzuki-shunsuke/tfcmt/releases/tag/v3.4.0-1 |
Test$ tfcmt -v
tfcmt version 3.4.0-1 (48333cac413f4500b2631eebb9703a9edc5e0a9d)
$ terraform -v
Terraform v1.2.6
on darwin_arm64
+ provider registry.terraform.io/hashicorp/null v3.1.1 export GITHUB_TOKEN=xxx
export CIRCLECI=true
export CIRCLE_PROJECT_USERNAME=suzuki-shunsuke
export CIRCLE_PROJECT_REPONAME=test-github-action
export CIRCLE_SHA1=092cda867dea7b7a229bc2dcff64aaba8fb26f8d suzuki-shunsuke/test-github-action@092cda8 $ tfcmt plan -- terraform plan
null_resource.foo: Refreshing state... [id=8966706083595703589]
null_resource.bar: Refreshing state... [id=7780302426904623778]
No changes. Your infrastructure matches the configuration.
Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed. suzuki-shunsuke/test-github-action#104 (comment) 👍 It works well. In case of tfcmt v3.3.0, a comment is created to a commit. suzuki-shunsuke/test-github-action@092cda8#commitcomment-80523712 |
Test Applysuzuki-shunsuke/test-github-action@34f92a4
$ tfcmt apply -- terraform apply -no-color -auto-approve
null_resource.foo: Refreshing state... [id=8966706083595703589]
null_resource.bar: Refreshing state... [id=7780302426904623778]
No changes. Your infrastructure matches the configuration.
Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.
Apply complete! Resources: 0 added, 0 changed, 0 destroyed. suzuki-shunsuke/test-github-action#45 (comment) 👍 It works well. |
Released https://github.com/suzuki-shunsuke/tfcmt/releases/tag/v3.4.0 Thank you for your contribution! |
GitHub no longer shows commit comments in the pull request timeline 1.
It'd be worth considering an option to show comments as PR comments, not commit comments, even for push events or triggers, since some users would expect the behavior as it was and users need to jump to a commit page to see comments from
tfcmt
.Currently,
tfcmt
creates commit comments if a PR number isn't found 2 so fetching a PR number with a commit SHA before creating a comment would work, if the commit belongs to a PR.Footnotes
https://github.blog/changelog/2022-08-04-commit-comments-no-longer-appear-in-the-pull-request-timeline/ ↩
https://github.com/suzuki-shunsuke/tfcmt/blob/d4239c42b059961c4379ba731726312b80290667/pkg/notifier/github/comment.go#L22-L41 ↩
The text was updated successfully, but these errors were encountered: