| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
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.
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 |
Sorry, something went wrong.
There was a problem hiding this comment.
Looks sensible.
Sorry, something went wrong.
Since `GOPRIVATE` / `GONOPROXY` expect a glob pattern
| Back | FazBrowse Home | New Git URL |
This PR modifies the Go autobuilder/extractor to support git_source private registry configurations, in addition to the goproxy_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 set GOPRIVATE to include a pattern for the hostname provided in the configuration. The GOPRIVATE variable instructs go which packages should not be fetched via a GOPROXY (whether it's the default one or a custom one). For example, if the git_source configuration is for https://github.com/foo, then we'd set GOPRIVATE=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 make GOPRIVATE configurable somehow, possibly using a go.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 configure git on the runner to use the self-signed proxy certificate. Otherwise, it will refuse to connect.