mirror of
https://github.com/github/codeql-action.git
synced 2026-05-04 12:50:14 +00:00
Do not attempt to install zstd bundles yet
We will revert this commit and add a version check once the first stable release with an zstd bundle is available.
This commit is contained in:
Generated
+2
-20
@@ -48,7 +48,6 @@ const api = __importStar(require("./api-client"));
|
||||
// creation scripts. Ensure that any changes to the format of this file are compatible with both of
|
||||
// these dependents.
|
||||
const defaults = __importStar(require("./defaults.json"));
|
||||
const feature_flags_1 = require("./feature-flags");
|
||||
const tar = __importStar(require("./tar"));
|
||||
const util = __importStar(require("./util"));
|
||||
const util_1 = require("./util");
|
||||
@@ -508,27 +507,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 zstdError = undefined;
|
||||
async function setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, _features, logger) {
|
||||
const availableResult = await tar.isZstdAvailable(logger);
|
||||
if (!toolsInput && (await features.getValue(feature_flags_1.Feature.ZstdBundle))) {
|
||||
try {
|
||||
if (availableResult.available) {
|
||||
return await setupCodeQLBundleWithZstdOption(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, true, logger);
|
||||
}
|
||||
else {
|
||||
logger.debug("Falling back to bundle compressed using gzip because the available version of tar was not " +
|
||||
"recognized or is too old.");
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
logger.info("Failed to set up bundle compressed using zstd, falling back to bundle compressed using gzip.");
|
||||
logger.debug(`Underlying error: ${e}`);
|
||||
zstdError = e;
|
||||
}
|
||||
}
|
||||
const result = await setupCodeQLBundleWithZstdOption(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, false, logger);
|
||||
result.toolsDownloadStatusReport = Object.assign({}, result.toolsDownloadStatusReport, { tarVersion: availableResult.version }, zstdError ? { zstdError: (0, util_1.wrapError)(zstdError).message } : {});
|
||||
result.toolsDownloadStatusReport = Object.assign({}, result.toolsDownloadStatusReport, { tarVersion: availableResult.version });
|
||||
return result;
|
||||
}
|
||||
async function cleanUpGlob(glob, name, logger) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
+3
-38
@@ -15,15 +15,11 @@ import * as api from "./api-client";
|
||||
// creation scripts. Ensure that any changes to the format of this file are compatible with both of
|
||||
// these dependents.
|
||||
import * as defaults from "./defaults.json";
|
||||
import {
|
||||
CodeQLDefaultVersionInfo,
|
||||
Feature,
|
||||
FeatureEnablement,
|
||||
} from "./feature-flags";
|
||||
import { CodeQLDefaultVersionInfo, FeatureEnablement } from "./feature-flags";
|
||||
import { Logger } from "./logging";
|
||||
import * as tar from "./tar";
|
||||
import * as util from "./util";
|
||||
import { isGoodVersion, wrapError } from "./util";
|
||||
import { isGoodVersion } from "./util";
|
||||
|
||||
export enum ToolsSource {
|
||||
Unknown = "UNKNOWN",
|
||||
@@ -717,40 +713,10 @@ export async function setupCodeQLBundle(
|
||||
tempDir: string,
|
||||
variant: util.GitHubVariant,
|
||||
defaultCliVersion: CodeQLDefaultVersionInfo,
|
||||
features: FeatureEnablement,
|
||||
_features: FeatureEnablement,
|
||||
logger: Logger,
|
||||
): Promise<SetupCodeQLResult> {
|
||||
let zstdError: unknown = undefined;
|
||||
|
||||
const availableResult = await tar.isZstdAvailable(logger);
|
||||
|
||||
if (!toolsInput && (await features.getValue(Feature.ZstdBundle))) {
|
||||
try {
|
||||
if (availableResult.available) {
|
||||
return await setupCodeQLBundleWithZstdOption(
|
||||
toolsInput,
|
||||
apiDetails,
|
||||
tempDir,
|
||||
variant,
|
||||
defaultCliVersion,
|
||||
true,
|
||||
logger,
|
||||
);
|
||||
} else {
|
||||
logger.debug(
|
||||
"Falling back to bundle compressed using gzip because the available version of tar was not " +
|
||||
"recognized or is too old.",
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
logger.info(
|
||||
"Failed to set up bundle compressed using zstd, falling back to bundle compressed using gzip.",
|
||||
);
|
||||
logger.debug(`Underlying error: ${e}`);
|
||||
zstdError = e;
|
||||
}
|
||||
}
|
||||
|
||||
const result = await setupCodeQLBundleWithZstdOption(
|
||||
toolsInput,
|
||||
apiDetails,
|
||||
@@ -765,7 +731,6 @@ export async function setupCodeQLBundle(
|
||||
{},
|
||||
result.toolsDownloadStatusReport,
|
||||
{ tarVersion: availableResult.version },
|
||||
zstdError ? { zstdError: wrapError(zstdError).message } : {},
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user