Remove cookie_patterns legacy, migrate to tracker_patterns

Delete coredata.CookiePattern and all associated CRUD methods,
rename shared types (CookiePatternOrderField, CookiePatternFilter,
CookiePatternMatchType) to TrackerPattern equivalents, and migrate
all API surfaces (GraphQL, MCP, CLI, n8n) to tracker_pattern naming.

The worker was already migrated in the base branch; this commit
completes the removal by dropping the old GraphQL schema/resolvers,
service methods, CLI commands, and n8n operations that operated on
the legacy cookie_patterns table.

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-05-06 10:21:33 +04:00
parent 21f92352d5
commit af6e420f54
39 changed files with 1008 additions and 2475 deletions

View File

@@ -1343,7 +1343,7 @@ func CreateCookieCategory(c *testutil.Client, bannerID string, attrs ...Attrs) s
return result.CreateCookieCategory.CookieCategoryEdge.Node.ID
}
func CreateCookiePattern(c *testutil.Client, categoryID string, attrs ...Attrs) string {
func CreateTrackerPattern(c *testutil.Client, categoryID string, attrs ...Attrs) string {
c.T.Helper()
var a Attrs
@@ -1352,9 +1352,9 @@ func CreateCookiePattern(c *testutil.Client, categoryID string, attrs ...Attrs)
}
const query = `
mutation($input: CreateCookiePatternInput!) {
createCookiePattern(input: $input) {
cookiePatternEdge {
mutation($input: CreateTrackerPatternInput!) {
createTrackerPattern(input: $input) {
trackerPatternEdge {
node { id }
}
}
@@ -1363,27 +1363,28 @@ func CreateCookiePattern(c *testutil.Client, categoryID string, attrs ...Attrs)
input := map[string]any{
"cookieCategoryId": categoryID,
"trackerType": a.getString("trackerType", "COOKIE"),
"pattern": a.getString("pattern", gofakeit.LetterN(8)+"_cookie"),
"matchType": a.getString("matchType", "EXACT"),
"displayName": a.getString("displayName", SafeName("Pattern")),
"description": a.getString("description", "Test cookie pattern"),
"description": a.getString("description", "Test tracker pattern"),
}
if _, ok := a["maxAgeSeconds"]; ok {
input["maxAgeSeconds"] = a.getInt("maxAgeSeconds", 0)
}
var result struct {
CreateCookiePattern struct {
CookiePatternEdge struct {
CreateTrackerPattern struct {
TrackerPatternEdge struct {
Node struct {
ID string `json:"id"`
} `json:"node"`
} `json:"cookiePatternEdge"`
} `json:"createCookiePattern"`
} `json:"trackerPatternEdge"`
} `json:"createTrackerPattern"`
}
err := c.Execute(query, map[string]any{"input": input}, &result)
require.NoError(c.T, err, "createCookiePattern mutation failed")
require.NoError(c.T, err, "createTrackerPattern mutation failed")
return result.CreateCookiePattern.CookiePatternEdge.Node.ID
return result.CreateTrackerPattern.TrackerPatternEdge.Node.ID
}