Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow applying 0 projects when disable-apply-all is used #1361

Closed

Conversation

rickard-von-essen
Copy link

This PR introduces a new flag --empty/-e to the apply command. This makes it possible to "apply" all changes when the --disable-apply-all flag is set. Without this this you can't get such PR merged if Github has atlantis/apply as a required status check.

TODO

  • Docs

Alternative solution

Instead of adding the -e flag to the apply command the check in command_runner.go#L217 can be postponed and allow atlantis apply without flags if and only if there is zero projects to apply even if the --disable-apply-all flag was used.

Fixes: #1359

@codecov
Copy link

codecov bot commented Jan 25, 2021

Codecov Report

Merging #1361 (9484946) into master (1137a82) will decrease coverage by 0.08%.
The diff coverage is 38.46%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1361      +/-   ##
==========================================
- Coverage   69.99%   69.90%   -0.09%     
==========================================
  Files          74       74              
  Lines        5575     5586      +11     
==========================================
+ Hits         3902     3905       +3     
- Misses       1310     1316       +6     
- Partials      363      365       +2     
Impacted Files Coverage Δ
server/events/command_runner.go 50.00% <16.66%> (-0.88%) ⬇️
server/events/comment_parser.go 92.02% <50.00%> (-1.96%) ⬇️
server/events/event_parser.go 84.97% <100.00%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1137a82...9484946. Read the comment docs.

@nishkrishnan
Copy link
Contributor

👋 @ rickard-von-essen mind clarifying why atlantis/apply would be set as a required status check if disable-apply-all set on Atlantis?

Based on the description this seems a little bit hacky/counterintuitive but maybe I'm not seeing the usecase where this is necessary.

@nishkrishnan nishkrishnan added the waiting-on-response Waiting for a response from the user label Jan 28, 2021
@rickard-von-essen
Copy link
Author

@nishkrishnan we have a repo containing all projects for all environments. We have this setup with auto plan, disable apply all, and auto merge. Both Atlantis plan and apply are required status checks.

This works well allowing users to propagate changes through envonments at their selected pace. At the same time it ensures all changes have been applied before the PR gets automatically merging (releasing all locks allowing other changes to come through).

@nishkrishnan nishkrishnan added waiting-on-review Waiting for a review from a maintainer and removed waiting-on-response Waiting for a response from the user labels Feb 8, 2021
@nishkrishnan
Copy link
Contributor

Solved by: #1323

@nishkrishnan nishkrishnan added waiting-on-response Waiting for a response from the user and removed waiting-on-review Waiting for a review from a maintainer labels Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-on-response Waiting for a response from the user
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Impossible to merge (apply) when 0 projects where planned and disable-apply-all is used
2 participants