Skip to content

v0.7.0-0

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 21 Jan 10:31

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

Breaking Changes

https:/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:/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