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

Add DocsLink for remote module source attributes #103

Merged
merged 4 commits into from
Apr 25, 2022

Conversation

dbanck
Copy link
Member

@dbanck dbanck commented Apr 12, 2022

Required for hashicorp/vscode-terraform#673

Depends on

This PR adds a DocsLink to the depended module schema if the module is a registry (e.g. registry.terraform.io) one.

I added a Version field to ModuleCall, required for building the docs link. To populate this field a change in terraform-ls is required (hashicorp/terraform-ls#874).

type ModuleCall struct {
LocalName string
SourceAddr string
Version string
Path string
}

@dbanck dbanck added the enhancement New feature or request label Apr 12, 2022
@dbanck dbanck self-assigned this Apr 12, 2022
@dbanck dbanck force-pushed the f-docslink-for-module-source branch 2 times, most recently from 982c114 to f3db2dd Compare April 13, 2022 14:36
@dbanck dbanck marked this pull request as ready for review April 13, 2022 15:00
@dbanck dbanck requested a review from a team April 13, 2022 15:00
schema/module_schema.go Outdated Show resolved Hide resolved
@dbanck dbanck force-pushed the f-docslink-for-module-source branch from af1666c to 78d165d Compare April 22, 2022 09:38
@dbanck dbanck force-pushed the f-docslink-for-module-source branch from 78d165d to afaf506 Compare April 22, 2022 09:47
@dbanck dbanck requested a review from radeksimko April 22, 2022 09:49
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

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

Just one remaining question, otherwise LGTM.

schema/module_schema.go Outdated Show resolved Hide resolved
@dbanck dbanck requested a review from radeksimko April 25, 2022 12:28
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

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

:shipit:

@@ -382,6 +382,34 @@ func TestSchemaForDependentModuleBlock_DocsLink(t *testing.T) {
},
},
},
{
"remote module on unknown registry",
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the extra test! 👍🏻

@dbanck dbanck merged commit cda6252 into main Apr 25, 2022
@dbanck dbanck deleted the f-docslink-for-module-source branch April 25, 2022 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants