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

Support external bridged provider by reducing Pulumi Corp targeted workflows #1084

Merged
merged 3 commits into from
Sep 27, 2024

Conversation

ringods
Copy link
Member

@ringods ringods commented Sep 27, 2024

This PR contains a set of changes to better support external bridged providers. Such external providers need less of the workflows used by the Pulumi Corp engineering team.

Single set of default configuration values.

The current setup uses a default config file based on the template name: bridged-provider template name maps to provider-ci/internal/pkg/templates/bridged-provider.config.json. The template name then points to a set of folders containing the actual template files:

case "bridged-provider":
// Render more specific templates last to allow them to override more general templates.
return []string{"provider", "dev-container", "bridged-provider"}, nil

These template files use templating based on the configuration options to tweak the generated content for each provider.

If we want to reuse most of these templates for another template name, we must prevent duplicating the config options in a second file. After discussing this with @danielrbradley, the idea was to not have a default config file per template name, but a single default config file applicable to all templates.

Default repository name calculation.

The CLI arguments to provider-ci generate has the following currently documented:

  -n, --name string       repository name to generate (default "{config.repository}" or otherwise "pulumi/pulumi-{config.provider}")

However, nowhere in the code is a default of "pulumi/pulumi-{config.provider}" calculated. One of the commits in this PR resolves this and improves on it to take the organization config option into account.

By calculating this value based on the provider and organization config values, we can run provider-ci generate now without the --name CLI argument. In make test-providers, it fixes that the acme provider is no longer assumed to be in the pulumi org, but correctly configured to be in the pulumiverse organization as specified by its .ci-mgmt.yml file.

Moved some specific into a Pulumi (Corp) folder

Some of the workflows & issue templates have been moved to a dedicated Pulumi folder. This folder is added to the default bridged-provider template, but not used for external-bridged-provider. This reduces the amount and complexity of the workflows for an external provider. An external provider doesn't have a bot running and doesn't require (for now) a few of the repository dispatch scenarios.

Copy link
Contributor

@guineveresaenger guineveresaenger left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

Copy link
Member

@danielrbradley danielrbradley left a comment

Choose a reason for hiding this comment

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

🚀

@ringods ringods added this pull request to the merge queue Sep 27, 2024
Merged via the queue into master with commit da77552 Sep 27, 2024
6 checks passed
@ringods ringods deleted the support-external-bridged-provider branch September 27, 2024 19:46
github-merge-queue bot pushed a commit that referenced this pull request Sep 27, 2024
Continuing on #1084, the name of the template must be populated
correctly into the `Makefile` of external bridged providers.

I moved `bridged-provider` as the default value into
`defaults.config.json` and updated the code generation accordingly.
github-merge-queue bot pushed a commit that referenced this pull request Oct 15, 2024
I moved `run-acceptance-tests.yml` in #1084 to the `pulumi-provider`
folder as I thought it was Pulumi Corp specific. I'm moving this back to
`bridged-provider` folder because it is also needed for third-party
provider packages. The workflow is updated to use the `GITHUB_TOKEN`
with elevated permissions for commenting on the PR.
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.

3 participants