Open SarahFrench opened 2 weeks ago
This could be implemented as a GitHub Action on the downstream repos:
This would mean PRs used to prepare CHANGELOGS on release branches would see if a given release was going to be impacted by a problem generating the correct user agent.
Alternatively, this could be implemented in Cloud Build in the magic-modules repo. This is possible because the MM repo controls the .goreleaser.yml file in the downstreams, so it can generate the provider repo in CI and it will have all the necessary files for running the goreleaser command described above.
What kind of contribution is this issue about?
Other (specify in details)
Details
Our release process uses ldflags to overwrite the variable
version.ProviderVersion
. In our codebase version.ProviderVersion is"dev"
but when we build and release a new provider version the value is replaced with"9.9.9"
, etc. This value is used to create the User-Agent header in the provider.ldflags in our release tooling - .goreleaser.yml:
Example User-Agent:
When we run acceptance tests the version.ProviderVersion value isn't overwritten, so the User-Agent will contain
terraform-provider-google/dev
.There was a period of time in the past where overwriting that value was not working (fixed here https://github.com/GoogleCloudPlatform/magic-modules/pull/6929) and that means some 4.X.X versions of the providers have user agents that are indistinguishable from acceptance tests.
We should add testing to assert that the release process is overwriting version.ProviderVersion as expected.
Here is some information from here that suggests a method of doing that:
References
No response