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
feat(1259): sort projects based on dependencies #2146
feat(1259): sort projects based on dependencies #2146
Conversation
@juliusdanielherreraglomm if you can fix the conflicts and add an example of the problem is trying to solve that will be very helpful, thanks. |
db41ff9
to
0366ccc
Compare
@jamengual Sure thing, conflict is fixed. ExampleIf you have an atlantis.yaml like this: version: 3
projects:
- autoplan:
enabled: true
when_modified:
- '*.hcl'
- '*.tf*'
- ../4/terragrunt.hcl
dir: dependency-test/1
- autoplan:
enabled: true
when_modified:
- '*.hcl'
- '*.tf*'
- ../3/terragrunt.hcl
dir: dependency-test/2
- autoplan:
enabled: true
when_modified:
- '*.hcl'
- '*.tf*'
- ../1/terragrunt.hcl
dir: dependency-test/3
- autoplan:
enabled: true
when_modified:
- '*.hcl'
- '*.tf*'
dir: dependency-test/4 this patch will plan/apply the changes in this order:
(Copied from test) |
this is somewhat related #2055 maybe you guys need to talk |
0366ccc
to
dd4e629
Compare
This implements: runatlantis#1259 feat(1259): atlantis destroy order While creating the directed acyclic graph, it checks if the terragrunt.hcl file of the stacks contains our destroy flag: `# ATLANTIS_PLEASE_DESTROY_STACK` If this flag is found, the corresponding edge will be reverted, i.e. instead of u -> v, we will get v -> u. feat(1259): topological sort: fix and debugging * this will output the dependency graph in *.dot format * it will make the plan fail if the TopSort() fails for whatever reason * sorting is not necessary when there is just one project * dynamic folder/file generation * remove some unnecessary else branches * add a test for FindProjectNo() * and most important: fix FindProjectNo() so that the sorting is correct
dd4e629
to
3f9f4f1
Compare
Any word on this? It would solve a lot of problems for my team's use of this awesome tool. Thanks for all the work on it! |
continue | ||
} | ||
// Ignore .terragrunt-cache dirs (#487) | ||
if strings.Contains(file, ".terragrunt-cache/") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of ignoring this directory, can we list only the files, not directories, so we can do less filtering in lsOut
@juliusdanielherreraglomm we will like to merge this soon and create a prerelease do you think you can address the comments and add a doc with an example of how to use it? Thanks. |
Test is failing
|
@@ -60,6 +59,7 @@ require ( | |||
github.com/leodido/go-urn v1.2.1 // indirect | |||
github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29 // indirect | |||
github.com/sirupsen/logrus v1.9.0 // indirect | |||
github.com/yourbasic/graph v0.0.0-20210606180040-8ecfec1c2869 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a 5 year old dependency. Is there a way to avoid using this?
This issue is stale because it has been open for 1 month with no activity. Remove stale label or comment or this will be closed in 1 month. |
This implements:
#1259
feat(1259): atlantis destroy order
While creating the directed acyclic graph, it checks if the
terragrunt.hcl file of the stacks contains our destroy flag:
# ATLANTIS_PLEASE_DESTROY_STACK
If this flag is found, the corresponding edge will be reverted, i.e.
instead of u -> v, we will get v -> u.
feat(1259): topological sort: fix and debugging
New dependency