-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
- If you are interested in working on this issue or have submitted a pull request, please leave a comment.
Overview of the Issue
When multiple Atlantis instances watch the same repository, an Atlantis instance that does not manage a project touched by a pull request can still cause approvals to be discarded if ATLANTIS_DISCARD_APPROVAL_ON_PLAN=true.
In other words, an Atlantis instance that is not watching or is not responsible for the specific project changed by the PR still dismisses approvals created by another Atlantis instance in the same repository.
Reproduction Steps
- Configure two Atlantis instances to watch the same repository, each configured for a different set of projects.
- Enable
ATLANTIS_DISCARD_APPROVAL_ON_PLAN=trueon one or both instances. - Create a PR that touches files for project A (managed by Atlantis A) but not project B (managed by Atlantis B).
- Let someone approve the fictional plan.
- Re-push a requested change or trigger plan manually
- Approval for whole PR gets dismissed by B.
Logs
For that case irrelevant, its a behavioral request.
Environment details
ATLANTIS_DISCARD_APPROVAL_ON_PLAN must be true on both projects.
Actual behavior
An Atlantis instance that is not watching or otherwise not responsible for the project that produced the plan still causes the plan approval to be discarded when it evaluates the PR, even if it has no relevant changes to apply.
Expected behavior
An Atlantis instance should only discard approvals when:
- the instance is configured to watch/handle the project(s) that are part of the PR and
- its own plan shows changes (or at minimum, the instance’s project is affected by the PR).
Impact
- Unnecessary approval dismissal and churn on PRs that touch multiple independent projects.
- Confusing UX for reviewers and developers (approvals disappear despite no relevant changes for some instances).
- Breaks multi-Atlantis workflows where multiple instances legitimately watch the same repository for different projects.
Suggested change
- Make
ATLANTIS_DISCARD_APPROVAL_ON_PLANonly trigger a discard when the Atlantis instance’s own project(s) are included in the PR and its plan shows non-empty changes — or otherwise ensure an instance only acts on plans for projects it actually manages. - Alternatively, add a guard that skips discard logic entirely when the instance determines the PR does not affect any of its configured projects.
Additional Context
How we come up with such a thing?
Due to the strict security nature of our company we separate github from azure automation. Both tho watch the same infrastructure repository.
When the github Atlantis should plan/apply/react but a plan is executed, azure Atlantis comes and waives approvals even though the branch does not touch that project at all!
And yes, we are heavy Atlantis users, we have 16 of them targeting the same repository #sekurity #separationOfConcerns