GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Go: Support `git_source` by mbg · Pull Request #20368 · github/codeql

Conversation

@mbg

@mbg mbg commented Sep 4, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Copilot AI review requested due to automatic review settings September 4, 2025 14:53
@github-actions github-actions Bot added the Go label Sep 4, 2025
Copilot AI reviewed Sep 4, 2025
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread go/extractor/util/registryproxy_test.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mbg
mbg force-pushed the mbg/go/support-git-source branch 4 times, most recently from 82f29ab to baad5dd Compare September 8, 2025 09:27
@mbg
mbg force-pushed the mbg/go/support-git-source branch 2 times, most recently from 7be30e2 to 0ffc9fc Compare September 15, 2025 15:09
@mbg
mbg marked this pull request as ready for review September 15, 2025 15:09
@mbg
mbg requested a review from a team as a code owner September 15, 2025 15:09
owen-mc
owen-mc approved these changes Sep 16, 2025
View reviewed changes

@owen-mc owen-mc left a comment

Copy link
Copy Markdown
Contributor

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.

Looks sensible.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
mbg added 7 commits September 24, 2025 15:51
@mbg
Improve logging to include proxy vars
711d497
@mbg
Set lower-case variants of HTTP_PROXY and HTTPS_PROXY
23a0461
@mbg
Rename proxy_configs to goproxy_servers and only store URLs
895399f
@mbg
Use git_source configurations for GOPRIVATE
a8fa1a7
@mbg
Append * to git_source URL if not present
4ef8ff9
Since `GOPRIVATE` / `GONOPROXY` expect a glob pattern
@mbg
Convert URLs to expected format
bc38b79
@mbg
Configure git to use the certificate, if needed
8c84992
@mbg
mbg force-pushed the mbg/go/support-git-source branch from 0ffc9fc to 8c84992 Compare September 24, 2025 14:52
@mbg
mbg merged commit fd6f9cd into main Sep 24, 2025
@mbg
mbg deleted the mbg/go/support-git-source branch September 24, 2025 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@owen-mc owen-mc owen-mc approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

Go

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@mbg @owen-mc
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.