Repository navigation
Allow Delta Reign (TEF-DLR) Tournaments to be saved - #123
Conversation
The app made TEF-DLR its default Standard format, but the database's commit_tournament_metadata allowlist still stopped at TEF-30C, so creating a Tournament with the default format failed with "Tournament format is not an allowed site format." Add a forward migration that re-creates the function with TEF-DLR in the allowlist, mirror it in schema.sql, point the format rehearsal at the new default, and add a guard that fails when a site format is missing from the database allowlist. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WkSxRaMKK8UtSB1NivqRDs
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 415ad36f99
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Keeps the executed-case count unchanged, per the zero-growth test policy for non-feature changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WkSxRaMKK8UtSB1NivqRDs
Problem
Creating a Tournament with the default format fails with "Tournament format is not an allowed site format."
PR #114 added
TEF-DLRtolib/formats/site-format-options.jsonand made it the default Standard format. But the database functioncommit_tournament_metadatahas its own hardcoded allowlist, last updated in20260926220343_allow_30c_tournament_format.sql, and that list still stops atTEF-30C. As a result, every new or edited Tournament using the new default is rejected.Change
supabase/migrations/20261109222734_allow_delta_reign_tournament_format.sql(sha256f7f798e723a98f32562b2ea6be2a914d32ccce50d8a34d4eddb43965456f54e2): re-createscommit_tournament_metadataexactly as in the 30C migration, withTEF-DLRadded to the allowlist. The grants are unchanged (authenticatedcan execute;publicandanoncannot).schema.sql: the same one-line allowlist change.supabase/rehearsals/tournament_standard_format_allowlist.sql: now creates aTEF-DLRTournament, updates it to the previousTEF-30C, and still checks that an unknown format is rejected.tests/site-formats.test.ts: the existing site-format case now also fails ifsite-format-options.jsoncontains a format that is missing from the allowlist in the latestcommit_tournament_metadatamigration or inschema.sql. This is the failure behind this bug. Executed-case count is unchanged (1 case in this file, before and after). It is a source-text check between the config file and the migration SQL, whichdocs/agents/testing.mdallows for configuration and migration contracts. I confirmed it fails on the pre-fix tree and namesTEF-DLRas missing.Schema and data impact
This replaces one function body and adds one value to its allowlist. It rewrites no data and takes no table locks. It is backward compatible: the current production app and this version both work with the new function. The change only widens what the function accepts.
Verification
npm run lint,npm run typecheck, andnpm run format:check -- tests/site-formats.test.tsall pass.npm test: every case passes excepttests/tournament-deck-list-independence.test.ts("replaying the same Tournament Deck List FormData…"). That case also fails on the base commita6fed6ewithout this change, so this PR did not cause it.npm run migration:rehearse:local, but it could not start the full local Supabase stack. Container registries refused the image pulls (403 and 429 responses), so the rehearsal never reached the migration.supabase/postgres:17.6.1.159image. I loaded the pre-changeschema.sqlfroma6fed6e, applied the new migration, and ran the rehearsal SQL. Because the bare image'sauth.usersis only a placeholder, I used a minimal user insert.Tournament format is not an allowed site format.TEF-DLRcreate commits, the update toTEF-30Ccommits, and the unknown format is rejected.authenticatedcan still execute the function andanoncannot.Database behaviorjob applies every migration to a fresh local stack.Release
TEF-DLR, so the bug stays live until the database is updated. After merging, run the Deploy production database workflow frommain.🤖 Generated with Claude Code
https://claude.ai/code/session_01WkSxRaMKK8UtSB1NivqRDs