From efa5992c1e33316f010c5ce8f294134051405f0c Mon Sep 17 00:00:00 2001 From: Markus Waldheim Date: Tue, 14 Jul 2026 09:40:56 +0200 Subject: [PATCH] fix(core): recognize packager- and publisher- plugin category prefixes 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. --- internal/cli/doctor.go | 2 +- internal/cli/root.go | 2 +- internal/registry/metadata.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/cli/doctor.go b/internal/cli/doctor.go index cbb30d8..7148807 100644 --- a/internal/cli/doctor.go +++ b/internal/cli/doctor.go @@ -431,7 +431,7 @@ func checkRecommendations(cfg *config.Config) []DoctorCheck { // so that suggestions are suppressed regardless of whether the user's config // uses the short or prefixed plugin name. configured := map[string]bool{} - categoryPrefixes := []string{"provider-", "condition-", "analyzer-", "generator-", "updater-", "hook-"} + categoryPrefixes := []string{"provider-", "condition-", "analyzer-", "generator-", "updater-", "hook-", "packager-", "publisher-"} registerName := func(raw string) { name := strings.ToLower(strings.TrimSpace(raw)) if name == "" { diff --git a/internal/cli/root.go b/internal/cli/root.go index 464eb1a..ee82efa 100644 --- a/internal/cli/root.go +++ b/internal/cli/root.go @@ -1151,7 +1151,7 @@ func legacyPluginBinaryName(uses string) string { uses = uses[:idx] } lower := strings.ToLower(uses) - for _, prefix := range []string{"provider-", "condition-", "analyzer-", "generator-", "updater-", "hook-"} { + for _, prefix := range []string{"provider-", "condition-", "analyzer-", "generator-", "updater-", "hook-", "packager-", "publisher-"} { if strings.HasPrefix(lower, prefix) { uses = uses[len(prefix):] break diff --git a/internal/registry/metadata.go b/internal/registry/metadata.go index e0ca344..c8eb68a 100644 --- a/internal/registry/metadata.go +++ b/internal/registry/metadata.go @@ -56,7 +56,7 @@ type Compatibility struct { // ("github-actions", "github", "go"), so FindPlugin strips these prefixes as a // fallback when no exact match is found. var categoryPrefixes = []string{ - "provider-", "condition-", "analyzer-", "generator-", "updater-", "hook-", + "provider-", "condition-", "analyzer-", "generator-", "updater-", "hook-", "packager-", "publisher-", } // FindPlugin returns the registry entry for the named plugin.