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

[Possible regresion] Autoplan ignores when_modified in a per-repo config #3796

Open
szaffarano opened this issue Sep 27, 2023 · 2 comments
Open
Labels
bug Something isn't working Stale

Comments

@szaffarano
Copy link

szaffarano commented Sep 27, 2023

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.

Overview of the Issue

We were able to reproduce this issue running v0.24.3, v0.24.4 and v0.25.0.

We have a project structure similar to

test
├── atlantis.yaml
└── infra
    ├── modules
    │   └── module-one
    ├── project-one
    └── project-two

and our atlantis.yaml file looks like

version: 3
projects:
  - &template
    name: template
    dir: template
    workflow: default
    autoplan:
      enabled: true
      when_modified:
        - "**/*.tf"
        - ".terraform.lock.hcl"

  - <<: *template
    name: infra/project-one
    dir: ./infra/project-one
    workflow: project-one

  - <<: *template
    name: infra/project-two
    dir: ./infra/project-two
    workflow: project-two

Atlantis is running with the following environment variables

ATLANTIS_AUTOPLAN_MODULES=true
ATLANTIS_AUTOPLAN_FILE_LIST=**/*.tf

Everything works as expected, i.e.,

  1. We change project-one/main.tf and atlantis runs the plan just for project-one.
  2. If we update modules/module-one/some-file.tf and module-one is used only for project-two, then Atlantis runs the plan only for project-two.
  3. But if we change, for example, project-one/README.md Atlantis also runs the plan for project-one although the updated file doesn't match with ATLANTIS_AUTOPLAN_FILE_LIST.

If we downgrade to v0.23.3, the previous version after this fix, then use case 3) works (i.e., Atlantis doesn't run anything wen we change files not matching ATLANTIS_AUTOPLAN_FILE_LIST), but Autoplan Modules (use case 2) stops working. So, I'd say it's a regression introduced by the linked PR.

Reproduction Steps

Just follow the two use cases I listed above.

Logs

Environment details

Additional Context

@szaffarano szaffarano added the bug Something isn't working label Sep 27, 2023
@jamengual
Copy link
Contributor

@jukie do you think this could be a bug?

@dosubot dosubot bot added the Stale label Sep 27, 2024
@nipr-jdoenges
Copy link

Possible relation to #3368

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

3 participants