Repository navigation
Conversation
… before calling the API
This branch has not been deployed
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.
Why?
The GitHub change provider ignores the URI host and sends every request to its configured API. A URI naming another GitHub instance therefore fails with a misleading error ("could not resolve to a Repository" or "head SHA changed") instead of the validator's clear host rejection, which never runs because the validate stage calls the change provider first.
What?
Params.Hostis required, mirroring the GitHub validator'sParams.Host.NewProvidererrors when it is missing.validateChangeConsistencyrequires every URI to name that host before any API call, which also rejects a stack spanning hosts (previously only scheme, org and repo were compared).githubchange provider block gainshost, defaulting togithub.comlike the validator's.host.Breaking:
NewProvidernow returns(changeprovider.ChangeProvider, error), and callers must passHost.Test Plan
TestValidateChangeConsistency: new cases for a PR on another host, a stack spanning hosts, and a port the provider does not name.TestNewProvider: a missing host errors.TestProvider_Get: a wrong-host URI errors without any request reaching the server.bazel test //submitqueue/extension/changeprovider/... //service/submitqueue/orchestrator/...passes;make lintandmake check-gazellepass.Issue