Add routing ChangeProvider#273
Merged
Merged
Conversation
…ispatch Add a routing ChangeProvider that classifies URIs by change type (GitHub, Phabricator, git) using the existing ParseChangeID functions, groups them by matched provider, calls each downstream provider once with its batch, and reassembles results in the original URI order. This avoids coupling the ChangeProvider interface to routing concerns while keeping URI-to-provider matching encapsulated within the routing package — callers configure which providers are available, but never touch parse logic. Update the example orchestrator to use the routing provider with both GitHub and Phabricator backends, falling back to the fake provider only when neither token is configured. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
behinddwalls
approved these changes
Jun 25, 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
When SubmitQueue wants to support multiple code-review systems, we'll need multiple ChangeProviders, but we don't have a clean way to choose which ChangeProvider to use for a given change URI. I'm adding a routing ChangeProvider, which contains all change providers the server wants to support. The caller can optionally inject as many underlying ChangeProviders as they want, and call the routing ChangeProvider's Get function without worrying about change type. It matches each change URI to the correct ChangeProvider, using the existing
ParseChangeIDfunctions that each type of change already exports, and calls the respective Get function to fetch change info. This means each caller of a ChangeProvider doesn't need to maintain logic for choosing which ChangeProvider to use.I also updated the example main file to use a routing ChangeProvider, containing underlying GitHub and Phabricator providers, where we were previously only using GitHub.
Test Plan
Issue Links