Skip to content

fix(submitqueue): record idempotent gateway creates of existing rows … - #1167

Draft
roychying wants to merge 1 commit into
mainfrom
chenghan.ying/storage-already-exists-metric
Draft

roychying wants to merge 1 commit into
mainfrom
chenghan.ying/storage-already-exists-metric

Conversation

@roychying

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.
  • The orchestrator maps a conflict to the new merge_conflict category, both in the land-conflict check 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.

Issue

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