feat: enabling pending apply status when any of the projects has changes to…#5926
Merged
GenPage merged 18 commits intorunatlantis:mainfrom Dec 1, 2025
Merged
Conversation
7888091 to
804f27d
Compare
…ges to be applied Signed-off-by: Ricardo Silveira <ricardo.silveira@olx.com>
804f27d to
862f0b8
Compare
…rojects has changes to be applied Signed-off-by: Ricardo Silveira <ricardo.silveira@olx.com>
cf520d4 to
c96562e
Compare
|
This feature is a must-have for me. |
|
Thanks for adding this, I like it. |
Signed-off-by: Ricardo Silveira <ricardo.silveira@olx.com>
…5966) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Ricardo Silveira <ricardo.silveira@olx.com>
ce9f28d to
7825027
Compare
lukemassa
previously approved these changes
Nov 21, 2025
Signed-off-by: Adam Gościcki <adamgoscicki@gmail.com> Signed-off-by: Adamovix <adamgoscicki@gmail.com>
Signed-off-by: Ricardo Silveira <ricardo.silveira@olx.com>
…(main) (#5974) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Rui Chen <rui@chenrui.dev>
Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Rui Chen <rui@chenrui.dev> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Rui Chen <rui@chenrui.dev>
Signed-off-by: Ed Laur <eduard.laur@wolt.com> Co-authored-by: Rui Chen <rui@chenrui.dev>
Signed-off-by: Ricardo Silveira <ricardo.silveira@olx.com>
53613d5 to
3cba37d
Compare
lukemassa
approved these changes
Nov 30, 2025
jamengual
approved these changes
Dec 1, 2025
WebOfNakedFancies
pushed a commit
to WebOfNakedFancies/atlantis
that referenced
this pull request
Dec 2, 2025
…ges to… (runatlantis#5926) Signed-off-by: Ricardo Silveira <ricardo.silveira@olx.com> Signed-off-by: Adam Gościcki <adamgoscicki@gmail.com> Signed-off-by: Adamovix <adamgoscicki@gmail.com> Signed-off-by: Rui Chen <rui@chenrui.dev> Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Ed Laur <eduard.laur@wolt.com> Co-authored-by: Ricardo Silveira <ricardo.silveira@olx.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Adam Gościcki <adamgoscicki@gmail.com> Co-authored-by: Rui Chen <rui@chenrui.dev> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ed Laur <eduard.laur@wolt.com> Co-authored-by: Luke Massa <lukefrederickmassa@gmail.com> Signed-off-by: WebOfNakedFancies <akubi@gmx.com>
aidansteele
pushed a commit
to aidansteele/atlantis
that referenced
this pull request
Mar 12, 2026
…ges to… (runatlantis#5926) Signed-off-by: Ricardo Silveira <ricardo.silveira@olx.com> Signed-off-by: Adam Gościcki <adamgoscicki@gmail.com> Signed-off-by: Adamovix <adamgoscicki@gmail.com> Signed-off-by: Rui Chen <rui@chenrui.dev> Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Ed Laur <eduard.laur@wolt.com> Co-authored-by: Ricardo Silveira <ricardo.silveira@olx.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Adam Gościcki <adamgoscicki@gmail.com> Co-authored-by: Rui Chen <rui@chenrui.dev> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ed Laur <eduard.laur@wolt.com> Co-authored-by: Luke Massa <lukefrederickmassa@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
This MR restores the ability to set commit status to pending when there are planned Terraform changes that haven't been applied yet. This feature is now:
GitLab-specific (controlled by the --pending-apply-status flag)
Opt-in (defaults to false to maintain backward compatibility)
Provides better visibility into MR readiness by blocking merges until all applies are completed
Why
When enabled, this feature prevents GitLab merge requests from being merged prematurely by setting the commit status to pending when:
The status transitions:
This addresses a common workflow requirement where teams want to ensure all infrastructure changes are actually applied before allowing the MR to merge, preventing situations where planned changes are approved but never executed.
Why GitLab-only and opt-in?
The original implementation (#2053) caused issues (#2138) with race conditions where apply status would appear before plans completed, leading to confusion and stuck PRs. The feature was reverted in #2173.
Since then, Atlantis has significantly improved its event ordering and status update handling. However, to ensure maximum safety and backward compatibility, this restoration:
Limits scope to GitLab - where the feature is most requested and tested
Requires explicit opt-in - prevents unexpected behavior changes for existing users
Preserves existing behavior - when disabled or on other VCS platforms, no status updates occur for unapplied plans
Tests
Added comprehensive test coverage in TestPlanCommandRunner_PendingApplyStatus:
✅ GitLab + flag enabled + unapplied plans → Pending status
✅ GitLab + flag disabled + unapplied plans → No status update (backward compatible)
✅ GitLab + all plans applied → Success status
✅ GitHub/Bitbucket + flag enabled → No status update (GitLab-only feature)
✅ GitLab + apply errors → Failed status
All existing tests pass, ensuring backward compatibility is maintained.
References
Original feature (2021): https://github.com/runatlantis/atlantis/pull/2053/files
Issue reports (race conditions): https://github.com/runatlantis/atlantis/issues/2138
Feature revert (2022): https://github.com/runatlantis/atlantis/pull/2173/files
Key improvements since the original implementation:
The latest Atlantis codebase now handles event ordering much more reliably. The race condition issues that caused the original revert (where apply status would appear before plans properly finished) have been resolved through improved event sequencing. This makes it safe to reintroduce the feature with proper safeguards (opt-in flag + VCS-specific implementation).
Configuration:
See updated documentation in server-configuration.md.
This approach provides the requested functionality while learning from past issues and ensuring a smooth, safe rollout for teams that need this workflow enforcement.