Releases: suzuki-shunsuke/tfcmt
v0.7.0
Breaking Change
#62 the template variable Body
is removed
#67 Embed github-comment metadata to support hide comments with github-comment
the template variable Body
is removed
Please replace Body
into CombinedOutput
.
CombinedOutput
includes both the standard output and standard error output.
Embed github-comment metadata to support hide comments with github-comment
The following metadata is embedded into comment.
<!-- github-comment: {"Command":"plan","JobID":"aaa","JobName":"build","PRNumber":69,"Program":"tfcmt","SHA1":"xxx","Vars":{}} -->
We can hide comments with github-comment's hide command.
Feature
#63 improve default template
#61 support to get a pull request number from CI_INFO_PR_NUBER
#56 #59 add log level option and log.level configuration and output structured log with logrus
#55 #58 add command-line options about CI
improve default template
Add ✅ and ❌ to comment title to make the result clear
ex.
AS IS
## Apply Result
TO BE
## :x: Apply Result
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.
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
Fix
#62 parse error result properly
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
TO BE
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
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
TO BE
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
Breaking Changes
#60 Old comments of terraform plan are hidden by default.
Feature
#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
Feature
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
Breaking Changes
#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
#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
v0.6.0-1
v0.6.0-0
Breaking Changes
#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
#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