Go: Add diagnostic for private registry usage#21252
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a Go extractor diagnostic that surfaces detected private registry usage on the Tool Status Page, and refactors the proxy/registry helpers into a dedicated package.
Changes:
- Move the registry proxy logic from
utilinto a newregistriespackage and update the toolchain to use it. - Emit a new diagnostic when Go-relevant private registry configurations are detected.
- Add/adjust tests to cover the new diagnostic behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| go/extractor/util/BUILD.bazel | Removes the registry proxy sources/tests from util after the move. |
| go/extractor/toolchain/toolchain.go | Switches GoCommand to apply proxy env vars via the new registries package. |
| go/extractor/toolchain/BUILD.bazel | Adds Bazel dependency on //go/extractor/registries. |
| go/extractor/registries/registryproxy.go | Hosts proxy env-var parsing and now emits the private-registry diagnostic. |
| go/extractor/registries/registryproxy_test.go | Updates test package name to registries after the move. |
| go/extractor/registries/BUILD.bazel | Introduces Bazel targets for the new registries package and its tests. |
| go/extractor/diagnostics/diagnostics.go | Adds EmitPrivateRegistryUsed diagnostic emitter. |
| go/extractor/diagnostics/diagnostics_test.go | Adds a unit test for EmitPrivateRegistryUsed. |
owen-mc
previously approved these changes
Feb 3, 2026
Contributor
owen-mc
left a comment
There was a problem hiding this comment.
Two very minor nits about efficiency, which only really matter if you expect the slices to be long.
owen-mc
previously approved these changes
Feb 3, 2026
Contributor
owen-mc
left a comment
There was a problem hiding this comment.
LGTM (pending tests passing - it's possible my suggestions don't compile or something)
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
d238988 to
d5c4a19
Compare
owen-mc
approved these changes
Feb 3, 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.
This PR adds a new diagnostic for when the Go extractor successfully discovers private registries. The goal of this is to make this easy to see on the Tool Status Page, rather than requiring users to follow the process in https://docs.github.com/en/code-security/how-tos/view-and-interpret-data/viewing-code-scanning-logs#determining-whether-code-scanning-default-setup-used-any-private-registries