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

Apply picks up stale plans #1624

Closed
giuli007 opened this issue Jun 9, 2021 · 2 comments · Fixed by #1633 or #1704
Closed

Apply picks up stale plans #1624

giuli007 opened this issue Jun 9, 2021 · 2 comments · Fixed by #1633 or #1704

Comments

@giuli007
Copy link
Contributor

giuli007 commented Jun 9, 2021

In Atlantis plans are stored in pr-and-workspace-specific directories.

When using non-default workspaces plans for different projects of the same PR can be stored on a different copy of the repository on disk (if they use different workspaces from each other).
NB This is usually the case if the end user wants to enable parallel plan/applies (in fact it is common to generate a different atlantis workspace for each project in order to allow them to be run in parallel from the same PR, eg https://github.com/transcend-io/terragrunt-atlantis-config does that with the --create-workspace parameter).

If a PR that originally triggers n number of plans in Atlantis is subsequently updated it might happen that some of the plans are no longer relevant with regard to the latest changes.
However because they live in different directories Atlantis will only discard and update the plans for workspaces that are still affected by the latest changes, while plans for workspaces that are no longer affected by the changes in the PR will remain on disk.

This is a problem because when an atlantis apply is triggered it will pick up all the plans it can find for a specific PR and try to apply them, which can include things that were not meant to be applied by the end user (since the PR was updated to not include certain projects).

Here are a couple of screenshots to show the issue:

  • original change

giulioz-atlantis-test-code-pull-31-commits-b1f3842457ee1c49d9563ce6676b65cbc3c81e36-2021-06-09-14_29_58

- amended change

giulioz-atlantis-test-code-pull-31-files-2021-06-09-14_30_40

- atlantis interaction

giulioz-atlantis-test-code-pull-31-2021-06-09-14_31_16

This is quite a surprising behaviour and it can cause real issues as there is no clue for an end user looking at the PR to guess that the old stale plans will be applied.

@giuli007
Copy link
Contributor Author

I just found out that this is practically a duplicate of #1122.
both would be fixed by either #1633 or #1704 (alternative to each other)

@giuli007
Copy link
Contributor Author

I think this issue should still be open since #1704 was reverted
#1633 is the most recent up-to-date fix for it
cc @jamengual

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant