feat(runway): classify invalid merge requests as terminal - #458
Merged
Conversation
This was referenced Jul 29, 2026
behinddwalls
marked this pull request as ready for review
July 30, 2026 14:45
behinddwalls
force-pushed
the
preetam/remove-dead-pusher
branch
from
July 30, 2026 16:12
8990caa to
ed6f3a9
Compare
behinddwalls
force-pushed
the
preetam/runway-terminal-errors
branch
from
July 30, 2026 16:12
24ac344 to
8878096
Compare
behinddwalls
marked this pull request as draft
July 30, 2026 16:14
behinddwalls
force-pushed
the
preetam/remove-dead-pusher
branch
from
July 30, 2026 16:15
ed6f3a9 to
06ef188
Compare
behinddwalls
force-pushed
the
preetam/runway-terminal-errors
branch
from
July 30, 2026 16:15
8878096 to
930df02
Compare
behinddwalls
marked this pull request as ready for review
July 30, 2026 17:05
behinddwalls
force-pushed
the
preetam/runway-terminal-errors
branch
from
July 30, 2026 17:13
930df02 to
8ee23c0
Compare
kevinlnew
approved these changes
Jul 30, 2026
## 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`
behinddwalls
force-pushed
the
preetam/runway-terminal-errors
branch
from
July 30, 2026 17:55
8ee23c0 to
133a045
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.
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 fmt