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

terraform: Use real version in UA header #2229

Merged
merged 2 commits into from
Aug 29, 2019

Conversation

radeksimko
Copy link
Contributor

@radeksimko radeksimko commented Aug 22, 2019

The existing implementation leverages Terraform's version package as Terraform currently provides the SDK for interacting with core and is therefore imported by the provider, including the version package.

The side effect of this is that provider reports version of vendored Terraform (i.e. plugin SDK), not the version which actually talks to the provider's gRPC server and parses the configuration.

This PR is leveraging recent changes introduced in 0.12 to fix that and report accurate version.


This also changes the header from the following

Terraform/X.Y.Z (+https://www.terraform.io)

to

HashiCorp Terraform/X.Y.Z (+https://www.terraform.io)

to align UA string with hashicorp/terraform#22272


This also requires bumping github.com/hashicorp/terraform to the latest revision from master - I'm not sure how to do that in the context of this project though.

Release Note for Downstream PRs (will be copied)


@modular-magician
Copy link
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review. They will authorize it to run through our CI pipeline, which will generate downstream PRs.

Thanks for your contribution! A human will be with you soon.

@tysen, please review this PR or find an appropriate assignee.

@radeksimko radeksimko marked this pull request as ready for review August 22, 2019 08:13
@abombss
Copy link

abombss commented Aug 22, 2019

Will this change force people to use TF 0.12 or will it be backward compatible with 0.11? What is the strategy for the Google Terraform provider to maintain backward compatibility and are their any tests to verify that?

@radeksimko
Copy link
Contributor Author

radeksimko commented Aug 22, 2019

Generally speaking we don't have extensive testing CI in place for this specific scenario, but the protocol changes are additive and we intend to keep it backwards compatible (certainly protocol-wise) until we start versioning the plugin SDK separately - which will be communicated appropriately and this is the first step towards that direction.

The future extracted plugin SDK (not published yet) will not offer version package anymore (which httpclient.UserAgentString() basically exposes, so that will go away too), so if providers want to get the Terraform version in the future, getting it through the protocol will be the only way.
At that point (on go module level) we will be versioning that standalone SDK which providers depend on and that will define the compatibility layer per plugin protocol and the protocol versioning along with plugin SDK versioning will communicate breaking changes through semver.

This specific change will not force people to use any particular Terraform version - it will just report accurate version (sent by Terraform binary over gRPC to the provider binary) if people use 0.12+, rather than reporting 0.12 "statically" for latest version of the provider, just because the provider vendors Terraform 0.12 at it depends on Terraform plugin SDK which is part of the same repo now.

Copy link
Contributor

@paddycarver paddycarver left a comment

Choose a reason for hiding this comment

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

This looks reasonable enough to me.

@paddycarver
Copy link
Contributor

I think when the downstreams are merged we can go ahead and generate the PRs from this and get them merged.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician, I work on Magic Modules.
This PR seems not to have generated downstream PRs before, as of 1fd42c2.

Pull request statuses

No diff detected in Inspec.

New Pull Requests

I built this PR into one or more new PRs on other repositories, and when those are closed, this PR will also be merged and closed.
depends: hashicorp/terraform-provider-google-beta#1107
depends: GoogleCloudPlatform/terraform-google-conversion#186
depends: hashicorp/terraform-provider-google#4374
depends: modular-magician/ansible#379

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician, I work on Magic Modules.
I see that this PR has already had some downstream PRs generated. Any open downstreams are already updated to your most recent commit, 1fd42c2.

Pull request statuses

terraform-provider-google-beta already has an open PR.
terraform-google-conversion already has an open PR.
terraform-provider-google already has an open PR.
No diff detected in Ansible.
No diff detected in Inspec.

New Pull Requests

I didn't open any new pull requests because of this PR.

radeksimko and others added 2 commits August 29, 2019 21:45
Tracked submodules are build/terraform-beta build/terraform-mapper build/terraform build/ansible build/inspec.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants