Skip to content

Staging sync checks the project by ref, not its display name - #255

Merged
Programcode merged 2 commits into
mainfrom
fix/staging-sync-project-name
Oct 28, 2026
Merged

Programcode merged 2 commits into
mainfrom
fix/staging-sync-project-name

Conversation

@Programcode

@Programcode Programcode commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

The staging project brifeyypjauyusmkptkx was renamed in the Supabase dashboard from debate-trainer-staging to DebateOwl Staging. scripts/staging-sync.mjs compared the display name, so debatelab-staging-sync.timer has refused every run since 2026-10-27 21:04 Budapest time (see #248):

Refused: brifeyypjauyusmkptkx is named "DebateOwl Staging", expected "debate-trainer-staging".

Change

  • assertStagingTarget now checks the project by ref only, because the ref never changes. The display-name comparison and STAGING_NAME are gone.
  • These safety checks are unchanged: 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 brifeyypjauyusmkptkx explicitly, so the script can't target production.
  • The tests cover any staging name, the older CLI output that has only id, a production override (refused), and a production project named like staging (refused).
  • docs/staging.md and docs/operations.md list the projects by ref, with their current names.

Checks

  • npm run verify passed 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-run on 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/repo checks out the new main on its next 5-minute tick and runs the fixed script. A successful sync closes #248.

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.
Copilot AI balanced review requested due to automatic review settings October 28, 2026 11:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between a04c156 and d7864e7.

Files selected for processing: 4
  • docs/operations.md
  • docs/staging.md
  • scripts/staging-sync.mjs
  • src/test/scripts/staging-sync.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The staging sync now identifies the staging project by its Supabase ref, not its dashboard display name. The documentation and tests reflect this change and describe the project ID requirements.

Changes: Staging Sync Target

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.

@Programcode
Programcode merged commit 3409a12 into main Oct 28, 2026
1 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Staging is out of sync with main

2 participants