-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Diverge warning #867
Diverge warning #867
Conversation
Codecov Report
@@ Coverage Diff @@
## master #867 +/- ##
==========================================
+ Coverage 71.86% 71.87% +<.01%
==========================================
Files 65 65
Lines 5222 5244 +22
==========================================
+ Hits 3753 3769 +16
- Misses 1184 1188 +4
- Partials 285 287 +2
Continue to review full report at Codecov.
|
96c583a
to
386e958
Compare
- only check for divergence if using checkout strategy merge
386e958
to
889d584
Compare
I have to admit this is a nice refactor 👍 |
Haha thanks! I would have preferred to work with you on it via review but I don't have much time to work on Atlantis these days so figured it's better to go ahead and get it merged asap. |
Don't worry, I think it was more efficient like that and the goal was to get it merged asap. |
The current "merge" checkout strategy is unsafe. It merges the PR and the base branch without holding the directory lock(s), so there is a potentially very long window where another PR can be applied and be unexpectedly reverted later. This happens occasionally if a PR causes plans in multiple directories, but is almost _guaranteed_ to happen if the initial plan has to wait until a lock is freed up and a manual "atlantis plan" command is given. Instead of printing a warning when this happens, we now merge again if necessary while holding the lock. Plans are then guaranteed to only be made when merged with the base branch for each directory being planned, and applying later should be safe even if the base branch sees further updates. This fixes/affects runatlantis#804, runatlantis#867, runatlantis#979
The current "merge" checkout strategy is unsafe. It merges the PR and the base branch without holding the directory lock(s), so there is a potentially very long window where another PR can be applied and be unexpectedly reverted later. This happens occasionally if a PR causes plans in multiple directories, but is almost _guaranteed_ to happen if the initial plan has to wait until a lock is freed up and a manual "atlantis plan" command is given. Instead of printing a warning when this happens, we now merge again if necessary while holding the lock. Plans are then guaranteed to only be made when merged with the base branch for each directory being planned, and applying later should be safe even if the base branch sees further updates. This fixes/affects runatlantis#804, runatlantis#867, runatlantis#979
…n base update (#3187) * merge again if base branch has been updated The current "merge" checkout strategy is unsafe. It merges the PR and the base branch without holding the directory lock(s), so there is a potentially very long window where another PR can be applied and be unexpectedly reverted later. This happens occasionally if a PR causes plans in multiple directories, but is almost _guaranteed_ to happen if the initial plan has to wait until a lock is freed up and a manual "atlantis plan" command is given. Instead of printing a warning when this happens, we now merge again if necessary while holding the lock. Plans are then guaranteed to only be made when merged with the base branch for each directory being planned, and applying later should be safe even if the base branch sees further updates. This fixes/affects #804, #867, #979 * Remove diverged test that no longer applies * Reinstate TestClone_MasterHasDiverged test and make it pass * Extend TestClone_MasterHasDiverged to test new merging functionality We now verify that the first Clone with CheckoutMerge=true with a diverged base branch atually clones and merges again. --------- Co-authored-by: PePe Amengual <[email protected]>
…n base update (#3187) * merge again if base branch has been updated The current "merge" checkout strategy is unsafe. It merges the PR and the base branch without holding the directory lock(s), so there is a potentially very long window where another PR can be applied and be unexpectedly reverted later. This happens occasionally if a PR causes plans in multiple directories, but is almost _guaranteed_ to happen if the initial plan has to wait until a lock is freed up and a manual "atlantis plan" command is given. Instead of printing a warning when this happens, we now merge again if necessary while holding the lock. Plans are then guaranteed to only be made when merged with the base branch for each directory being planned, and applying later should be safe even if the base branch sees further updates. This fixes/affects #804, #867, #979 * Remove diverged test that no longer applies * Reinstate TestClone_MasterHasDiverged test and make it pass * Extend TestClone_MasterHasDiverged to test new merging functionality We now verify that the first Clone with CheckoutMerge=true with a diverged base branch atually clones and merges again. --------- Co-authored-by: PePe Amengual <[email protected]>
…n base update (runatlantis#3187) * merge again if base branch has been updated The current "merge" checkout strategy is unsafe. It merges the PR and the base branch without holding the directory lock(s), so there is a potentially very long window where another PR can be applied and be unexpectedly reverted later. This happens occasionally if a PR causes plans in multiple directories, but is almost _guaranteed_ to happen if the initial plan has to wait until a lock is freed up and a manual "atlantis plan" command is given. Instead of printing a warning when this happens, we now merge again if necessary while holding the lock. Plans are then guaranteed to only be made when merged with the base branch for each directory being planned, and applying later should be safe even if the base branch sees further updates. This fixes/affects runatlantis#804, runatlantis#867, runatlantis#979 * Remove diverged test that no longer applies * Reinstate TestClone_MasterHasDiverged test and make it pass * Extend TestClone_MasterHasDiverged to test new merging functionality We now verify that the first Clone with CheckoutMerge=true with a diverged base branch atually clones and merges again. --------- Co-authored-by: PePe Amengual <[email protected]>
…n base update (runatlantis#3187) * merge again if base branch has been updated The current "merge" checkout strategy is unsafe. It merges the PR and the base branch without holding the directory lock(s), so there is a potentially very long window where another PR can be applied and be unexpectedly reverted later. This happens occasionally if a PR causes plans in multiple directories, but is almost _guaranteed_ to happen if the initial plan has to wait until a lock is freed up and a manual "atlantis plan" command is given. Instead of printing a warning when this happens, we now merge again if necessary while holding the lock. Plans are then guaranteed to only be made when merged with the base branch for each directory being planned, and applying later should be safe even if the base branch sees further updates. This fixes/affects runatlantis#804, runatlantis#867, runatlantis#979 * Remove diverged test that no longer applies * Reinstate TestClone_MasterHasDiverged test and make it pass * Extend TestClone_MasterHasDiverged to test new merging functionality We now verify that the first Clone with CheckoutMerge=true with a diverged base branch atually clones and merges again. --------- Co-authored-by: PePe Amengual <[email protected]>
Warn when using checkout-strategy=merge and the branch we're merging into has been updated after we've cloned it.
Takes commits from #815 and slightly refactors
Fixes #804