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

Decode declared modules for all kind of installed modules #1760

Merged
merged 5 commits into from
Jul 12, 2024

Conversation

dbanck
Copy link
Member

@dbanck dbanck commented Jul 11, 2024


This PR adds a missing piece from #1667: decoding declared module calls for locally installed modules (inside the .terraform/ directory)

We do this by normalizing the value of the source attribute and matching it against entries in the module manifest. If we find a matching entry, we decode the contents of the folder.

This not only re-enables it for registry modules, but also takes the approach a step further, allowing completion for (almost) any locally installed remote module (including submodules!).

UX After

CleanShot 2024-07-11 at 14 57 20

Introduce a new map based on the content of the module manifest. We can
use the map to look up local installation paths based on the module
source.
We now can look up their installation path based on the normalized
module source. We avoid decoding the whole `.terraform` directory by
only looking at modules that are used in the configuration.
@dbanck dbanck force-pushed the f-decode-installed-modules branch from cafaa8f to 3bcfe84 Compare July 11, 2024 13:29
@dbanck dbanck force-pushed the f-decode-installed-modules branch from 3bcfe84 to 27d6fd1 Compare July 12, 2024 10:04
@dbanck dbanck marked this pull request as ready for review July 12, 2024 10:04
@dbanck dbanck requested a review from a team as a code owner July 12, 2024 10:04
Copy link
Member

@ansgarm ansgarm left a comment

Choose a reason for hiding this comment

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

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants