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

ValidateAllTerraformModules has a number of issues #1374

Closed
brikis98 opened this issue Nov 21, 2023 · 0 comments · Fixed by #1376
Closed

ValidateAllTerraformModules has a number of issues #1374

brikis98 opened this issue Nov 21, 2023 · 0 comments · Fixed by #1376
Labels
bug Something isn't working

Comments

@brikis98
Copy link
Member

  1. The ValidateAllTerraformModules function doesn't work on all repo structures. In particular, it calls runValidateOnAllTerraformModules under the hood, which tries to find the "git root" through a 100% hard-coded path of "go two folders up": filepath.Abs(filepath.Join(cwd, "../../")). This does not work for any Terraform code that isn't exactly two folders from the Git root! In fact, in a repo I tried this on, the code was just one folder down, and two folders up was a folder with ~100GB of code, so when this function then tried to copy all this to temp, it would hang. This code should use git.GetRepoRoot instead.
  2. (Minor) The ValidateAllTerraformModules method is in the test_structure package. Since this is a function for validating Terraform, it should be in the terraform package.
@brikis98 brikis98 added the bug Something isn't working label Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant