Skip to content

fix: align archive-url with tarball naming (PRI-356)#165

Open
privilegedescalation-engineer[bot] wants to merge 1 commit intomainfrom
fix/pri-356-archive-url-tarball-naming
Open

fix: align archive-url with tarball naming (PRI-356)#165
privilegedescalation-engineer[bot] wants to merge 1 commit intomainfrom
fix/pri-356-archive-url-tarball-naming

Conversation

@privilegedescalation-engineer
Copy link
Copy Markdown
Contributor

Summary

Fixes two related bugs in plugin-release.yaml that caused ArtifactHub archive-url to point to a non-existent release asset for 6 of 7 plugins.

Bug 1: Update artifacthub-pkg.yml — wrong PKG_NAME source

The Update artifacthub-pkg.yml step was deriving PKG_NAME from package.json using sed 's|^@||' | tr '/' '-', which produces privilegedescalation-headlamp-argocd-plugin for scoped packages. But headlamp-plugin names tarballs using the name field from artifacthub-pkg.yml, which is headlamp-argocd-plugin (no privilegedescalation- prefix). This mismatch made archive-url incorrect for 6 of 7 plugins.

Bug 2: Prepare release tarball — same PKG_NAME derivation bug

The same incorrect normalization was used in Prepare release tarball. While the tarball rename logic (for f in *.tar.gz; do [ "$f" != "$TARBALL" ] && mv "$f" "$TARBALL") would correct most mismatches after the fact, the root cause was still the wrong naming convention.

Fix

Both steps now use an artifacthub-pkg.yml-first approach: read name directly from artifacthub-pkg.yml if present, falling back to the corrected package.json normalization (sed 's|^@[^/]*/||' — strips @org/ prefix but does not replace / with -).

Plugin archive-url (before) archive-url (after) Actual tarball
headlamp-argocd-plugin @priv.../headlamp-argocd-plugin-{v}.tar.gz headlamp-argocd-{v}.tar.gz headlamp-argocd-{v}.tar.gz
headlamp-kube-vip-plugin kube-vip-{v}.tar.gz headlamp-kube-vip-{v}.tar.gz headlamp-kube-vip-{v}.tar.gz
headlamp-tns-csi-plugin tns-csi-{v}.tar.gz headlamp-tns-csi-plugin-{v}.tar.gz headlamp-tns-csi-plugin-{v}.tar.gz
headlamp-rook-plugin rook-{v}.tar.gz headlamp-rook-plugin-{v}.tar.gz headlamp-rook-plugin-{v}.tar.gz
headlamp-sealed-secrets-plugin sealed-secrets-{v}.tar.gz headlamp-sealed-secrets-{v}.tar.gz headlamp-sealed-secrets-{v}.tar.gz
headlamp-intel-gpu-plugin intel-gpu-{v}.tar.gz headlamp-intel-gpu-{v}.tar.gz headlamp-intel-gpu-{v}.tar.gz

Review chain

Regina (QA) → Patty (UAT) → Nancy (CTO) → CEO merge

Read package name from artifacthub-pkg.yml (artifacthub-pkg.yml-first)
to determine both the tarball name and the archive-url committed to
artifacthub-pkg.yml. Previously, both steps derived PKG_NAME from
package.json, which produces a different naming convention than
headlamp-plugin uses for actual tarballs (stripping @org/ prefix but
not replacing / with -), causing archive-url to point to a non-existent
asset for 6 of 7 plugins.

Fixes PRI-356.
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.

1 participant