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

Refactor: Use GHA native dispatch for registry metadata build kickoff #958

Merged
merged 2 commits into from
Jun 11, 2024

Conversation

guineveresaenger
Copy link
Contributor

@guineveresaenger guineveresaenger commented Jun 3, 2024

This pull request removes the dependency on pulumictl for the bridged provider registry docs dispatch.

Before this change

Currently, the Create Docs Build step in the Release Workflow calls into a Pulumictl command that triggers the Publish Provider Update Workflow, building metadata, in pulumi/registry.

publish.yml(provider) -> pulumictl(bespoke command) -> publish-provider-update(registry)

After this change

Use peter-evans/repository-dispatch@v3 to dispatch the resource-provider event that already exists on the registry publish-provider-update Workflow, removing the need for pulumictl.

The registry's Action has a few fields we do not use. See example run. Filed pulumi/registry#4671 to track. The repository dispatch payload therefore only contains:

"project": "${{ github.repository }}", - this is somewhat unnecessary but makes for a safe refactor without having to change the registry workflow file
"shortname": "#{{ .Config.provider }}#", - Just the provider name without `pulumi-` prefix
"ref": "${{ github.ref_name }}" - This is the tag name of the release.

Note: This pull request changes bridged providers only since we are currently working on unifying templating for native and bridged providers. I'm happy to add native provider changes to this effect if reviewers would prefer.

Copy link
Member

@iwahbe iwahbe 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 extremely safe to me. Let's make sure that we have a test run to show before we merge for the whole fleet.

@guineveresaenger
Copy link
Contributor Author

Needs better JSON formatting. Be back with those changes.

@guineveresaenger
Copy link
Contributor Author

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.

Nice simplification! There's a possibility our PRs might conflict as we're editing the same files ... but it's a different area edited so might be fine.

@guineveresaenger guineveresaenger merged commit 2e43e3e into master Jun 11, 2024
5 checks passed
@guineveresaenger guineveresaenger deleted the guin/refactor-docs-publish branch June 11, 2024 16:18
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