-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Go: Support git_source
#20368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Go: Support git_source
#20368
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for git_source
type registry configurations in the Go extractor's proxy handling functionality. The change extends the existing registry proxy system to handle Git sources alongside the existing goproxy server support.
- Adds
git_source
type support to registry configurations - Updates proxy environment variable handling to process Git sources
- Adds comprehensive test coverage for multiple registry configurations
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
go/extractor/util/registryproxy.go | Adds git_source constant, refactors data structures to separate goproxy servers and Git sources, and updates environment variable handling logic |
go/extractor/util/registryproxy_test.go | Adds new test function to verify parsing of multiple registry configurations including both git_source and goproxy_server types |
82f29ab
to
baad5dd
Compare
baad5dd
to
7be30e2
Compare
Since `GOPRIVATE` / `GONOPROXY` expect a glob pattern
7be30e2
to
0ffc9fc
Compare
This PR modifies the Go autobuilder/extractor to support
git_source
private registry configurations, in addition to thegoproxy_server
configurations that were already supported.In github/codeql-action#3079, we modified the CodeQL Action so that
git_source
configurations are now propagated to the Go autobuilder/extractor.With the changes in this PR, if a
git_source
configuration is provided, we setGOPRIVATE
to include a pattern for the hostname provided in the configuration. TheGOPRIVATE
variable instructsgo
which packages should not be fetched via aGOPROXY
(whether it's the default one or a custom one). For example, if thegit_source
configuration is forhttps://github.com/foo
, then we'd setGOPRIVATE=github.com/foo*
.This is a simplification of what is necessary for
GOPRIVATE
, because Go modules may not have the same name as the address of the repository that contains them. Ideally, we would makeGOPRIVATE
configurable somehow, possibly using ago.env
file in the repository or similar. However, for initially supporting this, the behaviour here should be sufficient.If a
git_source
is configured, we also configuregit
on the runner to use the self-signed proxy certificate. Otherwise, it will refuse to connect.