feat(api): reapply accepts the failed remainder of a partially completed apply#592
Open
aparajon wants to merge 1 commit into
Open
feat(api): reapply accepts the failed remainder of a partially completed apply#592aparajon wants to merge 1 commit into
aparajon wants to merge 1 commit into
Conversation
aparajon
force-pushed
the
aparajon/reapply-api
branch
from
June 29, 2026 21:08
0d650f9 to
7d41999
Compare
aparajon
force-pushed
the
aparajon/reapply-api
branch
from
June 29, 2026 21:51
7d41999 to
402785c
Compare
aparajon
force-pushed
the
aparajon/reapply-api
branch
from
June 30, 2026 14:30
402785c to
5f5e465
Compare
aparajon
marked this pull request as ready for review
June 30, 2026 14:31
There was a problem hiding this comment.
Pull request overview
Adds an operator-facing reapply control path to safely retry a failed schema change by re-planning against the current world state and only re-queueing when the fresh plan is equivalent to the remaining failed work.
Changes:
- Introduces
POST /api/reapplyroute + handler wiring in the API service. - Adds
ReapplyResponseAPI type for the new endpoint. - Implements reapply planning/equivalence logic plus unit tests around the core
ExecuteReapplybehavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| pkg/apitypes/apitypes.go | Extends control-operation API types with a dedicated ReapplyResponse. |
| pkg/api/service.go | Wires the new POST /api/reapply handler into route registration and exported handler surface. |
| pkg/api/reapply_handlers.go | Implements handleReapply + ExecuteReapply with plan re-generation and equivalence checks before re-queueing failed work. |
| pkg/api/reapply_handlers_test.go | Adds tests covering reapply acceptance/rejection paths and plan filtering/equivalence helpers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
aparajon
force-pushed
the
aparajon/reapply-api
branch
from
July 2, 2026 22:14
00d8618 to
90fd136
Compare
aparajon
force-pushed
the
aparajon/reapply-api
branch
3 times, most recently
from
July 9, 2026 03:28
19272bb to
6b22230
Compare
…ted apply A partially completed apply no longer has to be recreated by hand: reapply now selects the apply's failed work (failed tasks, failed operations, and failed group finalizers), filters the stored plan down to that remainder, and requeues it when the fresh re-plan matches the remaining work. Failed work outside the plan's primary deployment is still rejected, and a failed task referencing a missing operation row still fails closed for operator investigation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
aparajon
force-pushed
the
aparajon/reapply-api
branch
from
July 9, 2026 03:34
6b22230 to
7110ec1
Compare
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 this matters
The reapply endpoint (#698) requeues only a fully failed apply. Real failures are often partial — some tables completed before one failed — and forcing operators to hand-build a new apply for the remainder is exactly the toil reapply should remove.
What it does
Stacked on #698 (strict reapply endpoint). PR 3 of 5 in the reapply stack: storage primitive (merged) → strict endpoint (#698) → this → lock ownership → CLI.
🤖 Generated with Claude Code