You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
(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.
The text was updated successfully, but these errors were encountered:
ValidateAllTerraformModules
function doesn't work on all repo structures. In particular, it callsrunValidateOnAllTerraformModules
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 usegit.GetRepoRoot
instead.ValidateAllTerraformModules
method is in thetest_structure
package. Since this is a function for validating Terraform, it should be in theterraform
package.The text was updated successfully, but these errors were encountered: