Repository navigation
Conversation
Pin the sets_set_type_check constraint to SET_TYPES with a unit test. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CMhMAja3g8dwyMnAjVCLN2
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Deploy →
|
There was a problem hiding this comment.
🟢 Approval recommended
The focused refactor preserves validation behavior, adds drift detection, and has no unresolved findings.
0 open findings
What changed in this PR
Centralizes set-type definitions shared by the frontend and edge functions, with a test to detect database constraint drift.
Changes:
- Reuses shared constants, types, and validation through frontend exports.
- Adds a migration-based constraint consistency test.
- Updates documentation to describe the shared definition.
| File | Description |
|---|---|
supabase/functions/_shared/setTypes.ts |
Documents the shared definition and drift test. |
src/lib/setTypeConstraint.test.ts |
Checks constraint values against SET_TYPES. |
src/api/sets/types.ts |
Replaces duplicate definitions with shared exports. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Generated by Claude Code |
Playwright test resultsDetails
|
UPL-50: collapses the two TS copies of
SET_TYPESintosupabase/functions/_shared/setTypes.ts(re-exported fromsrc/api/sets/types.ts) and adds a unit test pinningsets_set_type_checkto it, so drift fails a test.Verification
pnpm exec vitest run src/lib/setTypeConstraint.test.ts; it passes.SET_TYPESwithout a migration; the test fails.🤖 Generated with Claude Code
https://claude.ai/code/session_01CMhMAja3g8dwyMnAjVCLN2
Generated by Claude Code