Skip to content

Wait for the schema snapshot after refresh-schema - #1467

Merged
mscoutermarsh merged 2 commits into
mainfrom
refresh-schema-wait-until-ready
Oct 10, 2026
Merged

mscoutermarsh merged 2 commits into
mainfrom
refresh-schema-wait-until-ready

Conversation

@mscoutermarsh

Copy link
Copy Markdown
Member

Summary

  • pscale branch refresh-schema now waits until the branch schema snapshot is ready (up to 2 minutes) before it reports success, so a follow-up command such as routing-rules get sees the updated schema.
  • If the snapshot is still refreshing when the wait ends, the command exits with schema refreshing; please try again in a few moments. In JSON mode that is action_required with code schema_snapshot_not_ready and a retry hint.

Test plan

  • go test ./internal/cmd/branch/ -run 'TestSnapshot_CreateCmd|TestRefreshSchema'
  • go test ./internal/cmdutil/ -run TestGlobalJSONErrorSchema
  • pscale branch refresh-schema <database> <branch> returns only after schema_ready is true
  • An immediate pscale branch routing-rules get <database> <branch> succeeds

Made with Cursor

refresh-schema returned as soon as a new snapshot was created, so a follow-up
command that reads it could run before the snapshot was ready. Poll until
schema_ready is true, and treat a snapshot that is still refreshing as
action_required.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mscoutermarsh
mscoutermarsh requested a review from a team as a code owner October 10, 2026 15:51

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7a6c2a5. Configure here.

Comment thread internal/cmd/branch/refresh_schema.go

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Risk: medium. Approved. Cursor Bugbot was skipped and Cursor Security Agent did not run; remaining CI is green and this is a bounded refresh-schema wait plus tests, which is within the approval threshold.

Open in Web View Automation 

Sent by Cursor Approval Agent: cli-reviewer

A branch lookup that fails while waiting for the snapshot was reported as
schema refreshing once the wait elapsed. Surface that error instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mscoutermarsh
mscoutermarsh merged commit 21d89c6 into main Oct 10, 2026
4 checks passed
@mscoutermarsh
mscoutermarsh deleted the refresh-schema-wait-until-ready branch October 10, 2026 18:02
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.

2 participants