Skip to content

fix(core): recognize packager- and publisher- plugin category prefixes#239

Open
mwaldheim wants to merge 1 commit into
mainfrom
fix/packager-publisher-category-prefixes
Open

fix(core): recognize packager- and publisher- plugin category prefixes#239
mwaldheim wants to merge 1 commit into
mainfrom
fix/packager-publisher-category-prefixes

Conversation

@mwaldheim

Copy link
Copy Markdown
Contributor

Problem

Plugin category-prefix handling in semrel core only recognized 6 of the 8 official plugin categories: provider-, condition-, analyzer-, generator-, updater-, hook-. The packager- and publisher- categories (added for packager-nfpm, publisher-oci, publisher-generic-http, etc.) were missing from three separate prefix lists:

  • internal/registry/metadata.go (FindPlugin fallback prefix stripping)
  • internal/cli/doctor.go (plugin recommendation de-duplication)
  • internal/cli/root.go (legacyPluginBinaryName prefix stripping)

This meant packager-*/publisher-* plugins could not be resolved by their short registry name (e.g. uses: packager-nfpm wouldn't match a registry entry named nfpm), and semrel doctor could double-suggest them.

test/integration/e2e_test.go already used the full, correct 8-category list, confirming the omission was an oversight rather than intentional scoping.

Fix

Add packager- and publisher- to all three prefix lists, matching the list already used in the integration test.

Testing

  • go build ./...
  • go vet ./...
  • go test ./internal/registry/... ./internal/cli/... (2 pre-existing unrelated failures confirmed via git stash on main: TestRunPluginRestore, TestMaybeAutoRestore_RunsRestoreWhenLockExists)

categoryPrefixes lists in internal/registry/metadata.go, internal/cli/doctor.go,
and internal/cli/root.go only stripped provider-/condition-/analyzer-/generator-/
updater-/hook- prefixes when resolving or suggesting plugins by short name. This
meant packager-* and publisher-* plugins (e.g. packager-nfpm, publisher-oci)
were never matched by their short registry name and were never suggested by
'semrel doctor', unlike every other plugin category.

Add packager- and publisher- to all three prefix lists, consistent with the
full 8-category set already used in test/integration/e2e_test.go.
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