feat(storage): merge gate request kinds and an apply-in-flight check hold - #939
Draft
aparajon wants to merge 2 commits into
Draft
feat(storage): merge gate request kinds and an apply-in-flight check hold#939aparajon wants to merge 2 commits into
aparajon wants to merge 2 commits into
Conversation
This was referenced Aug 5, 2026
aparajon
force-pushed
the
armand/check-refresh-on-apply
branch
from
August 5, 2026 14:03
b054f62 to
fd47dab
Compare
aparajon
force-pushed
the
armand/check-hold-storage
branch
from
August 5, 2026 14:03
4df18d8 to
8506ecb
Compare
…ck hold Check refresh requests gain a kind column distinguishing settle requests (re-plan sibling PR checks after an apply reaches a terminal state) from preflight requests (hold sibling PR checks before an apply starts engine work). The unique key becomes (apply_id, kind) so one apply can carry both. Storage adds ReopenForRetry to re-arm a terminally failed request, FindTerminalAppliesWithPreflightMissingSettle to find preflighted applies whose hold was never released, HasActivePreflightedApplyOnTarget to detect a live hold on a target, and MarkBlockedForApplyInFlight to conditionally flip a stored check to blocked without touching rows owned by an in-progress apply or a moved head SHA. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… holds Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
aparajon
force-pushed
the
armand/check-refresh-on-apply
branch
from
August 5, 2026 15:14
fd47dab to
6bc0242
Compare
aparajon
force-pushed
the
armand/check-hold-storage
branch
from
August 5, 2026 15:14
8506ecb to
d72df1f
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
When an apply starts changing a target schema, every other open PR holding a green check against that same (environment, database type, database) target is now holding a verdict that may no longer be true — and nothing stops a merge from landing on it while the apply is still running. The existing merge gate guardrail only reacts after an apply completes. Closing the window before and during an apply requires two new durable primitives, which this PR adds at the storage layer. Stack 4/7, on top of #866.
What it does
kindcolumn tomerge_gate_requests, splitting the outbox into two request kinds:(apply_id, kind)so one apply can carry both requests through its lifecycle.ReopenForRetry— re-arms a terminally failed request so a gate can retry it.FindTerminalAppliesWithPreflightMissingSettle— finds applies whose preflight held sibling checks but whose settle (the release) was never recorded.HasActivePreflightedApplyOnTarget— detects a live hold on a target so a settle doesn't prematurely release it.MarkBlockedForApplyInFlight— conditionally flips a stored check to blocked, refusing to touch rows owned by an in-progress apply or a moved head SHA (optimistic concurrency on the head SHA).How it moves us toward the northstar
Merging a PR should be safe exactly when its checks are green. This stack makes an in-flight apply on the same target visible in every sibling PR's checks, so git remains the interface and the check state is never a stale rendering of reality. This PR is pure storage; the processor fan-out and the operator gate build on it.
The chain: #867 (storage) → #868 (drive-tail recording) → #866 (settle re-plan processor) → #939 (request kinds + hold storage) → #940 (preflight hold fan-out) → #941 (apply-start gate) → #942 (plan-time holds). Merges bottom-up; each PR retargets to
mainas its base merges.🤖 Generated with Claude Code