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

Defined projects when_modified is not respected when --autoplan-modules is used #3897

Open
nitrocode opened this issue Oct 25, 2023 · 0 comments
Labels
bug Something isn't working Stale

Comments

@nitrocode
Copy link
Member

nitrocode commented Oct 25, 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

I have a few projects that depend on a module that should not auto plan unless a file is modified within them.

Reproduction Steps

version: 3
automerge: true
delete_source_branch_on_merge: true
parallel_plan: true
parallel_apply: true

projects:
- &default {
    name: dev,
    dir: global/dev,
    autoplan: {
      when_modified: ["*.tf", "../../modules/**/*.tf"],
      enabled: true
    }
  }

- &prod {
    name: prod
    dir: global/prod
    autoplan: {
      when_modified: ["*.tf", "CHANGELOG.md"],
      enabled: true
    }
  }

The files modified were

global/dev/main.tf
modules/zones/main.tf

In 0.26.0 with --autoplan-modules

Ran Plan for 2 projects:

1. project: `prod` dir: `global/prod` workspace: `default`
1. project: `dev` dir: `global/dev` workspace: `default`

In 0.26.0 without --autoplan-modules

Ran Plan for 1 project:

1. project: `dev` dir: `global/dev` workspace: `default`

The global/prod root dir should not have planned.

Logs

{"level":"debug","ts":"2023-10-25T14:25:28.828Z","caller":"events/project_finder.go:192","msg":"checking if project at dir \"global/dev\" workspace \"default\" was modified","json":{"repo":"<repo>","pull":"186"}}
{"level":"debug","ts":"2023-10-25T14:25:28.828Z","caller":"events/project_finder.go:192","msg":"checking if project at dir \"global/prod\" workspace \"default\" was modified","json":{"repo":"<repo>","pull":"186"}}
{"level":"info","ts":"2023-10-25T14:25:28.828Z","caller":"events/project_command_builder.go:435","msg":"2 projects are to be planned based on their when_modified config","json":{"repo":"<repo>","pull":"186"}}

Environment details

Additional Context

@nitrocode nitrocode added bug Something isn't working regression Bug introduced in a new version labels Oct 25, 2023
@nitrocode nitrocode changed the title v0.26.0: Projects auto planning when they should not Projects auto planning when they should not Oct 25, 2023
@nitrocode nitrocode removed the regression Bug introduced in a new version label Oct 25, 2023
@nitrocode nitrocode changed the title Projects auto planning when they should not Defined projects when_modified is not respected when --autoplan-modules is used Oct 25, 2023
@dosubot dosubot bot added the Stale label Sep 26, 2024
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

1 participant