Repository navigation
Staging sync checks the project by ref, not its display name - #255
Conversation
The staging project was renamed from debate-trainer-staging to DebateOwl Staging, and the sync refused to run since 2026-10-28 11:18 UTC. The target check now keys on the ref (brifeyypjauyusmkptkx), which never changes. The SUPABASE_PROJECT_ID override check, the staging != production check and the explicit --project-ref on every CLI call are unchanged.
|
| Layer / File(s) | Summary |
|---|---|
Ref-based staging target identification scripts/staging-sync.mjs, src/test/scripts/staging-sync.test.ts, docs/staging.md, docs/operations.md |
The script finds and returns the staging project by ref without checking its display name. Tests cover different project names, legacy CLI entries, and SUPABASE_PROJECT_ID validation. The docs identify projects by ref and describe the sync requirements. |
Estimated code review effort: 2 (Simple) | ~10 minutes
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Note
🎁 Summarized by CodeRabbit Free
-
Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing.
Comment @coderabbitai help to get the list of available commands.
The staging project
brifeyypjauyusmkptkxwas renamed in the Supabase dashboard fromdebate-trainer-stagingtoDebateOwl Staging.scripts/staging-sync.mjscompared the display name, sodebatelab-staging-sync.timerhas refused every run since 2026-10-27 21:04 Budapest time (see #248):Change
assertStagingTargetnow checks the project by ref only, because the ref never changes. The display-name comparison andSTAGING_NAMEare gone.SUPABASE_PROJECT_ID, if set, must equal the staging ref; the staging and production refs must differ; the CLI must be able to see the staging ref. Every CLI call still passes--project-ref brifeyypjauyusmkptkxexplicitly, so the script can't target production.id, a production override (refused), and a production project named like staging (refused).docs/staging.mdanddocs/operations.mdlist the projects by ref, with their current names.Checks
npm run verifypassed locally, because GitHub Actions is billing-blocked: 96 + 5 unit test files, docs, lint, typecheck, build, the offline service-worker test and 47/47 smoke.node scripts/staging-sync.mjs --dry-runon the VPS gets past the target check. It reports "Staging already matches this commit." at a079628 and exits 0. Nothing was changed on staging.After merge, the timer's clone at
~/ops/debatelab-staging-sync/repochecks out the new main on its next 5-minute tick and runs the fixed script. A successful sync closes #248.