Skip to content

Commit

Permalink
Merge pull request #998 from github/edoardo/no-download-pack
Browse files Browse the repository at this point in the history
Don't download packs when it isn't needed
  • Loading branch information
edoardopirovano authored Mar 25, 2022
2 parents df16470 + 85cfdb2 commit 6e57bba
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 12 deletions.
5 changes: 3 additions & 2 deletions lib/analyze.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/analyze.js.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions lib/codeql.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/codeql.js.map

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions src/analyze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/codeql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/**
Expand Down

0 comments on commit 6e57bba

Please sign in to comment.