-
Notifications
You must be signed in to change notification settings - Fork 6
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
example: simplify major version updates #165
Conversation
Does the PR have any schema changes?Looking good! No breaking changes found. |
ac2b17e
to
a48c149
Compare
Does the PR have any schema changes?Looking good! No breaking changes found. |
This change to ProgramTest allows Go module replacements to omit the major version number, simplifying the process to release a provider with a new major version. When the major version is incremented in a PR, the examples fail to compile if they reference the incorrect SDK version. This enables the examples to be written to target a versionless `/sdk`, and have a Dependencies line such as: ```go integration.ProgramTestOptions{ Dependencies: []string{ "github.com/pulumi/pulumi-keycloak/sdk=../sdk", }, } ``` This versionless import mapping means that examples run regardless of the major version of the provider, and updates to major versions in PRs will require only one PR. A provider PR proving out the implementation was created against this commit here: - pulumi/pulumi-keycloak#165
This commit is an example of a change to be rolled out with ci-mgmt. Providers are free to modify their major version without requiring many code changes beyond changing the code in `./provider`: 1. disabling examples tests (can be done with PR changing provider code) 2. ci-mgmt change to bump the major version 3. ci-mgmt PR against repo updating major version in CI files 4. re-enabling examples To accomplish this, files managed via ci-mgmt no longer require using the major version number of the provider in any scripts. This major version appears in: * Makefile: no longer required as go commands now use paths to build and modifying ldflags version argument * goreleaser: no longer required by modifying version ldflags argument * GitHub Actions: no longer required as an environment variable A change to pulumi/pkg ProgramTest is needed to modify `Dependencies` to remove the need to disable and re-enable examples: - pulumi/pulumi#12004
a48c149
to
f49e9cc
Compare
Does the PR have any schema changes?Looking good! No breaking changes found. |
12004: feat: enable simpler Go programtest replacements r=AaronFriel a=AaronFriel This change to ProgramTest allows Go module replacements to omit the major version number, simplifying the process to release a provider with a new major version. When the major version is incremented in a PR, the examples fail to compile if they reference the incorrect SDK version. This enables the examples to be written to target a versionless `/sdk`, and have a Dependencies line such as: ```go integration.ProgramTestOptions{ Dependencies: []string{ "github.com/pulumi/pulumi-keycloak/sdk=../sdk", }, } ``` This versionless import mapping means that examples run regardless of the major version of the provider, and updates to major versions in PRs will require only one PR. A provider PR proving out the implementation was created against this commit here: - pulumi/pulumi-keycloak#165 Co-authored-by: Aaron Friel <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So basically, we would have a versionless version package? 😂
I love seeing this example, but have we tried this out somewhere?
@guineveresaenger this PR is the trial run: provider build, schema and SDK generation, examples are all green. And to validate that the version is getting in there, tfgen panics if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a good prototype. I wasn't sure we could just remove the version prefixes where we describe the module, such as specifying linker flags. Given that tests go green, I'm comfortable merging.
I'll wait on master to go green before rolling out the change to other providers, since that invokes the goreleaser in it's publish step.
@iwahbe this commit introduces a go.mod file at provider/pkg/version, making it a separate module fixed at v0 enables the ldflags change. |
* [internal] Update GitHub Actions workflow files * Revert "example: simplify major version updates (#165)" This reverts commit 3aa45bb. * Remove VERSION_PREFIX --------- Co-authored-by: Pulumi Bot <[email protected]>
This commit is an example of a change to be rolled out with ci-mgmt.
Providers are free to modify their major version without requiring many code changes beyond changing the code in
./provider
:To accomplish this, files managed via ci-mgmt no longer require using the major version number of the provider in any scripts. This major version appears in:
A change to pulumi/pkg ProgramTest is needed to modify
Dependencies
to remove the need to disable and re-enable examples: