Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

edgarsandi
Copy link
Contributor

@edgarsandi edgarsandi commented Mar 25, 2021

Add / separate the module version from module source when using ?ref=

With this pull request, we split the version from source when selecting a revision (ref argument) and put it in the Version column

xref: #427

Before

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_baz"></a> [baz](#module\_baz) | foo | 1.2.3 |
| <a name="module_consul"></a> [consul](#module\_consul) | gcs::https://www.googleapis.com/storage/v1/modules/foomodule.zip |  |
| <a name="module_dns"></a> [dns](#module\_dns) | app.terraform.io/24g/route53record/aws | 2.0.0 |
| <a name="module_foo"></a> [foo](#module\_foo) | bar | 1.2.3 |
| <a name="module_project_bar"></a> [project\_bar](#module\_project\_bar) | [email protected]:my-org/terraform-google-project |  |
| <a name="module_project_baz"></a> [project\_baz](#module\_project\_baz) | [email protected]:my-org/terraform-google-project?ref=v2.1.2 |  |
| <a name="module_project_foo"></a> [project\_foo](#module\_project\_foo) | my-org/terraform-google-project | v2.1.2 |
| <a name="module_storage"></a> [storage](#module\_storage) | git::[email protected]:storage.git |  |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | https://example.com/vpc-module?archive=zip |  |
| <a name="module_vpc_hg"></a> [vpc\_hg](#module\_vpc\_hg) | hg::http://example.com/vpc.hg |  |
| <a name="module_vpc_hg_with_ref"></a> [vpc\_hg\_with\_ref](#module\_vpc\_hg\_with\_ref) | hg::http://example.com/vpc.hg?ref=v1.2.0 |  |
| <a name="module_vpc_with_file"></a> [vpc\_with\_file](#module\_vpc\_with\_file) | https://example.com/vpc-module.zip |  |

With this PR

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_baz"></a> [baz](#module\_baz) | foo | 1.2.3 |
| <a name="module_consul"></a> [consul](#module\_consul) | gcs::https://www.googleapis.com/storage/v1/modules/foomodule.zip | n/a |
| <a name="module_dns"></a> [dns](#module\_dns) | app.terraform.io/24g/route53record/aws | 2.0.0 |
| <a name="module_foo"></a> [foo](#module\_foo) | bar | 1.2.3 |
| <a name="module_project_bar"></a> [project\_bar](#module\_project\_bar) | [email protected]:my-org/terraform-google-project | n/a |
| <a name="module_project_baz"></a> [project\_baz](#module\_project\_baz) | [email protected]:my-org/terraform-google-project | v2.1.2 |
| <a name="module_project_foo"></a> [project\_foo](#module\_project\_foo) | my-org/terraform-google-project | v2.1.2 |
| <a name="module_storage"></a> [storage](#module\_storage) | git::[email protected]:storage.git | n/a |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | https://example.com/vpc-module?archive=zip | n/a |
| <a name="module_vpc_hg"></a> [vpc\_hg](#module\_vpc\_hg) | hg::http://example.com/vpc.hg | n/a |
| <a name="module_vpc_hg_with_ref"></a> [vpc\_hg\_with\_ref](#module\_vpc\_hg\_with\_ref) | hg::http://example.com/vpc.hg | v1.2.0 |
| <a name="module_vpc_with_file"></a> [vpc\_with\_file](#module\_vpc\_with\_file) | https://example.com/vpc-module.zip | n/a |

I have:

@khos2ow

@khos2ow khos2ow linked an issue Mar 25, 2021 that may be closed by this pull request
@edgarsandi edgarsandi force-pushed the better-view-to-source-version branch 2 times, most recently from 8667029 to e5a5a37 Compare March 28, 2021 03:01
@edgarsandi edgarsandi marked this pull request as ready for review March 28, 2021 03:07
@edgarsandi edgarsandi force-pushed the better-view-to-source-version branch from e5a5a37 to 62d4a34 Compare March 29, 2021 23:33
@edgarsandi
Copy link
Contributor Author

Hello @khos2ow!

I think that I've missed something here

Is this PR ok?

@khos2ow
Copy link
Member

khos2ow commented Apr 29, 2021

Oh shoot! I've completely missed this one! I'll check it soon.

Copy link
Member

@khos2ow khos2ow left a comment

Choose a reason for hiding this comment

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

Thank you @edgarsandi, overall this looks ok, but please check my comment below. That was one of the main concerns and potentially might be a bit tricky to implement. Please feel free to discuss your thoughts and ideas.

@@ -60,6 +60,7 @@ followed by another line of text.
| bar | baz | 4.5.6 |
| foo | bar | 1.2.3 |
| baz | baz | 4.5.6 |
| foobar | [email protected]:module/path | v7.8.9 |
Copy link
Member

Choose a reason for hiding this comment

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

One of the main problem mentioned at #427 (comment), is that this will become a "clickable email" address. The following for makrdown and asciidoc is preferred:

Suggested change
| foobar | [email protected]:module/path | v7.8.9 |
| foobar | [[email protected]:module/path](https://github.com/module/path) | v7.8.9 |

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi! yes, it's a bit hard to implement, but I'll try! tks!

@khos2ow
Copy link
Member

khos2ow commented May 5, 2021

Following up I think we need to have a clickable hyperlink for module sources when:

  • Terraform Registry
  • GitHub
  • BitBucket
  • Generic Git, Mercurial repositories

The rest can be shown as is. Take a look at Module Sources for complete list of available sources.

@khos2ow
Copy link
Member

khos2ow commented May 18, 2021

@edgarsandi I think we can ignore the hyperlink of modules for now and we can circle back to it on a separate PR. If you don't mind please rebase on master and fix the conflict and we can get this merged.

@edgarsandi
Copy link
Contributor Author

Hi @khos2ow I totally agree, seems other (and more complex) problem, I'll do the rebase and fix de conflicts

@edgarsandi edgarsandi force-pushed the better-view-to-source-version branch from 62d4a34 to 0284283 Compare May 18, 2021 23:52
@khos2ow khos2ow merged commit 2cb5fdb into terraform-docs:master May 19, 2021
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.

Support for populating cleaner version info from GitHub hosted modules
2 participants