Add common third party reenrich and stats CLIs
Add `proboctl common-third-party reenrich` to re-arm the async enrichment worker for selected catalog rows, and `stats` to summarize the catalog by enrichment state and last run status. Rows are selected verbatim via --id/--slug or across the catalog via --category/--keyword/--state/--status, gated by --dry-run and --yes. Extend `list` with --state/--status filters and STATE/STATUS columns, and `show` with enrichment state, attempts, last run status, error, per-field provenance, and discovered domains. Back these with CommonThirdPartyFilter state/status/IDs filters plus CommonThirdParties.LoadAllIDs and RequestEnrichmentByIDs. The latter stamps enrichment_requested_at and resets the attempt counter while preserving the existing payload, so the worker merge keeps curated and human-edited provenance. Also simplify exactLabelMatch to use slices.Contains. Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
package thirdparty
|
||||
|
||||
import (
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"go.probo.inc/probo/pkg/uri"
|
||||
@@ -163,13 +164,7 @@ func vendorLabels(name, website string) []string {
|
||||
|
||||
// exactLabelMatch reports whether label equals any vendor label.
|
||||
func exactLabelMatch(label string, vendorLabels []string) bool {
|
||||
for _, vl := range vendorLabels {
|
||||
if label == vl {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
return slices.Contains(vendorLabels, label)
|
||||
}
|
||||
|
||||
// relatedLabelMatch reports whether label is the same as, contains, or is
|
||||
|
||||
Reference in New Issue
Block a user