From 30b30d65c832a2a14a7f64834f532156d4e223c0 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Mon, 2 Feb 2026 14:47:25 +0000 Subject: [PATCH] Emit the new diagnostic --- go/extractor/registries/BUILD.bazel | 1 + go/extractor/registries/registryproxy.go | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/go/extractor/registries/BUILD.bazel b/go/extractor/registries/BUILD.bazel index 8c002f20db2..7947556ee5d 100644 --- a/go/extractor/registries/BUILD.bazel +++ b/go/extractor/registries/BUILD.bazel @@ -7,6 +7,7 @@ go_library( srcs = ["registryproxy.go"], importpath = "github.com/github/codeql-go/extractor/registries", visibility = ["//visibility:public"], + deps = ["//go/extractor/diagnostics"], ) go_test( diff --git a/go/extractor/registries/registryproxy.go b/go/extractor/registries/registryproxy.go index 793bec5a41d..1bb5995e27a 100644 --- a/go/extractor/registries/registryproxy.go +++ b/go/extractor/registries/registryproxy.go @@ -8,6 +8,8 @@ import ( "os" "os/exec" "strings" + + "github.com/github/codeql-go/extractor/diagnostics" ) const PROXY_HOST = "CODEQL_PROXY_HOST" @@ -132,6 +134,18 @@ func getEnvVars() []string { } } + // Emit a diagnostic to make it easy for users to see that private registry + // configurations were picked up by the Go analysis. + if len(activeConfigs) > 0 { + prettyConfigs := []string{} + for i := range activeConfigs { + prettyConfigs = append(prettyConfigs, activeConfigs[i].Pretty()) + } + + diagnostics.EmitPrivateRegistryUsed(diagnostics.DefaultWriter, prettyConfigs) + } + + // Assemble environment variables for Go. goprivate := []string{} if len(goproxy_servers) > 0 {