Merge remote-tracking branch 'upstream/main' into aeisenberg/remove-queries
This commit is contained in:
commit
6db77eec0d
6 changed files with 54 additions and 5 deletions
6
lib/config-utils.test.js
generated
6
lib/config-utils.test.js
generated
|
|
@ -965,4 +965,10 @@ const mlPoweredQueriesMacro = ava_1.default.macro({
|
|||
(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.
|
||||
(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
|
||||
File diff suppressed because one or more lines are too long
10
lib/util.js
generated
10
lib/util.js
generated
|
|
@ -553,6 +553,7 @@ exports.ML_POWERED_JS_QUERIES_PACK_NAME = "codeql/javascript-experimental-atm-qu
|
|||
* queries beta.
|
||||
*/
|
||||
async function getMlPoweredJsQueriesPack(codeQL) {
|
||||
<<<<<<< HEAD
|
||||
const version = (await codeQlVersionAbove(codeQL, "2.8.4"))
|
||||
? "~0.2.0"
|
||||
: "~0.1.0";
|
||||
|
|
@ -560,6 +561,15 @@ async function getMlPoweredJsQueriesPack(codeQL) {
|
|||
name: exports.ML_POWERED_JS_QUERIES_PACK_NAME,
|
||||
version,
|
||||
});
|
||||
=======
|
||||
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.1.0`;
|
||||
>>>>>>> upstream/main
|
||||
}
|
||||
exports.getMlPoweredJsQueriesPack = getMlPoweredJsQueriesPack;
|
||||
/**
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1919,3 +1919,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"
|
||||
);
|
||||
|
|
|
|||
11
src/util.ts
11
src/util.ts
|
|
@ -668,9 +668,14 @@ export const ML_POWERED_JS_QUERIES_PACK_NAME =
|
|||
export async function getMlPoweredJsQueriesPack(
|
||||
codeQL: CodeQL
|
||||
): Promise<string> {
|
||||
const version = (await codeQlVersionAbove(codeQL, "2.8.4"))
|
||||
? "~0.2.0"
|
||||
: "~0.1.0";
|
||||
let version;
|
||||
if (await codeQlVersionAbove(codeQL, "2.9.3")) {
|
||||
version = `~0.3.0`;
|
||||
} else if (await codeQlVersionAbove(codeQL, "2.8.4")) {
|
||||
version = `~0.2.0`;
|
||||
} else {
|
||||
version = `~0.1.0`;
|
||||
}
|
||||
return prettyPrintPack({
|
||||
name: ML_POWERED_JS_QUERIES_PACK_NAME,
|
||||
version,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue