From 829771b7ccacb6584abfcfc1919579e77c1ee9d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20R=C3=A9?= Date: Tue, 16 Jun 2026 10:37:41 +0200 Subject: [PATCH] Supply enrichment_attempts in tracker pattern seed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The migration dropped the DEFAULT on common_tracker_patterns.enrichment_attempts, so the column is now NOT NULL with no default and inserts must set it explicitly. The e2e seedCommonTrackerPattern helper still did a raw insert without it, which broke TestThirdParty_ImportFromCommon and TestTrackerPattern_CommonTrackerPatternID with a 23502 violation. Pass 0 for the seeded rows. Signed-off-by: Émile Ré --- e2e/console/tracker_pattern_test.go | 6 +++--- pkg/cookiebanner/common_pattern_enrichment_metadata.go | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/e2e/console/tracker_pattern_test.go b/e2e/console/tracker_pattern_test.go index f053639e4..0c88ad285 100644 --- a/e2e/console/tracker_pattern_test.go +++ b/e2e/console/tracker_pattern_test.go @@ -667,11 +667,11 @@ func seedCommonTrackerPattern(t *testing.T) gid.GID { _, err := conn.Exec(ctx, ` INSERT INTO common_tracker_patterns ( - id, tracker_type, pattern, match_type, description, confidence, created_at, updated_at + id, tracker_type, pattern, match_type, description, confidence, enrichment_attempts, created_at, updated_at ) VALUES ( - $1, $2, $3, $4, $5, $6, $7, $8 + $1, $2, $3, $4, $5, $6, $7, $8, $9 ) - `, id, "COOKIE", "e2e_common_"+id.String(), "EXACT", "Seeded catalog description", 1.0, now, now) + `, id, "COOKIE", "e2e_common_"+id.String(), "EXACT", "Seeded catalog description", 1.0, 0, now, now) require.NoError(t, err) t.Cleanup(func() { diff --git a/pkg/cookiebanner/common_pattern_enrichment_metadata.go b/pkg/cookiebanner/common_pattern_enrichment_metadata.go index 7b756a3db..d944a4dff 100644 --- a/pkg/cookiebanner/common_pattern_enrichment_metadata.go +++ b/pkg/cookiebanner/common_pattern_enrichment_metadata.go @@ -97,6 +97,7 @@ func buildCommonPatternEnrichmentMetadata( } thirdPartyStatus := commonPatternFieldStatusNotFound + switch { case alreadyLinked: thirdPartyStatus = commonPatternFieldStatusExternal