Skip to content

Commit 6e57bba

Browse files
Merge pull request #998 from github/edoardo/no-download-pack
Don't download packs when it isn't needed
2 parents df16470 + 85cfdb2 commit 6e57bba

File tree

6 files changed

+17
-12
lines changed

6 files changed

+17
-12
lines changed

Diff for: lib/analyze.js

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: lib/analyze.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: lib/codeql.js

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: lib/codeql.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: src/analyze.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import * as yaml from "js-yaml";
66

77
import * as analysisPaths from "./analysis-paths";
88
import {
9+
CODEQL_VERSION_CONFIG_FILES,
910
CODEQL_VERSION_COUNTS_LINES,
1011
CODEQL_VERSION_NEW_TRACING,
1112
getCodeQL,
@@ -235,12 +236,15 @@ export async function runQueries(
235236
);
236237
}
237238

239+
const codeql = await getCodeQL(config.codeQLCmd);
238240
try {
239-
if (hasPackWithCustomQueries) {
241+
if (
242+
hasPackWithCustomQueries &&
243+
!(await util.codeQlVersionAbove(codeql, CODEQL_VERSION_CONFIG_FILES))
244+
) {
240245
logger.info("Performing analysis with custom CodeQL Packs.");
241246
logger.startGroup(`Downloading custom packs for ${language}`);
242247

243-
const codeql = await getCodeQL(config.codeQLCmd);
244248
const results = await codeql.packDownload(packsWithVersion);
245249
logger.info(
246250
`Downloaded packs: ${results.packs

Diff for: src/codeql.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ const CODEQL_VERSION_GROUP_RULES = "2.5.5";
220220
const CODEQL_VERSION_SARIF_GROUP = "2.5.3";
221221
export const CODEQL_VERSION_COUNTS_LINES = "2.6.2";
222222
const CODEQL_VERSION_CUSTOM_QUERY_HELP = "2.7.1";
223-
const CODEQL_VERSION_CONFIG_FILES = "2.8.2"; // Versions before 2.8.2 weren't tolerant to unknown properties
223+
export const CODEQL_VERSION_CONFIG_FILES = "2.8.2"; // Versions before 2.8.2 weren't tolerant to unknown properties
224224
export const CODEQL_VERSION_ML_POWERED_QUERIES = "2.7.5";
225225

226226
/**

0 commit comments

Comments
 (0)