fix(core): recognize packager- and publisher- plugin category prefixes#239
Open
mwaldheim wants to merge 1 commit into
Open
fix(core): recognize packager- and publisher- plugin category prefixes#239mwaldheim wants to merge 1 commit into
mwaldheim wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Plugin category-prefix handling in
semrelcore only recognized 6 of the 8 official plugin categories:provider-,condition-,analyzer-,generator-,updater-,hook-. Thepackager-andpublisher-categories (added forpackager-nfpm,publisher-oci,publisher-generic-http, etc.) were missing from three separate prefix lists:internal/registry/metadata.go(FindPluginfallback prefix stripping)internal/cli/doctor.go(plugin recommendation de-duplication)internal/cli/root.go(legacyPluginBinaryNameprefix stripping)This meant
packager-*/publisher-*plugins could not be resolved by their short registry name (e.g.uses: packager-nfpmwouldn't match a registry entry namednfpm), andsemrel doctorcould double-suggest them.test/integration/e2e_test.goalready used the full, correct 8-category list, confirming the omission was an oversight rather than intentional scoping.Fix
Add
packager-andpublisher-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 viagit stashonmain:TestRunPluginRestore,TestMaybeAutoRestore_RunsRestoreWhenLockExists)