Derive package short name from the schema name#11244
Conversation
Registry Review —
|
|
Your site preview for commit 6cfe7f4 is ready! 🎉 http://registry--origin-pr-11244-6cfe7f4b.s3-website.us-west-2.amazonaws.com/registry. |
6cfe7f4 to
ff7d936
Compare
The nightly metadata workflow derived a provider's short name from the repo slug, so multiple packages published from one repo (for example DefangLabs/pulumi-defang publishing defang-aws, defang-gcp, and defang-azure) all collapsed to the same name. Their auto-update PRs then collided on a shared branch and title, and the open-PR check skipped siblings once any one PR was open. Read the short name from the schema's own name field, which is also the registry YAML filename, falling back to the repo name only when the schema name cannot be read. This matches every package currently in package-list.json, distinguishes sibling packages from one repo, and corrects runpod, whose repo-derived name (runpod-native) never matched its real name (runpod).
ff7d936 to
ef7e39c
Compare
|
Your site preview for commit ff7d936 is ready! 🎉 http://registry--origin-pr-11244-ff7d936b.s3-website.us-west-2.amazonaws.com/registry. |
|
Your site preview for commit ef7e39c is ready! 🎉 http://registry--origin-pr-11244-ef7e39c7.s3-website.us-west-2.amazonaws.com/registry. |
Spun out of the #11109 review (defang).
Problem
The nightly
generate-package-metadata.ymlderives a provider short name from the repo slug (pulumi-<name>). When one repo publishes multiple packages, they all collapse to the same name.DefangLabs/pulumi-defangshipsdefang-aws,defang-gcp, anddefang-azure, all resolving todefang, which causes:<short_name>/<run_id>-<run_number>) to be identical for all siblings, so they overwrite each other,Publish Package Metadata <short_name>@<version>) to be identical, andcontains(prs, short_name)) to skip siblings once any one PR is open.No repo currently publishes more than one package, so this has not surfaced in production yet.
Fix
Read the short name from the schema's own
namefield (which is also the registry YAML filename), falling back to the repo-slug regex only when the schema name cannot be read (non-JSON schema or fetch failure).This is the only reliable source: the schema directory is not one (
pulumi-resource-kafkaconnect-> namekafka-connect), and the repo slug is not one for multi-package repos.Scope of change (verified against the full list)
group2/provider_short_nameonly controls the nightly PR branch, title, and the open-PR skip check. It does not affect the published package name, which comes from the schemanameviametadata from-github(writes<name>.yaml) andpush-registry.py(publishes{source}/{publisher}/{name}). So no package is renamed or republished.name, i.e. its existing<name>.yaml. No mislabels.runpod: corrects a pre-existing mislabel (repo-derivedrunpod-nativenever matched the real namerunpod); the published name was and staysrunpod.defang-aws/defang-gcp/defang-azure: now get distinct PRs instead of colliding.Also includes the schema file in the matrix job name so sibling jobs are distinguishable in the Actions UI.
Validated with
actionlintand a livecurl + jqsimulation of the derivation across the tricky cases and a sample of normal packages.