feat(cli): add schema change cancel command#571
Merged
Conversation
df39832 to
007b603
Compare
489d378 to
d213486
Compare
d213486 to
6457f03
Compare
6457f03 to
8bed941
Compare
8bed941 to
5dc8ddc
Compare
5dc8ddc to
667b9d8
Compare
Amp-Thread-ID: https://ampcode.com/threads/T-019ef4e0-c517-71c8-aae9-54a8f2173a85 Co-authored-by: Amp <amp@ampcode.com>
There was a problem hiding this comment.
Pull request overview
Adds a new schemabot cancel CLI command to request permanent schema change cancellation via the backend cancel API, with dedicated CLI output rendering.
Changes:
- Register a new top-level
cancelCLI command and implement its execution flow (preflight progress check → cancel API call → rendered output). - Add cancel-specific response handling (accepted wrapper) and success-output template including cancelled/skipped counts.
- Introduce cancel output formatting alongside existing stop/start templates.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pkg/cmd/main.go | Registers the new cancel subcommand in the root CLI. |
| pkg/cmd/internal/templates/progress.go | Adds CancelData + WriteCancelSuccess for cancel-specific CLI output. |
| pkg/cmd/commands/common.go | Adds a CancelResponse wrapper so checkAccepted can be reused. |
| pkg/cmd/commands/cancel.go | Implements the schemabot cancel command logic and state gating. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Prompt for explicit "yes" confirmation before cancelling, unless -y / --auto-approve is passed, consistent with apply and rollback. Cancellation is permanent and non-resumable, so it should not run unattended by default. - Drop the hard-coded cancellable-state allowlist. The no-active and already-terminal (except stopped) early returns already mirror the server's reject cases; the server is the source of truth for which remaining states are cancellable, so the allowlist only risked wrongly blocking valid non-terminal states (e.g. PlanetScale setup phases, paused/resuming). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
morgo
approved these changes
Jun 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Once the backend can record and drive permanent cancel requests, operators need a first-class CLI entry point instead of overloading
stopfor terminal aborts.What
schemabot cancelfor permanent schema change cancellation-y/--auto-approveto skip, consistent withapplyandrollbackRisk Assessment
Low — this is a thin CLI layer on top of the backend cancel API (#573).
PR summary updated by Claude Code (Opus 4.8).