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
|
| @@ -0,0 +1,28 @@ | |||
| import { readFileSync, readdirSync } from "node:fs"; | |||
There was a problem hiding this comment.
do we really need this test?
There was a problem hiding this comment.
Kept for now: UPL-50 explicitly asks to pin the DB constraint with a test so the TS/SQL copies can't drift silently (it's the only remaining sync point). It's ~25 lines and runs in unit tests without Supabase. If you'd rather drop it, say so and I'll remove it and the file.
Generated by Claude Code
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Mb7n65Uv6JK1vgDFZCVPw
|
Generated by Claude Code |
|
The re-run of Generated by Claude Code |
|
CI is red on Generated by Claude Code |
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