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

Parse provider versions from lock file before obtaining schema #1014

Merged
merged 3 commits into from
Aug 4, 2022

Conversation

radeksimko
Copy link
Member

@radeksimko radeksimko commented Jul 22, 2022

Depends on #1021 (DependsOn)

Closes #992


This introduces ParsePluginVersions which can parse provider/plugin versions as encoded by any version from Terraform v0.12. Attached tests probably best explain the differences between the versions.

Secondly the PR introduces ParseProviderVersions job, which leverages the mentioned function to parse the versions. This becomes the only way we obtain provider versions (previously it was terraform version -json as part of GetTerraformVersion job).

Lastly I raised #1025 to further explain and eventually address the problem with path separators. With testing/fstest (or at least for the ReadDir implementation there) we have to use both OS-specific separator, but still use / to separate the "listable" files from dirs in a dir which we'll call ReadDir() on, otherwise \ are treated as any other character, basically making them part of the opaque file/dir name.

@radeksimko radeksimko added the enhancement New feature or request label Jul 22, 2022
@radeksimko radeksimko self-assigned this Jul 22, 2022
@radeksimko radeksimko force-pushed the f-read-plugin-versions branch 15 times, most recently from 677e53f to e4b5c6d Compare July 29, 2022 13:16
@radeksimko radeksimko added this to the v0.29.0 milestone Aug 1, 2022
@radeksimko radeksimko force-pushed the f-read-plugin-versions branch 11 times, most recently from 548f034 to b16cf2e Compare August 2, 2022 16:31
@radeksimko radeksimko force-pushed the f-read-plugin-versions branch 3 times, most recently from 6315c69 to 34c82db Compare August 2, 2022 17:37
@radeksimko radeksimko marked this pull request as ready for review August 2, 2022 17:50
@radeksimko radeksimko requested a review from a team as a code owner August 2, 2022 17:50
@radeksimko radeksimko force-pushed the f-read-plugin-versions branch 2 times, most recently from 5f4a722 to a1bacdb Compare August 4, 2022 07:40
Copy link
Member

@dbanck dbanck left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Just two minor questions

internal/indexer/walker.go Outdated Show resolved Hide resolved
internal/state/module.go Show resolved Hide resolved
@radeksimko radeksimko requested a review from dbanck August 4, 2022 12:32
Copy link
Member

@dbanck dbanck left a comment

Choose a reason for hiding this comment

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

👍 Good catch with the copying

@github-actions
Copy link

github-actions bot commented Sep 4, 2022

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 Sep 4, 2022
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.

terraform/module: Introduce new job to parse provider versions from lock file
2 participants