Skip to content

Commit 30b30d6

Browse files
committed
Emit the new diagnostic
1 parent 6d67e41 commit 30b30d6

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

go/extractor/registries/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/extractor/registries/registryproxy.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import (
88
"os"
99
"os/exec"
1010
"strings"
11+
12+
"github.com/github/codeql-go/extractor/diagnostics"
1113
)
1214

1315
const PROXY_HOST = "CODEQL_PROXY_HOST"
@@ -132,6 +134,18 @@ func getEnvVars() []string {
132134
}
133135
}
134136

137+
// Emit a diagnostic to make it easy for users to see that private registry
138+
// configurations were picked up by the Go analysis.
139+
if len(activeConfigs) > 0 {
140+
prettyConfigs := []string{}
141+
for i := range activeConfigs {
142+
prettyConfigs = append(prettyConfigs, activeConfigs[i].Pretty())
143+
}
144+
145+
diagnostics.EmitPrivateRegistryUsed(diagnostics.DefaultWriter, prettyConfigs)
146+
}
147+
148+
// Assemble environment variables for Go.
135149
goprivate := []string{}
136150

137151
if len(goproxy_servers) > 0 {

0 commit comments

Comments
 (0)