mirror of
https://github.com/github/codeql-action.git
synced 2025-12-27 17:50:07 +08:00
Merge branch 'main' into henrymercer/update-actions-major-versions
This commit is contained in:
@@ -1788,7 +1788,8 @@ const mlPoweredQueriesMacro = test.macro({
|
||||
}`,
|
||||
});
|
||||
|
||||
// macro, isMlPoweredQueriesFlagEnabled, packsInput, queriesInput, versionString
|
||||
// macro, codeQLVersion, isMlPoweredQueriesFlagEnabled, packsInput, queriesInput, expectedVersionString
|
||||
// Test that ML-powered queries aren't run on v2.7.4 of the CLI.
|
||||
test(
|
||||
mlPoweredQueriesMacro,
|
||||
"2.7.4",
|
||||
@@ -1797,6 +1798,7 @@ test(
|
||||
"security-extended",
|
||||
undefined
|
||||
);
|
||||
// Test that ML-powered queries aren't run when the feature flag is off.
|
||||
test(
|
||||
mlPoweredQueriesMacro,
|
||||
"2.7.5",
|
||||
@@ -1805,28 +1807,33 @@ test(
|
||||
"security-extended",
|
||||
undefined
|
||||
);
|
||||
// Test that ML-powered queries aren't run when the user hasn't specified that we should run the
|
||||
// `security-extended` or `security-and-quality` query suite.
|
||||
test(mlPoweredQueriesMacro, "2.7.5", true, undefined, undefined, undefined);
|
||||
// Test that ML-powered queries are run on non-Windows platforms running `security-extended`.
|
||||
test(
|
||||
mlPoweredQueriesMacro,
|
||||
"2.7.5",
|
||||
true,
|
||||
undefined,
|
||||
"security-extended",
|
||||
"~0.1.0"
|
||||
process.platform === "win32" ? undefined : "~0.1.0"
|
||||
);
|
||||
// Test that ML-powered queries are run on non-Windows platforms running `security-and-quality`.
|
||||
test(
|
||||
mlPoweredQueriesMacro,
|
||||
"2.7.5",
|
||||
true,
|
||||
undefined,
|
||||
"security-and-quality",
|
||||
"~0.1.0"
|
||||
process.platform === "win32" ? undefined : "~0.1.0"
|
||||
);
|
||||
// Test that we don't inject an ML-powered query pack if the user has already specified one.
|
||||
test(
|
||||
mlPoweredQueriesMacro,
|
||||
"2.7.5",
|
||||
true,
|
||||
"codeql/javascript-experimental-atm-queries@0.0.1",
|
||||
"security-and-quality",
|
||||
"0.0.1"
|
||||
process.platform === "win32" ? undefined : "0.0.1"
|
||||
);
|
||||
|
||||
@@ -299,6 +299,8 @@ async function addBuiltinSuiteQueries(
|
||||
// opted into the ML-powered queries beta, and a user hasn't already added the ML-powered query
|
||||
// pack, then add the ML-powered query pack so that we run ML-powered queries.
|
||||
if (
|
||||
// Disable ML-powered queries on Windows
|
||||
process.platform !== "win32" &&
|
||||
languages.includes("javascript") &&
|
||||
(found === "security-extended" || found === "security-and-quality") &&
|
||||
!packs.javascript?.some(
|
||||
|
||||
Reference in New Issue
Block a user