Add a debug log message when forcing the latest tools

This commit is contained in:
Henry Mercer
2022-08-17 12:33:58 +01:00
parent 416ad3d847
commit f47f573e6e
3 changed files with 29 additions and 17 deletions

View File

@@ -431,17 +431,24 @@ export async function setupCodeQL(
checkVersion: boolean
): Promise<{ codeql: CodeQL; toolsVersion: string }> {
try {
const forceLatest =
const forceLatestReason =
// We use the special value of 'latest' to prioritize the version in the
// defaults over any pinned cached version.
codeqlURL === "latest" ||
// If the user hasn't requested a particular CodeQL version, then bypass
// the toolcache when the appropriate feature flag is enabled. This
// allows us to quickly rollback a broken bundle that has made its way
// into the toolcache.
(codeqlURL === undefined &&
(await featureFlags.getValue(FeatureFlag.BypassToolcacheEnabled)));
codeqlURL === "latest"
? '"tools: latest" was requested'
: // If the user hasn't requested a particular CodeQL version, then bypass
// the toolcache when the appropriate feature flag is enabled. This
// allows us to quickly rollback a broken bundle that has made its way
// into the toolcache.
codeqlURL === undefined &&
(await featureFlags.getValue(FeatureFlag.BypassToolcacheEnabled))
? "a specific version of CodeQL was not requested, and the bypass toolcache feature flag is enabled"
: undefined;
const forceLatest = forceLatestReason !== undefined;
if (forceLatest) {
logger.debug(
`Forcing the latest version of the CodeQL tools since ${forceLatestReason}.`
);
codeqlURL = undefined;
}
let codeqlFolder: string;