Skip to content

feat(conflict): Add Tango request and signature intersection - #884

Open
manjari25 wants to merge 4 commits into
manjari/tango-signature-cachefrom
manjari/tango-analyzer-request
Open

manjari25 wants to merge 4 commits into
manjari/tango-signature-cachefrom
manjari/tango-analyzer-request

Conversation

@manjari25

@manjari25 manjari25 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Why?

The Tango-backed conflict analyzer needs three building blocks that don't depend on how it is wired: the interfaces for the two things a deployment supplies, the request it sends to Tango, and the check that decides whether two signatures conflict. This PR adds them separately so the interface shapes can be reviewed before the analyzer uses them.

What?

Everything is added under submitqueue/extension/conflict/tango:

  • Adds ChangedTargetsRequest: the remote, the base revision, every change URI in batch order, and the merge strategy.
  • Adds ChangedTargetsClient, which returns the affected targets of a request as label and distance pairs. A deployment supplies an adapter that owns the Tango client and its stream, collects the response and resolves each target's label. Any failure to produce a complete answer is an error, and an empty result is valid.
  • Adds Base and BaseResolver: how the analyzer learns the newest revision of a queue's target branch. A deployment supplies the implementation.
  • Adds changedTargetsRequestFor, which flattens the URIs of a batch's changes, in order, into a request.
  • Adds sharesTarget, which reports whether two signatures have a target ID in common. Both must be sorted by ID, so the check is one pass over each, and it stops at the first shared ID.
  • Adds gomock mocks for the two interfaces, generated in the same package.
  • Nothing calls this code yet. The analyzer that uses it is the next PR in this stack.
  • Tests cover flattening of multiple changes with multiple URIs, an empty change list, and intersection with empty inputs, shared first, middle and last IDs, different lengths, IDs above the signed range (checking they order as unsigned), and distance being ignored.

Test Plan

./tool/bazel test //submitqueue/extension/conflict/tango/...
go test -race ./submitqueue/extension/conflict/tango/
make check-gazelle
make check-mocks
make lint
CI

Issue

@manjari25
manjari25 added this pull request to stack #883 October 16, 2026 20:34
@manjari25
manjari25 force-pushed the manjari/tango-analyzer-request branch from aed8b60 to 0f34932 Compare October 16, 2026 22:07
@manjari25
manjari25 marked this pull request as ready for review October 16, 2026 22:36
@manjari25
manjari25 requested review from a team, behinddwalls and sbalabanov as code owners October 16, 2026 22:36

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