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

lib/analyze.js

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/codeql.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/codeql.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/analyze.ts

Lines changed: 6 additions & 2 deletions
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

src/codeql.ts

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy