-
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
Autoplanning - auto-detect modules dependencies #920
Comments
Yeah that would be awesome. We're already using terraform-config-inspect to determine the terraform version: https://github.com/runatlantis/atlantis/blob/master/server/events/project_command_builder.go#L433. Extending it to detect module changes would be great. I'd need to think about how best to enable this functionality. Maybe we'd support another key under |
Hi, we have this issue with our teams, either we add a dependency to a module that we later don't need anymore but forgot to remove it from The only issue I see with it is that it would need to parse all Terraform files on every pull request but this should be short enough. @yannh do you have a working patch for this? If not, I could try to add it, my plan is to recursively look for modules with a local path. If it works fast enough, I think we should enable this feature by default, everybody must have this issue. |
Hi @remilapeyre , not yet. I can see it working when you have a configuration file specifying the list of projects to watch (so, patching DetermineProjectsViaConfig ).. I would probably work on this in the coming weeks but I can't commit to a timeline, so feel free to work on it! |
Reviving this ticket... Seems like terraform-diff does exactly what is needed: output list of changed projects, but integrating it is still TODO? Anyone have a proof of concept or WIP? I'd be interested in getting it over the finish line. |
you can run any tool in a custom workflow so this could be added without issues, bit not need to be embedded in atlantis code I think |
@jamengual I would expect a workflow per directory output by the diff. e.g., if a module affects 5 projects, that's 5 different plans and applys. |
* feat: auto-plan projects when modules change Fixes #920 * rename Downstream->Dependent; docs cleanup * chore: gofmt -s
* feat: auto-plan projects when modules change Fixes runatlantis#920 * rename Downstream->Dependent; docs cleanup * chore: gofmt -s
Hello! In the autoplanning documentation, when configuring planning, you need to specify a when_modified array of folders to watch for each project.
This can be quite cumbersome to maintain, especially when you have modules that depend on other modules that depend on other modules.... I just released https://github.com/contentful-labs/terraform-diff, which uses https://github.com/hashicorp/terraform-config-inspect/ to try to detect the dependency tree automatically. Do you think this behaviour would work with Atlantis' autoplanning feature? It might be a bit of work but would you accept a PR going into that direction? Thanks!
The text was updated successfully, but these errors were encountered: