mercari / tfnotify

A CLI command to parse Terraform execution result and notify it to GitHub
MIT License
620 stars 92 forks source link

added feature to label issues with label on no changes #72

Closed drlau closed 4 years ago

drlau commented 4 years ago

WHAT

This PR adds a feature to optionally add a label to a Github PR when the terraform plan output has no changes.

WHY

With this, routine PRs that don't result in any changes to existing infrastructure can be easily triaged and become actionable with CI.

babarot commented 4 years ago

Thank you for the contribution, @drlau. Awesome, but I left 1 comment.

drlau commented 4 years ago

@b4b4r07 I updated the README, please take a look!

Also, what is your opinion on attempting to remove the label? And if it does, should it always remove the label before running so that Github will create an "IssueLabeled" event for webhooks?

babarot commented 4 years ago

@drlau

Also, what is your opinion on attempting to remove the label?

Yeah, that's more friendly for users. This is because there are some cases which users add some changes. If so, it is not no-changes but the label will be still on there. So it should be removed depending on users changes.

And if it does, should it always remove the label before running so that Github will create an "IssueLabeled" event for webhooks?

tfnotify doesn't have event fetch feature now. So if we get the changes depending on users changes, currently we need to check terraform plan change each time and if it is not no-changes change, we need to remove it..!

drlau commented 4 years ago

Hmm I think it's fine to always remove the label. If the PR gets updated but it's still no changes, it'll remove the label but re-add it. This generates another "IssueLabeled" event for webhooks but other than that there's no changes, which should be ok.

babarot commented 4 years ago

Released: https://github.com/mercari/tfnotify/releases/tag/v0.6.1