-
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
feat: add flag to allow enable/disable project autodiscovery #3279
Conversation
@mtavaresmedeiros please fill out the pr template. This also helps summarize the changes for pr reviewers |
Done |
@mtavaresmedeiros apologies for the long review... Do you mind resolving the conflicts when you get a chance? |
In issue #3339, an additional global configuration (in the Atlantis server repos.yaml) would be nice to enable/disable auto discovery. This way the repo owner can create the Atlantis configuration file and override the setting if desired. So if the repo configuration atlantis.yaml file did not exist or did not override the setting, Atlantis would no longer run plans on auto discovered projects in that repo. What do you think about adding that within this PR? |
@nitrocode Sure, I will work on it 👍. |
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. |
@nitrocode , Hello man, do you think that we can merge it, and I work on the global config a little bit later? I am trying to find a time to work on it but it is a little complicated. |
@mtavaresmedeiros do you think you have time to finish 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. |
@mtavaresmedeiros I'd love to see this feature merged. A scenario I have run into is that pull-request into a branch that Atlantis is not configured to run against is considered as having zero projects so auto-discovery runs. |
Hello guys, Sorry, I am trying to find a time to finish it, I will try this week. |
I approved the tests, should hopefully help |
I think that we are done guys, sorry the delay, can you have a look on it? |
c729c2f
to
1b9ca74
Compare
Is there any update on this topic? |
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.
Please add documentation for the repo and global configuration
I kicked off the tests again. Can you check these remaining items?
Thanks @mtavaresmedeiros for all your efforts. It's pretty close. |
Also relevant comment #3895 Might be good for the authors to work together on this implementation. |
90ead7e
to
3f640a7
Compare
Hi, About topic 3, follow de default behavior, it will check only the projects that are in the "atlantis.yaml" or do the discover if not have projects. And not sure what is the benefit of it, if you want the discovery in the repository, just do not specify the projects... |
@mtavaresmedeiros Thank you for the PR. Can you confirm if #3895 delivers the same feature as yours, including global auto-discover? There are many conflicts in the PR now, and I believe this PR is no longer needed due to 3895 being merged. |
yesss. it is fine, thx. |
what
autodiscovery
.why
After this change: feat: support atlantis.yaml without defined projects #2300, if we not specify a project in
atlantis.yaml
, the Atlantis will do an automatic discovery in the entire environment and try to do the plan/apply inmodified files
.In cases where we use
multiples Atlantis servers
in the same repository, it can be a problem because the Atlantis server from one environment can try to do a discovery and get projects from another environment.example of a dir structure:
.
|── prod
│ └── project1
│ └── main.tf
|── stage
|── test
└── project1
└── main.tf
We are using the
terragrunt-atlantis-config
to create theatlantis.yaml
in the pre_workflow_hooks. when theterragrunt-atlantis-config
run in a directory that doesn't have any project(like the "stage" dir in the example above) or in a directory that does not exist(I know that it looks strange, but try to think about one scenario in which you have multiples Atlantis servers, then when you will create a new repository, for sure that you will start with the test environment, but you would like to configure it (webhooks) to support when the users create the manifest to another environment, I mean you wouldn't like to add the webhooks only when the guy create the new stage, right?), it will create aatlantis.yaml
without any project, it means that it will trigger the automatic discovery and will try to do the plan/apply for any project that was modified in the pull request.tests
references
Extra
Obs: about the terragrunt-atlantis-config, I create a forked and updated it to support this new flag( if approved).