Skip to content

Commit 3d7016f

Browse files
committed
Log more in getProxyBinaryPath
1 parent 06bd6e2 commit 3d7016f

2 files changed

Lines changed: 67 additions & 34 deletions

File tree

‎lib/entry-points.js‎

Lines changed: 30 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/start-proxy.ts‎

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -537,24 +537,44 @@ export async function getProxyBinaryPath(
537537
apiDetails: GitHubApiDetails,
538538
): Promise<string> {
539539
const logger = action.logger;
540-
const proxyFileName = getProxyFilename();
541-
const proxyInfo = await getDownloadUrl(action, apiDetails);
540+
logger.startGroup("Setting up authentication proxy");
542541

543-
let proxyBin = toolcache.find(proxyFileName, proxyInfo.version);
544-
if (!proxyBin) {
545-
const authorization = getAuthorizationHeaderFor(
546-
logger,
547-
apiDetails,
548-
proxyInfo.url,
549-
);
550-
const temp = await downloadProxy(logger, proxyInfo.url, authorization);
551-
const extracted = await extractProxy(logger, temp);
552-
proxyBin = await cacheProxy(
553-
logger,
554-
extracted,
555-
proxyFileName,
556-
proxyInfo.version,
542+
try {
543+
const proxyFileName = getProxyFilename();
544+
const proxyInfo = await getDownloadUrl(action, apiDetails);
545+
546+
logger.info(
547+
`Using authentication proxy from CodeQL release ${proxyInfo.version}.`,
557548
);
549+
550+
let proxyBin = toolcache.find(proxyFileName, proxyInfo.version);
551+
552+
if (!proxyBin) {
553+
logger.info(
554+
`Authentication proxy is not in the toolcache. Will try to download it from '${proxyInfo.url}'.`,
555+
);
556+
557+
const authorization = getAuthorizationHeaderFor(
558+
logger,
559+
apiDetails,
560+
proxyInfo.url,
561+
);
562+
const temp = await downloadProxy(logger, proxyInfo.url, authorization);
563+
564+
logger.info(`Downloaded the authentication proxy assset to '${temp}'.`);
565+
566+
const extracted = await extractProxy(logger, temp);
567+
proxyBin = await cacheProxy(
568+
logger,
569+
extracted,
570+
proxyFileName,
571+
proxyInfo.version,
572+
);
573+
574+
logger.info(`Extracted the authentication proxy to '${proxyBin}'.`);
575+
}
576+
return path.join(proxyBin, proxyFileName);
577+
} finally {
578+
logger.endGroup();
558579
}
559-
return path.join(proxyBin, proxyFileName);
560580
}

0 commit comments

Comments
 (0)