feat: introduce the --set-atlantis-apply-check-successful-if-no-changes
flag to allow disabling the behavior that automatically sets the atlantis/apply status check to "passing" on a VCS pull request if the atlantis plan command results in "No Changes"
#4332
+281
−168
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
what
Introduce the
--set-atlantis-apply-check-successful-if-no-changes
to allow disabling the behavior that automaticallysets the
atlantis/apply
status check to "passing" on a VCS pull request if theatlantis plan
command results in "No Changes".An initial version of this flag had been implemented as part of #3378 by @chroju but during that (somewhat lengthy) PR's discussion it was decided that this would be the default behavior and no flag would be added, so a breaking change was introduced as part of v0.25.0.
I decided to use the latest name for the flag (
--set-atlantis-apply-check-successful-if-no-changes
) from the original PR (before it was removed), and I also left its default value set to true in order to keep backwards compatibility.why
In our scenario, the motivation for adding this is flag is twofold:
terraform apply
command before any changes are merged to the main branch.terraform apply
step when there's a plan with "No Changes" we are having to manually run anapply
command in order to keep the state file up-to-date.tests
server/events/plan_command_runner_test.go
false
correctly fixes itreferences
This recent comment on #3378 faces the same issue.