Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run ML-powered query pack ~0.3.0 on v2.9.3+ of the CLI #1087

Merged
merged 5 commits into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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