Merge pull request #1087 from github/tombolton/update-ml-pack
Run ML-powered query pack `~0.3.0` on v2.9.3+ of the CLI
This commit is contained in:
commit
df05122fc6
6 changed files with 35 additions and 4 deletions
6
lib/config-utils.test.js
generated
6
lib/config-utils.test.js
generated
|
|
@ -925,4 +925,10 @@ const mlPoweredQueriesMacro = ava_1.default.macro({
|
||||||
(0, ava_1.default)(mlPoweredQueriesMacro, "2.9.0", true, undefined, "security-and-quality", "~0.2.0");
|
(0, ava_1.default)(mlPoweredQueriesMacro, "2.9.0", true, undefined, "security-and-quality", "~0.2.0");
|
||||||
// Test that we don't inject an ML-powered query pack if the user has already specified one.
|
// Test that we don't inject an ML-powered query pack if the user has already specified one.
|
||||||
(0, ava_1.default)(mlPoweredQueriesMacro, "2.9.0", true, "codeql/javascript-experimental-atm-queries@0.0.1", "security-and-quality", "0.0.1");
|
(0, ava_1.default)(mlPoweredQueriesMacro, "2.9.0", true, "codeql/javascript-experimental-atm-queries@0.0.1", "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+.
|
||||||
|
(0, ava_1.default)(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+.
|
||||||
|
(0, ava_1.default)(mlPoweredQueriesMacro, "2.9.3", true, undefined, "security-and-quality", "~0.3.0");
|
||||||
//# sourceMappingURL=config-utils.test.js.map
|
//# sourceMappingURL=config-utils.test.js.map
|
||||||
File diff suppressed because one or more lines are too long
5
lib/util.js
generated
5
lib/util.js
generated
|
|
@ -552,7 +552,10 @@ exports.ML_POWERED_JS_QUERIES_PACK_NAME = "codeql/javascript-experimental-atm-qu
|
||||||
* queries beta.
|
* queries beta.
|
||||||
*/
|
*/
|
||||||
async function getMlPoweredJsQueriesPack(codeQL) {
|
async function getMlPoweredJsQueriesPack(codeQL) {
|
||||||
if (await codeQlVersionAbove(codeQL, "2.8.4")) {
|
if (await codeQlVersionAbove(codeQL, "2.9.3")) {
|
||||||
|
return `${exports.ML_POWERED_JS_QUERIES_PACK_NAME}@~0.3.0`;
|
||||||
|
}
|
||||||
|
else if (await codeQlVersionAbove(codeQL, "2.8.4")) {
|
||||||
return `${exports.ML_POWERED_JS_QUERIES_PACK_NAME}@~0.2.0`;
|
return `${exports.ML_POWERED_JS_QUERIES_PACK_NAME}@~0.2.0`;
|
||||||
}
|
}
|
||||||
return `${exports.ML_POWERED_JS_QUERIES_PACK_NAME}@~0.1.0`;
|
return `${exports.ML_POWERED_JS_QUERIES_PACK_NAME}@~0.1.0`;
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1865,3 +1865,23 @@ test(
|
||||||
"security-and-quality",
|
"security-and-quality",
|
||||||
"0.0.1"
|
"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"
|
||||||
|
);
|
||||||
|
|
|
||||||
|
|
@ -664,7 +664,9 @@ export const ML_POWERED_JS_QUERIES_PACK_NAME =
|
||||||
export async function getMlPoweredJsQueriesPack(
|
export async function getMlPoweredJsQueriesPack(
|
||||||
codeQL: CodeQL
|
codeQL: CodeQL
|
||||||
): Promise<string> {
|
): 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.2.0`;
|
||||||
}
|
}
|
||||||
return `${ML_POWERED_JS_QUERIES_PACK_NAME}@~0.1.0`;
|
return `${ML_POWERED_JS_QUERIES_PACK_NAME}@~0.1.0`;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue