Don't download packs when it isn't needed

This commit is contained in:
Edoardo Pirovano
2022-03-25 11:15:02 +00:00
parent df164705ad
commit 85cfdb24f4
6 changed files with 17 additions and 12 deletions

View File

@@ -6,6 +6,7 @@ import * as yaml from "js-yaml";
import * as analysisPaths from "./analysis-paths";
import {
CODEQL_VERSION_CONFIG_FILES,
CODEQL_VERSION_COUNTS_LINES,
CODEQL_VERSION_NEW_TRACING,
getCodeQL,
@@ -235,12 +236,15 @@ export async function runQueries(
);
}
const codeql = await getCodeQL(config.codeQLCmd);
try {
if (hasPackWithCustomQueries) {
if (
hasPackWithCustomQueries &&
!(await util.codeQlVersionAbove(codeql, CODEQL_VERSION_CONFIG_FILES))
) {
logger.info("Performing analysis with custom CodeQL Packs.");
logger.startGroup(`Downloading custom packs for ${language}`);
const codeql = await getCodeQL(config.codeQLCmd);
const results = await codeql.packDownload(packsWithVersion);
logger.info(
`Downloaded packs: ${results.packs

View File

@@ -220,7 +220,7 @@ const CODEQL_VERSION_GROUP_RULES = "2.5.5";
const CODEQL_VERSION_SARIF_GROUP = "2.5.3";
export const CODEQL_VERSION_COUNTS_LINES = "2.6.2";
const CODEQL_VERSION_CUSTOM_QUERY_HELP = "2.7.1";
const CODEQL_VERSION_CONFIG_FILES = "2.8.2"; // Versions before 2.8.2 weren't tolerant to unknown properties
export const CODEQL_VERSION_CONFIG_FILES = "2.8.2"; // Versions before 2.8.2 weren't tolerant to unknown properties
export const CODEQL_VERSION_ML_POWERED_QUERIES = "2.7.5";
/**