github suzuki-shunsuke/tfcmt v0.7.0-0

latest releases: v4.14.0, v4.14.0-1, v4.13.0...
pre-release3 years ago

v0.6.1...v0.7.0-0
Milestone

Breaking Changes

https://github.com/suzuki-shunsuke/tfcmt/pulls?q=is%3Apr+is%3Aclosed+label%3A%22breaking+change%22+milestone%3Av0.7.0

#60 Old comments of terraform plan are hidden by default.

Feature

https://github.com/suzuki-shunsuke/tfcmt/pulls?q=is%3Apr+is%3Aclosed+milestone%3Av0.7.0+label%3Aenhancement

#47 #60 support to hide old comments
#56 #59 add log level option and log.level configuration and output structured log with logrus
#55 #58 add command-line options about CI

support to hide old comments

tfcmt hides old comments of terraform plan by default.
Comments of terraform apply aren't hidden.

When tfcmt posts a comment, tfcmt injects a HTML comment \n<!-- tfcmt:plan{{if .Vars.target}}:{{.Vars.target}}{{end}} --> to the suffix.
And before posting the comment, tfcmt gets a list of pull request comments and selects comments which will be hidden.

Comments which match all of the following conditions are hidden.

  • comment author is same as tfcmt's authenticated user. When it failed to get the authenticated user login, this condition is ignored
  • tfcmt's authenticated user has a permission to hide the comment
  • comment includes <!-- tfcmt:plan{{if .Vars.target}}:{{.Vars.target}}{{end}} -->

After it succeeds to post a comment, tfcmt hides them.
If it failed to post a comment, comments aren't hidden.

We can disable this feature by setting terraform.plan.hide_old_comment.disable: true.

---
terraform:
  plan:
    hide_old_comment:
      disable: true

add log level option and log.level configuration and output structured log with logrus

ex.

$ tfcmt --log-level debug plan -- terraform plan
---
log:
  level: debug

add command-line options about ci

  • -owner
  • -repo
  • -pr
  • -sha
  • -build-url

mercari/tfnotify gets these parameters from only environment variables, so we don't use mercari/tfnotify on the platform which mercari/tfnotify doesn't support.
On the other hand, tfcmt supports to specify these parameters by command-line options, so we can use tfcmt anywhere.

ex.

$ tfcmt -owner suzuki-shunsuke -repo tfcmt -pr 3 -- terraform plan

Don't miss a new tfcmt release

NewReleases is sending notifications on new releases.