Always capture tar version info

This lets us validate how well tar.zstd rollout will go before 2.19.0.
This commit is contained in:
Henry Mercer
2024-08-23 16:26:36 +01:00
parent e621ea8332
commit 73da3732dc
3 changed files with 6 additions and 9 deletions

6
lib/setup-codeql.js generated
View File

@@ -509,12 +509,10 @@ async function setupCodeQLBundleWithZstdOption(toolsInput, apiDetails, tempDir,
* @returns the path to the extracted bundle, and the version of the tools
*/
async function setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, features, logger) {
let tarVersion = undefined;
let zstdError = undefined;
const availableResult = await tar.isZstdAvailable(logger);
if (!toolsInput && (await features.getValue(feature_flags_1.Feature.ZstdBundle))) {
try {
const availableResult = await tar.isZstdAvailable(logger);
tarVersion = availableResult.version;
if (availableResult.available) {
return await setupCodeQLBundleWithZstdOption(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, true, logger);
}
@@ -530,7 +528,7 @@ async function setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, defau
}
}
const result = await setupCodeQLBundleWithZstdOption(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, false, logger);
result.toolsDownloadStatusReport = Object.assign({}, result.toolsDownloadStatusReport, tarVersion ? { tarVersion } : {}, zstdError ? { zstdError: (0, util_1.wrapError)(zstdError).message } : {});
result.toolsDownloadStatusReport = Object.assign({}, result.toolsDownloadStatusReport, { tarVersion: availableResult.version }, zstdError ? { zstdError: (0, util_1.wrapError)(zstdError).message } : {});
return result;
}
async function cleanUpGlob(glob, name, logger) {