runatlantis / atlantis

Terraform Pull Request Automation
https://www.runatlantis.io
Other
7.82k stars 1.06k forks source link

If repo_config_file is not found, plan should just skip #3339

Open nicarnold-toast opened 1 year ago

nicarnold-toast commented 1 year ago

Community Note


Overview of the Issue

When specifying a repo_config_file override, I would expect if the file does not exist, that the plan would just be skipped over. This does not happen. Atlantis attempts to plan the project despite there being no repo config. It seems to use the default config (atlantis.yaml)

Reproduction Steps

---
repos:
- id: /.*/
  repo_config_file: atlantis-nonproduction.yaml

Logs

Logs ``` found no atlantis-nonproduction.yaml file ``` looks like it originates from here: https://github.com/runatlantis/atlantis/blob/main/server/events/project_command_builder.go#L392

Environment details

Atlantis server-side config file:

---
repos:
- id: /.*/
  repo_config_file: atlantis-test.yaml

Repo atlantis.yaml file:

N/A

Additional Context

GenPage commented 1 year ago

Hello @nicarnold-toast, thanks for reaching out. That is correct, if no repoConfigFile is found Atlantis will try to autodetect Terraform modules that are modified in the PR.

https://github.com/runatlantis/atlantis/blob/f4fa3138d7a9dfdb494105597dce88366effff9e/server/events/project_command_builder.go#L390-L432

You are asking for a way to disable this behavior?

nicarnold-toast commented 1 year ago

Hey @GenPage . Thanks for getting back to me. I think your suggestion around disabling this might be the better option in this case (as it appears this is already an established pattern).

Would you like me to follow up with a PR in this case?

Many thanks, Nic

GenPage commented 1 year ago

Hello Nic, yes PRs are welcome

nitrocode commented 1 year ago

A pr for this has already been created and is awaiting review. Please comment and add feedback when time permits