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

Fix root path lookup in validate-all #1376

Merged
merged 2 commits into from Jan 16, 2024
Merged

Fix root path lookup in validate-all #1376

merged 2 commits into from Jan 16, 2024

Conversation

brikis98
Copy link
Member

@brikis98 brikis98 commented Nov 30, 2023

Description

Fixes #1374.

I've updated the runValidateOnAllTerraformModules function, which is used under the hood by ValidateAllTerraformModules and OPAEvalAllTerraformModules, to:

  1. Find the Git root using git.GetRepoRootForDirE, instead of a hard-coded ../../ file path.
  2. Copy the Git root to a temp folder once, rather than once per sub-test.

Note that I left the code in the test_structure package to keep things backward compatible. We can do that fix some other time.

TODOs

Read the Gruntwork contribution guidelines.

  • Update the docs.
  • Run the relevant tests successfully, including pre-commit checks.
  • Ensure any 3rd party code adheres with our license policy or delete this line if its not applicable.
  • Include release notes. If this PR is backward incompatible, include a migration guide.

Release Notes (draft)

Added / Removed / Updated [X].

Migration Guide

Copy link
Member

@denis256 denis256 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed tests seems unrelated

@brikis98
Copy link
Member Author

Thanks for the review! Merging.

@brikis98 brikis98 merged commit 74d9df0 into master Jan 16, 2024
2 of 3 checks passed
@brikis98 brikis98 deleted the bug/validate-all branch January 16, 2024 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ValidateAllTerraformModules has a number of issues
2 participants