Log disclaimer about connection tests, with link to docs

This commit is contained in:
Michael B. Gale
2026-04-28 13:16:24 +01:00
parent 30e0f4391d
commit 7a818e6977
4 changed files with 16 additions and 1 deletions

View File

@@ -122939,6 +122939,10 @@ var NetworkReachabilityBackend = class {
async function checkConnections(logger, proxy, backend) { async function checkConnections(logger, proxy, backend) {
const result = /* @__PURE__ */ new Set(); const result = /* @__PURE__ */ new Set();
if (proxy.registries.length === 0) return result; if (proxy.registries.length === 0) return result;
logger.startGroup("Testing connections via the proxy");
logger.info(
`The connection tests performed here are best-effort only and failures here may not affect the subsequent analysis. See ${"https://docs.github.com/en/code-security/reference/code-scanning/code-scanning-logs#diagnostic-information-for-private-package-registries" /* PRIVATE_REGISTRY_LOGS */} for more information.`
);
try { try {
if (backend === void 0) { if (backend === void 0) {
backend = new NetworkReachabilityBackend(proxy); backend = new NetworkReachabilityBackend(proxy);
@@ -122975,6 +122979,7 @@ async function checkConnections(logger, proxy, backend) {
`Failed to test connections to private registries: ${getErrorMessage(e)}` `Failed to test connections to private registries: ${getErrorMessage(e)}`
); );
} }
logger.endGroup();
return result; return result;
} }

View File

@@ -8,6 +8,7 @@ export enum DocUrl {
CODEQL_BUILD_MODES = "https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#codeql-build-modes", CODEQL_BUILD_MODES = "https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#codeql-build-modes",
DEFINE_ENV_VARIABLES = "https://docs.github.com/en/actions/learn-github-actions/variables#defining-environment-variables-for-a-single-workflow", DEFINE_ENV_VARIABLES = "https://docs.github.com/en/actions/learn-github-actions/variables#defining-environment-variables-for-a-single-workflow",
DELETE_ACTIONS_CACHE_ENTRIES = "https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manage-caches#deleting-cache-entries", DELETE_ACTIONS_CACHE_ENTRIES = "https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manage-caches#deleting-cache-entries",
PRIVATE_REGISTRY_LOGS = "https://docs.github.com/en/code-security/reference/code-scanning/code-scanning-logs#diagnostic-information-for-private-package-registries",
SCANNING_ON_PUSH = "https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#scanning-on-push", SCANNING_ON_PUSH = "https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#scanning-on-push",
SPECIFY_BUILD_STEPS_MANUALLY = "https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#about-specifying-build-steps-manually", SPECIFY_BUILD_STEPS_MANUALLY = "https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#about-specifying-build-steps-manually",
SYSTEM_REQUIREMENTS = "https://codeql.github.com/docs/codeql-overview/system-requirements/", SYSTEM_REQUIREMENTS = "https://codeql.github.com/docs/codeql-overview/system-requirements/",

View File

@@ -111,7 +111,7 @@ async function run(startedAt: Date) {
logger, logger,
); );
// Check that the private registries are reachable. // Perform best-effort checks that the private registries are reachable.
await checkConnections(logger, proxyInfo); await checkConnections(logger, proxyInfo);
// Report success if we have reached this point. // Report success if we have reached this point.

View File

@@ -2,6 +2,7 @@ import * as https from "https";
import { HttpsProxyAgent } from "https-proxy-agent"; import { HttpsProxyAgent } from "https-proxy-agent";
import { DocUrl } from "../doc-url";
import { Logger } from "../logging"; import { Logger } from "../logging";
import { getErrorMessage } from "../util"; import { getErrorMessage } from "../util";
@@ -114,6 +115,13 @@ export async function checkConnections(
// Don't do anything if there are no registries. // Don't do anything if there are no registries.
if (proxy.registries.length === 0) return result; if (proxy.registries.length === 0) return result;
// Start a log group and print a message with a disclaimer with a link to the
// relevant documentation that these checks are a best-effort process.
logger.startGroup("Testing connections via the proxy");
logger.info(
`The connection tests performed here are best-effort only and failures here may not affect the subsequent analysis. See ${DocUrl.PRIVATE_REGISTRY_LOGS} for more information.`,
);
try { try {
// Initialise a networking backend if no backend was provided. // Initialise a networking backend if no backend was provided.
if (backend === undefined) { if (backend === undefined) {
@@ -158,5 +166,6 @@ export async function checkConnections(
); );
} }
logger.endGroup();
return result; return result;
} }