Sync staging database from production every three days - #727
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ea47d2d. Configure here.
|
|
||
| concurrency: | ||
| group: staging-database-maintenance | ||
| cancel-in-progress: false |
There was a problem hiding this comment.
Concurrency drops pending maintenance runs
High Severity
The shared staging-database-maintenance concurrency group omits queue: max, so GitHub keeps only one pending run and cancels any earlier waiter when another arrives. A pending scheduled sync can be dropped, and the epoch-day guard will not retry until three days later. Pending stage-results runs can also be cancelled with no completion dispatch back to the source repo.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit ea47d2d. Configure here.


Summary
stagingbranch from the default production branch every three calendar days at 4:00 AM America/Chicago timeWhy
The staging database accumulates staged benchmark runs and can drift from production. Periodically replacing it from the production head gives staging a predictable, complete baseline while preserving the existing production branch and connection endpoints.
GitHub cron does not provide a true every-N-days interval:
*/3in the day-of-month field resets at month boundaries. The workflow therefore triggers daily at 4:00 AM Central and uses an epoch-day modulo guard to perform the restore on an exact three-calendar-day cadence.timezone: America/Chicagokeeps the wall-clock time at 4:00 AM across daylight-saving changes.Validation
actionlint .github/workflows/stage-results.yml .github/workflows/sync-staging-database.ymluvx --exclude-newer P1D zizmor@latest --strict-collection --pedantic --no-ignores .github/workflows/stage-results.yml .github/workflows/sync-staging-database.ymlNote
Medium Risk
Periodically wipes and replaces the shared staging database via Neon restore APIs; production is guarded, but a bad restore or race would disrupt staging data and ingest.
Overview
Adds a scheduled workflow that restores the Neon
stagingbranch from production every three calendar days (daily 4:00 AM Central trigger with an epoch-day guard), then invalidates the staging site cache. Manualworkflow_dispatchruns bypass the cadence check.Locks
stage-resultsand the new sync workflow behind a sharedstaging-database-maintenanceconcurrency group so restores and staged-run ingest cannot overlap.Reviewed by Cursor Bugbot for commit ea47d2d. Bugbot is set up for automated code reviews on this repo. Configure here.