Emit the new diagnostic

This commit is contained in:
Michael B. Gale
2026-02-02 14:47:25 +00:00
parent 6d67e419ff
commit 30b30d65c8
2 changed files with 15 additions and 0 deletions

View File

@@ -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(

View File

@@ -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 {