walker: Index uninitialized modules #997
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #724
Depends on hashicorp/terraform-schema#126The PR changes the walker such that it indexes any directory it finds with >0
*.tf
files in it. This has a few side effects I had to account for:Defer
to provide that guarantee..terraform
dir without other files would trigger indexing, but the new behaviour is more correct in not indexing such a directory. The reason we start with empty directory with just.terraform
is because it means we can more easily provide the actual test configuration as part of the test viadidOpen
and we don't have to deal with copying/creating test configs in FS.empty.tf
initialize
, but that would also mean we have to find a different way of loading the schema, e.g. by inserting it into memdb as part of each test.Indexing Before
Indexing After
I filed a few follow-up issues to deal with the potential performance hit resulting from indexing more modules:
required_version
constraint #993