feat(runway): classify invalid merge requests as terminal - #458
Draft
behinddwalls wants to merge 1 commit into
Draft
feat(runway): classify invalid merge requests as terminal#458behinddwalls wants to merge 1 commit into
behinddwalls wants to merge 1 commit into
Conversation
## Summary ### Why? Runway is stateless and the sole responder on the client's correlation id: SubmitQueue records the in-flight work before publishing and waits for exactly one `MergeResult` echoing that id. A request that resolves to neither a success nor a failure leaves the client waiting forever. Today the controllers treat exactly one error as a nameable outcome — `merger.ErrConflict` — and nack everything else for retry. But some requests are unusable as written: an unknown or unsupported merge strategy, a malformed change URI, an invalid strategy composition. Retrying those can never succeed. Nacking them burns the retry budget and then dead-letters, which — with nothing draining the dead-letter topics — is precisely the silent hang described above. ### What? Adds a second terminal sentinel to the merger contract, `merger.ErrInvalidRequest`, for requests that can never be applied as written, and `merger.IsTerminal` as the single classification point over both sentinels. Switches both the `merge` and `mergeconflictcheck` controllers from an `errors.Is(err, merger.ErrConflict)` test to `merger.IsTerminal(err)`, so an invalid request now publishes a `FAILED` `MergeResult` and acks instead of nacking. The two cases stay distinguishable in observability: invalid requests increment an `invalid_requests` counter and log the underlying error, conflicts keep the existing `merge_conflicts` counter. No implementation returns the new sentinel yet — the git-backed merger later in this stack is its first producer. This lands the contract and the controller behavior first so that change is only about merge mechanics. Also corrects the Runway README, which still claimed the controllers merely deserialize and log the request. ## Test Plan ✅ `bazel test //runway/...` — 4/4 pass, including new `TestProcess_InvalidRequest` cases on both controllers asserting a FAILED result is published and the delivery is acked ✅ `make gazelle`, `make fmt`
This was referenced Jul 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.
Summary
Why?
Runway is stateless and the sole responder on the client's correlation id: SubmitQueue records the in-flight work before publishing and waits for exactly one
MergeResultechoing that id. A request that resolves to neither a success nor a failure leaves the client waiting forever.Today the controllers treat exactly one error as a nameable outcome —
merger.ErrConflict— and nack everything else for retry. But some requests are unusable as written: an unknown or unsupported merge strategy, a malformed change URI, an invalid strategy composition. Retrying those can never succeed. Nacking them burns the retry budget and then dead-letters, which — with nothing draining the dead-letter topics — is precisely the silent hang described above.What?
Adds a second terminal sentinel to the merger contract,
merger.ErrInvalidRequest, for requests that can never be applied as written, andmerger.IsTerminalas the single classification point over both sentinels.Switches both the
mergeandmergeconflictcheckcontrollers from anerrors.Is(err, merger.ErrConflict)test tomerger.IsTerminal(err), so an invalid request now publishes aFAILEDMergeResultand acks instead of nacking. The two cases stay distinguishable in observability: invalid requests increment aninvalid_requestscounter and log the underlying error, conflicts keep the existingmerge_conflictscounter.No implementation returns the new sentinel yet — the git-backed merger later in this stack is its first producer. This lands the contract and the controller behavior first so that change is only about merge mechanics.
Also corrects the Runway README, which still claimed the controllers merely deserialize and log the request.
Test Plan
✅
bazel test //runway/...— 4/4 pass, including newTestProcess_InvalidRequestcases on both controllers asserting a FAILED result is published and the delivery is acked✅
make gazelle,make fmtStack