chore(label-catalog): extract factory presets to code constants #943

Merged
reviewer merged 1 commit from dev/936 into main 2026-05-08 09:12:30 +00:00
Collaborator

Extracts the factory label set from scope='builtin' DB rows into LABEL_PRESETS in setup/label-presets.ts. SQL no longer touches scope='builtin'; GET handlers merge presets in-memory and ensureRepoLabels uses them as the base layer with DB overrides on top.

Closes #936

Test plan

  • label-presets.test.ts: non-empty, all 6-digit hex colours, unique names, routing-critical labels present
  • label-catalog.test.ts: handler tests pass with in-memory merge (preset rows appear as scope='builtin', id=0)
  • labels.test.ts: ensureRepoLabels scope-override test updated — mock reports all presets except area:dashboard as existing; verifies repo-colour wins
Extracts the factory label set from `scope='builtin'` DB rows into `LABEL_PRESETS` in `setup/label-presets.ts`. SQL no longer touches `scope='builtin'`; GET handlers merge presets in-memory and `ensureRepoLabels` uses them as the base layer with DB overrides on top. Closes #936 ## Test plan - `label-presets.test.ts`: non-empty, all 6-digit hex colours, unique names, routing-critical labels present - `label-catalog.test.ts`: handler tests pass with in-memory merge (preset rows appear as `scope='builtin'`, id=0) - `labels.test.ts`: `ensureRepoLabels` scope-override test updated — mock reports all presets except `area:dashboard` as existing; verifies repo-colour wins
dev self-assigned this 2026-05-08 09:08:08 +00:00
chore(label-catalog): extract factory presets to code constants
All checks were successful
qa / sql-layer-check (pull_request) Successful in 9s
qa / dockerfile (pull_request) Successful in 9s
qa / i18n-string-check (pull_request) Successful in 11s
qa / db-schema (pull_request) Successful in 46s
qa / qa-1 (pull_request) Successful in 1m52s
qa / qa (pull_request) Successful in 0s
42172743d0
Move the factory label set from `scope='builtin'` DB rows into a
`LABEL_PRESETS` TypeScript constant in `setup/label-presets.ts`.
GET handlers now merge presets in-memory instead of querying
`scope='builtin'` rows; `ensureRepoLabels` uses `LABEL_PRESETS`
as the base layer and applies DB overrides on top.

Closes #936

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dev requested review from reviewer 2026-05-08 09:11:10 +00:00
reviewer approved these changes 2026-05-08 09:12:22 +00:00
reviewer left a comment

All ACs met. getLabelCatalogForRepo queries only global/repo scopes so old builtin DB rows can't shadow the new presets. Scope layering in ensureRepoLabels is correct. CI green.

All ACs met. `getLabelCatalogForRepo` queries only `global`/`repo` scopes so old `builtin` DB rows can't shadow the new presets. Scope layering in `ensureRepoLabels` is correct. CI green.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks!943
No description provided.