silence_pr_comments hides short failure messages such as project lock conflicts
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.
- I'd be willing to implement this feature (contributing guide)
Describe the user story
We run Atlantis for many repositories and projects. Long plan comments on GitHub pull requests caused GitHub to rate limit us, so we set silence_pr_comments: ["plan"] in the server-side repo configuration. This option fixes the rate limit problem.
But the option also hides the comment that tells a user why a plan did not run. If another pull request holds the project lock, Atlantis does not post this message:
Plan Failed: This project is currently locked by an unapplied plan from pull
#<PR-number>. To continue, delete the lock from#<PR-number>or apply that plan and merge the pull request.
The user sees only a failed atlantis/plan commit status and no reason. The user must then ask an operator or search the Atlantis server logs to find the cause. Other short failure messages have the same problem. If silence_pr_comments contains apply, Atlantis also hides "Pull request must be approved according to the project's approval rules before running apply."
Steps to reproduce:
- Set
silence_pr_comments: ["plan"]for a repository. - Open pull request A that changes project
foo. Atlantis plans it and locksfoo. - Open pull request B that also changes project
foo. - Atlantis sets a failed plan status on pull request B, but it posts no comment that names the lock or pull request A.
Describe the solution you'd like
If a project result has a failure message, Atlantis posts it even when the command is in silence_pr_comments. Atlantis continues to silence plan output, apply output, and errors, because they contain Terraform output and can be long.
Failure messages are short, fixed text that Atlantis writes. They include a project lock held by another pull request, unmet plan or apply requirements, and unapplied project dependencies. They tell the user what to do next.
The change is one condition in PullUpdater.updatePull in server/events/pull_updater.go, a unit test, and one sentence in the silence_pr_comments docs. An implementation is ready on this branch. When maintainers accept this issue, I can open a pull request.
Describe the drawbacks of your solution
Repositories that use silence_pr_comments get some comments again. Each comment is short, and Atlantis puts all failed projects of one command into one comment. The rate limit risk is much lower than for plan output, but it is not zero. For example, a pull request with many locked projects gets one comment on each autoplan.
Users who want no comments at all for a stage lose that behavior for failures.
Describe alternatives you've considered
- Post only the project lock message. This needs a new marker on the project result for lock failures, set at each lock call site in
server/events/project_command_runner.go. Unmet requirements cause the same confusion, so the wider rule seems more useful. - Add a new configuration value that keeps failure comments while the rest of the stage is silenced. This keeps the current default, but it adds one more option to the configuration and the docs.
- Rely on the commit status. The status description is short, and Atlantis uses it for project counts. It has no space for the lock reason and the link to the other pull request.
Source: runatlantis/atlantis