hashicorp / terraform-plugin-codegen-openapi

OpenAPI to Terraform Provider Code Generation Specification
Mozilla Public License 2.0
49 stars 9 forks source link

Add module version for remote github install #66

Closed austinvalle closed 11 months ago

austinvalle commented 11 months ago

Looks like the vcs.revision tag is only applied when installed from source.

Current behavior

# Git clone the repository
# When installing, notices the `.git` folder and stamps the binary with vcs.* tags
$ go install ./cmd/tfplugingen-openapi
$ tfplugingen-openapi --version

tfplugingen-openapi commit: 406d3056a335fcef04927bebeac15350e73a9f66

# Install from remote
$ go install github.com/hashicorp/terraform-plugin-codegen-openapi/cmd/tfplugingen-openapi@latest
$ tfplugingen-openapi --version

tfplugingen-openapi commit: local

Since most of our docs reference go install github.com/hashicorp/terraform-plugin-codegen-openapi/cmd/tfplugingen-openapi@latest, it might be helpful to also grab the main go module version if vcs info is not available.

After changes

# Git clone the repository/PR branch
$ go install ./cmd/tfplugingen-openapi
$ tfplugingen-openapi --version

tfplugingen-openapi commit: 6f7bc2c51ccd40fab1a8c56155247bf9688e3cd8

# Install from remote
$ go install github.com/hashicorp/terraform-plugin-codegen-openapi/cmd/tfplugingen-openapi@6f7bc2c51ccd40fab1a8c56155247bf9688e3cd8
$ tfplugingen-openapi --version

tfplugingen-openapi module: v0.0.0-20231004112425-6f7bc2c51ccd
github-actions[bot] commented 3 months ago

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 contributions. 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.