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

autoplan triggering in directories without .tf files #1085

Closed
grimm26 opened this issue Jun 17, 2020 · 6 comments
Closed

autoplan triggering in directories without .tf files #1085

grimm26 opened this issue Jun 17, 2020 · 6 comments
Labels
question Further information is requested waiting-on-response Waiting for a response from the user

Comments

@grimm26
Copy link
Contributor

grimm26 commented Jun 17, 2020

The way that DetermineProjects works now is that it looks for modified files whose names contain .tf or is terragrunt.hcl. I use terragrunt.hcl, and at the top of my terraform repository is a terragrunt.hcl file and a common.tfvars file. There are no actual terraform config files, just subdirectories containing the terraform config files. So when I change the top level terragrunt.hcl file or the common.tfvars file, atlantis tries to run a plan and fails because there isn't actually any terraform config to plan.

#1075 has code to add an exception to ignore .tfline.hcl file changes and whatever else we care to add, but my problem depends on context. We need to ignore changes to terragrunt.hcl and files containing .tf if there are no .tf files in the directory. I assume that check should go about here when we get the project directories that the modified files belong to.

@grimm26
Copy link
Contributor Author

grimm26 commented Jun 17, 2020

or probably better to check in the first place at

func (g *GithubClient) GetModifiedFiles(repo models.Repo, pull models.PullRequest) ([]string, error) {

@lkysow
Copy link
Member

lkysow commented Jun 19, 2020

If you have an atlantis.yaml file you can specify each directory that should be tracked. You can then not set the root directory.

@lkysow lkysow added question Further information is requested waiting-on-response Waiting for a response from the user labels Jun 19, 2020
@grimm26
Copy link
Contributor Author

grimm26 commented Jun 19, 2020

Yes, but that doesn't make this not a bug.

@lkysow
Copy link
Member

lkysow commented Jun 24, 2020

Okay I re-read it now and I think I understand it better, you want the logic: if the file modified is terragrunt.hcl and the directory that terragrunt.hcl is in contains no .tf files then ignore?

@grimm26
Copy link
Contributor Author

grimm26 commented Nov 11, 2020

Okay I re-read it now and I think I understand it better, you want the logic: if the file modified is terragrunt.hcl and the directory that terragrunt.hcl is in contains no .tf files then ignore?

yes

@grimm26
Copy link
Contributor Author

grimm26 commented Aug 10, 2021

it went stale because it was ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested waiting-on-response Waiting for a response from the user
Projects
None yet
Development

No branches or pull requests

2 participants