Skip to content

feat(runway): Classify failed merges and name conflicting files so a request can fail as a merge conflict - #1158

Open
roychying wants to merge 2 commits into
chenghan.ying/sq-request-duplicate-offrom
chenghan.ying/sq-runway-conflict-kind
Open

roychying wants to merge 2 commits into
chenghan.ying/sq-request-duplicate-offrom
chenghan.ying/sq-runway-conflict-kind

Conversation

@roychying

@roychying roychying commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Why?

When Runway can't merge a request, the orchestrator only sees Outcome_FAILED and a reason string, so a merge conflict ends as land_failed, like any other merge failure. The author can't tell "rebase and resolve the conflict" from "something went wrong, resubmit", and nothing says which files conflict.

What?

  • Runway's MergeResult gets two additive fields:
    • failure_kind (field 6): FAILURE_KIND_UNSPECIFIED, FAILURE_KIND_CONFLICT or FAILURE_KIND_INVALID_REQUEST;
    • conflicting_files (field 7): the conflicting paths, when the merger can tell.
  • merger.ConflictError{Files, Err} wraps ErrConflict with the paths. merger.FailureKind(err) and merger.ConflictingFiles(err) read them back. The merge and merge-conflict-check controllers set both fields on a failed result. The OSS git merger reports its unmerged paths.
  • merger.ErrRejected is a new terminal error for a merge the backend refused without calling it a conflict, so it fails as land_failed, not merge_conflict. It covers a PROMOTE target that is no longer a fast-forward because the branch moved, and a merge GitHub reports as failed, which it doesn't separate from a rule or a moved head. Both used to be ErrConflict.
  • The orchestrator maps a conflict to the new merge_conflict category, both in the land-conflict check (including its repair resend) and at land time (corerequest.LandFailure). It records up to 10 paths under the conflicting_files metadata key. Any other failure stays land_failed.
  • Batch conclusion takes one failure value (reason, category, details) instead of separate arguments, so conclude and its DLQ don't parse the message twice.
  • request.failed payloads carry conflicting_files, one path per line.

A Runway that doesn't set the new fields yields FAILURE_KIND_UNSPECIFIED, so a conflict still ends as land_failed, as before. Mixed versions are safe in both directions.

Test Plan

  • bazel test //runway/... //submitqueue/....
  • make lint check-gazelle check-mocks. merge.pb.go was regenerated; no other generated file changed.
  • End to end, on an internal staging deployment whose comment hook reads these payloads: a pull request that conflicted with the target branch failed as merge_conflict, with its conflicting file in the event, 3 seconds after it was received.

Issue

@roychying
roychying added this pull request to stack #1111 December 1, 2026 16:56
@roychying
roychying force-pushed the chenghan.ying/sq-runway-conflict-kind branch from 507ff33 to 127d2b8 Compare December 1, 2026 17:56
@roychying
roychying force-pushed the chenghan.ying/sq-runway-conflict-kind branch from 127d2b8 to f04efde Compare December 1, 2026 18:25
@roychying
roychying marked this pull request as ready for review December 1, 2026 18:29
@roychying
roychying requested review from a team and sbalabanov as code owners December 1, 2026 18:29
@roychying
roychying force-pushed the chenghan.ying/sq-runway-conflict-kind branch from f04efde to c90264e Compare December 2, 2026 17:25
@roychying
roychying force-pushed the chenghan.ying/sq-runway-conflict-kind branch from c90264e to 3a47ce3 Compare December 2, 2026 22:23
@roychying
roychying force-pushed the chenghan.ying/sq-runway-conflict-kind branch from 3a47ce3 to b160d79 Compare December 2, 2026 22:55

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant