Merged
Conversation
b1e6037 to
b94fe52
Compare
There was a problem hiding this comment.
Pull request overview
Adds first-class tracking and surfacing of Vitess VSchema changes through the deploy lifecycle so mixed DDL+VSchema deploys show VSchema progress in the progress API/TUI.
Changes:
- Introduces
CHANGE_TYPE_VSCHEMAin the Tern proto and maps taskDDLAction→ChangeTypein progress responses. - Always creates synthetic VSchema tasks for namespaces with VSchema changes (including mixed DDL+VSchema deploys) and adds task-state derivation for VSchema tasks.
- Updates CLI preview output and adds tests for VSchema labels, rendering order, and proto round-trips.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/tern/state_converters.go | Adds ddlActionToProtoChangeType to map task DDLAction strings (including vschema_update) to proto ChangeType. |
| pkg/tern/local_client.go | Always appends VSchema tasks during Apply and sets TableProgress.ChangeType in Progress responses. |
| pkg/tern/local_apply.go | Adds special handling and state derivation for VSchema tasks during atomic progress syncing. |
| pkg/proto/tern.proto | Adds CHANGE_TYPE_VSCHEMA and updates ChangeType comment to “schema change”. |
| pkg/proto/ternv1/tern.pb.go | Regenerated protobuf output reflecting the new enum value. |
| pkg/cmd/templates/progress_states_test.go | Adds tests for VSchema labels, rendering order, and VSchema task detection variants. |
| pkg/cmd/templates/preview_progress.go | Updates the Vitess progress preview to include mixed DDL + VSchema scenarios. |
| pkg/api/proto_helpers.go | Adds CHANGE_TYPE_VSCHEMA ↔ vschema_update conversions. |
| pkg/api/proto_helpers_test.go | Extends ChangeType round-trip test to cover VSchema. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Always create VSchema tasks alongside DDL tasks so VSchema progress is visible through the progress API and TUI. Previously VSchema changes were invisible when paired with DDL. Changes: - Add CHANGE_TYPE_VSCHEMA to proto ChangeType enum - Create VSchema tasks for every namespace with VSchema data - Track VSchema task state through deploy lifecycle via deriveVSchemaTaskState - Extract engine.MessageApplyingVSchema constant for deploy phase detection - Set ChangeType on progress response TableProgress - Clamp per-table status to revert_window during revert window for consistency - Fix table flicker before deploy prompt (IsBranchSetupPhase override, skip VSchema tasks in markTasksRunning) - Fix Progress handler prematurely marking apply complete in sequential mode - Fix e2e cleanup ordering (drop tables before resetting VSchema) - Remove recycle emoji from cutover labels Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
99d4e35 to
e635a35
Compare
morgo
approved these changes
May 4, 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
When DDL and VSchema changes coexist in a deploy, VSchema progress is invisible — it only lives in the deploy request's metadata but doesn't surface through the progress API or TUI. Users see DDL tables completing but have no idea VSchema is being applied.
What
VSchema task tracking:
CHANGE_TYPE_VSCHEMAto protoChangeTypeenumin_progress_vschema) → revert_window → completedengine.MessageApplyingVSchemaconstant for deploy phase detectionChangeTypeon progress responseTableProgressapply_logsTUI/progress fixes:
IsBranchSetupPhaseoverride, skip VSchema tasks inmarkTasksRunning)revert_windowduring revert window for cross-keyspace consistencymake demo)vschemaStatusLabelhandles all deploy states (no raw state strings in TUI)Tests:
TestDeriveOverallState— revert window, mixed states, priority orderingTestDeriveVSchemaTaskState— full lifecycle: pending → running → revert_window → completedTestVSchemaTasksCreatedAlongsideDDL— VSchema tasks created for every namespace with VSchema dataTestVSchemaStatusLabel— all deploy states produce human-readable labelsTestVitess_Apply_VSchemaTaskTracking(e2e) — polls progress API, verifies VSchema tasks appear withchange_type=vschema_updateand reach terminal stateTestLocal_Apply_CreateMultipleTables(e2e) — multi-table sequential apply completes all tasks🤖 Generated with Claude Code