Skip to content

Commit

Permalink
Merge pull request #1087 from github/tombolton/update-ml-pack
Browse files Browse the repository at this point in the history
Run ML-powered query pack `~0.3.0` on v2.9.3+ of the CLI
  • Loading branch information
TomBolton committed Jun 15, 2022
2 parents 81b419c + a27dc4f commit df05122
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 4 deletions.
6 changes: 6 additions & 0 deletions lib/config-utils.test.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/config-utils.test.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion lib/util.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/util.js.map

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions src/config-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1865,3 +1865,23 @@ test(
"security-and-quality",
"0.0.1"
);
// Test that ML-powered queries are run on all platforms running `security-extended` on CodeQL
// CLI 2.9.3+.
test(
mlPoweredQueriesMacro,
"2.9.3",
true,
undefined,
"security-extended",
"~0.3.0"
);
// Test that ML-powered queries are run on all platforms running `security-and-quality` on CodeQL
// CLI 2.9.3+.
test(
mlPoweredQueriesMacro,
"2.9.3",
true,
undefined,
"security-and-quality",
"~0.3.0"
);
4 changes: 3 additions & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,9 @@ export const ML_POWERED_JS_QUERIES_PACK_NAME =
export async function getMlPoweredJsQueriesPack(
codeQL: CodeQL
): Promise<string> {
if (await codeQlVersionAbove(codeQL, "2.8.4")) {
if (await codeQlVersionAbove(codeQL, "2.9.3")) {
return `${ML_POWERED_JS_QUERIES_PACK_NAME}@~0.3.0`;
} else if (await codeQlVersionAbove(codeQL, "2.8.4")) {
return `${ML_POWERED_JS_QUERIES_PACK_NAME}@~0.2.0`;
}
return `${ML_POWERED_JS_QUERIES_PACK_NAME}@~0.1.0`;
Expand Down

0 comments on commit df05122

Please sign in to comment.