Log more in getProxyBinaryPath

This commit is contained in:
Michael B. Gale
2026-10-12 15:39:38 +01:00
parent 06bd6e2f9d
commit 3d7016f514
2 changed files with 67 additions and 34 deletions

47
lib/entry-points.js generated
View File

@@ -187759,25 +187759,38 @@ function getProxyFilename() {
}
async function getProxyBinaryPath(action, apiDetails) {
const logger2 = action.logger;
const proxyFileName = getProxyFilename();
const proxyInfo = await getDownloadUrl(action, apiDetails);
let proxyBin = toolcache4.find(proxyFileName, proxyInfo.version);
if (!proxyBin) {
const authorization = getAuthorizationHeaderFor(
logger2,
apiDetails,
proxyInfo.url
);
const temp = await downloadProxy(logger2, proxyInfo.url, authorization);
const extracted = await extractProxy(logger2, temp);
proxyBin = await cacheProxy(
logger2,
extracted,
proxyFileName,
proxyInfo.version
logger2.startGroup("Setting up authentication proxy");
try {
const proxyFileName = getProxyFilename();
const proxyInfo = await getDownloadUrl(action, apiDetails);
logger2.info(
`Using authentication proxy from CodeQL release ${proxyInfo.version}.`
);
let proxyBin = toolcache4.find(proxyFileName, proxyInfo.version);
if (!proxyBin) {
logger2.info(
`Authentication proxy is not in the toolcache. Will try to download it from '${proxyInfo.url}'.`
);
const authorization = getAuthorizationHeaderFor(
logger2,
apiDetails,
proxyInfo.url
);
const temp = await downloadProxy(logger2, proxyInfo.url, authorization);
logger2.info(`Downloaded the authentication proxy assset to '${temp}'.`);
const extracted = await extractProxy(logger2, temp);
proxyBin = await cacheProxy(
logger2,
extracted,
proxyFileName,
proxyInfo.version
);
logger2.info(`Extracted the authentication proxy to '${proxyBin}'.`);
}
return path27.join(proxyBin, proxyFileName);
} finally {
logger2.endGroup();
}
return path27.join(proxyBin, proxyFileName);
}
// src/start-proxy/ca.ts

View File

@@ -537,24 +537,44 @@ export async function getProxyBinaryPath(
apiDetails: GitHubApiDetails,
): Promise<string> {
const logger = action.logger;
const proxyFileName = getProxyFilename();
const proxyInfo = await getDownloadUrl(action, apiDetails);
logger.startGroup("Setting up authentication proxy");
let proxyBin = toolcache.find(proxyFileName, proxyInfo.version);
if (!proxyBin) {
const authorization = getAuthorizationHeaderFor(
logger,
apiDetails,
proxyInfo.url,
);
const temp = await downloadProxy(logger, proxyInfo.url, authorization);
const extracted = await extractProxy(logger, temp);
proxyBin = await cacheProxy(
logger,
extracted,
proxyFileName,
proxyInfo.version,
try {
const proxyFileName = getProxyFilename();
const proxyInfo = await getDownloadUrl(action, apiDetails);
logger.info(
`Using authentication proxy from CodeQL release ${proxyInfo.version}.`,
);
let proxyBin = toolcache.find(proxyFileName, proxyInfo.version);
if (!proxyBin) {
logger.info(
`Authentication proxy is not in the toolcache. Will try to download it from '${proxyInfo.url}'.`,
);
const authorization = getAuthorizationHeaderFor(
logger,
apiDetails,
proxyInfo.url,
);
const temp = await downloadProxy(logger, proxyInfo.url, authorization);
logger.info(`Downloaded the authentication proxy assset to '${temp}'.`);
const extracted = await extractProxy(logger, temp);
proxyBin = await cacheProxy(
logger,
extracted,
proxyFileName,
proxyInfo.version,
);
logger.info(`Extracted the authentication proxy to '${proxyBin}'.`);
}
return path.join(proxyBin, proxyFileName);
} finally {
logger.endGroup();
}
return path.join(proxyBin, proxyFileName);
}