From 5415b2d438f3cdbf95dc0d1803e36c00316cbbc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20R=C3=A9?= Date: Tue, 9 Jun 2026 19:39:16 +0200 Subject: [PATCH] Allow reenrich without a selection anchor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The reenrich command forced callers to pass exactly one selection anchor (--id, --linked-banner, --linked-org, or --common-third-party) before any pattern could be re-described. That made the common case of re-enriching every catalog row with a blank description impossible without an artificial anchor. Drop the anchor-required guard while keeping anchors mutually exclusive. With no anchor, the filtering flags now select across the whole catalog, so --without-description re-enriches every pattern that lacks a description. Signed-off-by: Émile Ré --- pkg/proboctl/commontrackerpattern/reenrich.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkg/proboctl/commontrackerpattern/reenrich.go b/pkg/proboctl/commontrackerpattern/reenrich.go index 4fe88417d..78b49ecd1 100644 --- a/pkg/proboctl/commontrackerpattern/reenrich.go +++ b/pkg/proboctl/commontrackerpattern/reenrich.go @@ -127,11 +127,13 @@ func newCmdReenrich(f *cmdutil.Factory) *cobra.Command { } // resolveReenrichIDs turns the selection flags into the set of common -// tracker pattern IDs to re-enrich. Exactly one selection anchor must be +// tracker pattern IDs to re-enrich. At most one selection anchor may be // provided: --id, --linked-banner, --linked-org, or --common-third-party. // The --tracker-type, --keyword, --state, and --without-description flags // further narrow the anchor's result, except with --id, where the listed -// patterns are used verbatim. +// patterns are used verbatim. With no anchor, the filtering flags select +// across the whole catalog (e.g. --without-description re-enriches every +// pattern with a blank description). func resolveReenrichIDs( ctx context.Context, pgClient *pg.Client, @@ -148,10 +150,7 @@ func resolveReenrichIDs( } } - switch { - case anchors == 0: - return nil, fmt.Errorf("specify exactly one selection anchor: --id, --linked-banner, --linked-org, or --common-third-party") - case anchors > 1: + if anchors > 1 { return nil, fmt.Errorf("--id, --linked-banner, --linked-org, and --common-third-party are mutually exclusive") }