-
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
fix: Delete locks and workdirs with potentially stale previous plans which fixes 1624 #1704
Merged
jamengual
merged 2 commits into
runatlantis:master
from
Yelp:delete_locks_and_workdirs_with_potentially_stale_previous_plans_which_fixes_1624
Jun 11, 2022
Merged
Conversation
This file contains 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
When using non-default workspaces, plans are stored in pr-and-workspace-specific directories. If a PR is subsequently updated it might happen that some of the plans are no longer relevant with regards to the latest changes. This change ensures that plans are always deleted when a generic plan is triggered either by autoplan or by a "atlantis plan" command. NB Plans are not cleaned up when specific projects are planned explicitly with "atlantis plan -p/-d/-w".
2a93ee0
to
d01db03
Compare
containing previous plans
d01db03
to
011fb1a
Compare
Any progress on this? we are facing the same issue. |
Is there anything I can do to help get eyes on this or anything? We're continuing to see this edge case occasionally, and it causes confusion for our devs and unintentional deploys. |
@srlightbody @giuli007 if any of you can contribute and continue the work, we can review it |
Hi, any progress? |
krrrr38
pushed a commit
to krrrr38/atlantis
that referenced
this pull request
Dec 16, 2022
…which fixes 1624 (runatlantis#1704) * Delete previous plans on autoplan or atlantis plan When using non-default workspaces, plans are stored in pr-and-workspace-specific directories. If a PR is subsequently updated it might happen that some of the plans are no longer relevant with regards to the latest changes. This change ensures that plans are always deleted when a generic plan is triggered either by autoplan or by a "atlantis plan" command. NB Plans are not cleaned up when specific projects are planned explicitly with "atlantis plan -p/-d/-w". * Use DeleteLockCommand to delete locks and workdirs containing previous plans Co-authored-by: giuli007 <[email protected]>
krrrr38
pushed a commit
to krrrr38/atlantis
that referenced
this pull request
Dec 16, 2022
…s plans which fixes 1624 (runatlantis#1704)" (runatlantis#2316) This reverts commit 82ac706.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
This PR is an alternative to #1633 and aims to fix #1624
It solves the same problem but instead of deleting plans and locks directly it uses the
DeleteLocksByPull
method.As a consequence every time an autoplan or generic
atlantis plan
command is issued it completely removes the working dir (which might be more than one for a single PR if non-default workspaces are used).The change in this PR might be better because it reuses an existing method for cleaning up lock and plan but it might in some cases delete working directories that atlantis could have otherwise reused.
Especially when using non-default workspaces atlantis creates a copy of the repository for every project in a PR. With this PR a
atlantis plan
will cause atlantis to delete them all to re-clone them even if there was no code change.In those cases performance might be affected negatively. This is why this change has been opened as alternative, I prefer the original solution in #1633