Skip to content

Releases: suzuki-shunsuke/tfcmt

v0.7.0-3

23 Feb 06:07
Compare
Choose a tag to compare
v0.7.0-3 Pre-release
Pre-release

v0.7.0-2...v0.7.0-3

Breaking Change

#67 stop to hide comments

In v0.7.0-0, we introduced the feature to hide old comments automatically, but we decided to revert this feature.
We can hide comments with github-comment's hide command.

The following metadata is embedded into comment.

<!-- github-comment: {"Command":"plan","JobID":"aaa","JobName":"build","PRNumber":69,"Program":"tfcmt","SHA1":"xxx","Vars":{}} -->

v0.7.0-2

28 Jan 03:21
Compare
Choose a tag to compare
v0.7.0-2 Pre-release
Pre-release

v0.7.0-1...v0.7.0-2

Breaking Change

#62 the template variable Body is removed

Please replace Body into CombinedOutput.
CombinedOutput includes both the standard output and standard error output.

Feature

#63 feat: improve default template

Add ✅ and ❌ to comment title to make the result clear

ex.

AS IS

## Apply Result

TO BE

## :x: Apply Result

Fix

#62 parse error result properly

tfcmt parsed only the standard output and ignored standard error output, so it failed to parse the error result.

ex.

$ tfcmt apply -- terraform apply -auto-approve

AS IS

image

TO BE

image

v0.7.0-1

27 Jan 01:17
Compare
Choose a tag to compare
v0.7.0-1 Pre-release
Pre-release

v0.7.0-0...v0.7.0-1

Feature

#61 feat: support to get a pull request number from CI_INFO_PR_NUBER

ci-info is a CLI tool to get CI related information, and the environment variable CI_INFO_PR_NUMBER is set via ci-info by default.
If the pull request number can't bet gotten but CI_INFO_PR_NUMBER is being set, CI_INFO_PR_NUMBER is used.

v0.7.0-0

21 Jan 10:31
Compare
Choose a tag to compare
v0.7.0-0 Pre-release
Pre-release

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

v0.6.1

20 Jan 00:34
Compare
Choose a tag to compare

v0.6.0...v0.6.1
Milestone

Feature

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

#50 #51 add templates config

ex.

templates:
  title: "## Plan Result ({{.Vars.target}})"
terraform:
  plan:
    template: |
      {{template "title" .}}

The following builtin templates are defined. We can override them.

  • plan_title
  • apply_title
  • result
  • updated_resources
  • deletion_warning

v0.6.0

19 Jan 11:49
Compare
Choose a tag to compare

v0.5.0...v0.6.0
Milestone

Breaking Changes

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

#40 remove message option and template variable Message
#41 remove --title and --destroy-warning-title options and template variable .Title
#44 pull request labels are updated by default
#46 the variable target is added to the default template and the default label name

Feature

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

#42 #49 improve default template
#43 get GitHub token from the environment variable "GITHUB_TOKEN" by default
#44 pull request labels are updated by default
#45 make the configuration file optional
#46 add the variable "target" to default template and default label name

v0.6.0-2

19 Jan 09:42
Compare
Choose a tag to compare
v0.6.0-2 Pre-release
Pre-release

v0.6.0-1...v0.6.0-2
Milestone

Feature

#49 improve default destroy warning template

v0.6.0-1

19 Jan 09:17
Compare
Choose a tag to compare
v0.6.0-1 Pre-release
Pre-release

v0.6.0-0...v0.6.0-1
Milestone

Fixes

#48 fix default no change label

v0.6.0-0

19 Jan 08:48
Compare
Choose a tag to compare
v0.6.0-0 Pre-release
Pre-release

v0.5.0...v0.6.0-0
Milestone

Breaking Changes

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

#40 remove message option and template variable Message
#41 remove --title and --destroy-warning-title options and template variable .Title
#44 pull request labels are updated by default
#46 the variable target is added to the default template and the default label name

Feature

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

#42 improve default template
#43 get GitHub token from the environment variable "GITHUB_TOKEN" by default
#44 pull request labels are updated by default
#45 make the configuration file optional
#46 add the variable "target" to default template and default label name

v0.5.0

19 Jan 00:32
Compare
Choose a tag to compare

v0.4.0...v0.5.0
Milestone

Feature

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

#39 feat: add template variables CreatedResource, UpdatedResources, DeletedResources and ReplacedResources

As a summary of the result of terraform plan, it is convenient to show a list of resource paths.
So the following template variables are added.

  • .CreatedResources: a list of created resource paths ([]string)
  • .UpdatedResources: a list of updated resource paths ([]string)
  • .DeletedResources: a list of deleted resource paths ([]string)
  • .ReplacedResources: a list of replaced resource paths ([]string)

For example,

{{if .CreatedResources}}
* Create
{{- range .CreatedResources}}
  * {{.}}
{{- end}}{{end}}{{if .UpdatedResources}}
* Update
{{- range .UpdatedResources}}
  * {{.}}
{{- end}}{{end}}{{if .DeletedResources}}
* Delete
{{- range .DeletedResources}}
  * {{.}}
{{- end}}{{end}}{{if .ReplacedResources}}
* Replace
{{- range .ReplacedResources}}
  * {{.}}
{{- end}}{{end}}
* Create
  * null_resource.foo
* Update
  * mysql_database.bar
* Delete
  * null_resource.bar
* Replace
  * mysql_database.foo