Skip to content

Make releaser tool update via a dir#570

Open
joaquimrocha wants to merge 2 commits intomainfrom
make-releaser-tool-update-via-a-dir
Open

Make releaser tool update via a dir#570
joaquimrocha wants to merge 2 commits intomainfrom
make-releaser-tool-update-via-a-dir

Conversation

@joaquimrocha
Copy link
Copy Markdown
Contributor

This PR changes the releaser to use version based releases. It also updates the existing file based releases.

How to test

cd tools/releaser && npm run build

1. Test migration from legacy flat layout

This verifies that a plugin with a top-level artifacthub-pkg.yml gets migrated to a version directory.

# Pick a plugin that still has the old layout (e.g. app-catalog)
# Ensure it has a tarball first:
plugin-releaser package app-catalog

# Run with --no-commit so we can inspect the result
plugin-releaser artifacthub app-catalog --no-commit

Verify:

  • app-catalog/<version>/artifacthub-pkg.yml exists with correct content
  • app-catalog/<version>/README.md was copied in
  • app-catalog/artifacthub-pkg.yml (top-level) was removed
  • Console printed "Removed legacy top-level artifacthub-pkg.yml"

Clean up: git checkout -- app-catalog/

2. Test creating a new template

# Use a plugin that has no artifacthub-pkg.yml at all
plugin-releaser artifacthub <plugin-without-artifacthub> --template --no-commit

Verify:

  • <plugin>/<version>/artifacthub-pkg.yml was created with TBD placeholders
  • <plugin>/<version>/README.md was copied in
  • No top-level artifacthub-pkg.yml was created

Clean up: rm -rf <plugin>/<version>/

3. Test updating an already-versioned plugin

This verifies it works correctly when the plugin already uses the new layout (like flux after our earlier commit).

# flux already has 0.5.0/ and 0.6.0/ directories
plugin-releaser artifacthub flux 0.6.0 --tarball flux/headlamp-k8s-flux-0.6.0.tar.gz --no-commit

Verify:

  • flux/0.6.0/artifacthub-pkg.yml was updated (checksum/URL match the tarball)
  • flux/0.6.0/README.md exists
  • No top-level flux/artifacthub-pkg.yml was created

Clean up: git checkout -- flux/0.6.0/

4. Test duplicate template is rejected

plugin-releaser artifacthub flux --template --no-commit

Verify: exits with error "artifacthub-pkg.yml already exists for flux v0.6.0"

Replace require('path') and require('fs') with proper ESM
imports. Fix --no-commit flag by using options.commit which
is how Commander parses negated boolean options.

Signed-off-by: Joaquim Rocha <me@joaquimrocha.com>
Each release now gets its own folder (<plugin>/<version>/)
with artifacthub-pkg.yml and README.md, matching the layout
required by ArtifactHub. Legacy top-level files are migrated
automatically.

Signed-off-by: Joaquim Rocha <me@joaquimrocha.com>
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