Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9dcc141

Browse filesBrowse files
authored
Merge pull request #1010 from github/henrymercer/stop-running-ml-powered-queries-on-windows
Stop running ML-powered queries on Windows
2 parents 894face + e6f3e04 commit 9dcc141
Copy full SHA for 9dcc141

File tree

Expand file treeCollapse file tree

6 files changed

+30
-11
lines changed
Filter options
Expand file treeCollapse file tree

6 files changed

+30
-11
lines changed

‎lib/config-utils.js

Copy file name to clipboardExpand all lines: lib/config-utils.js
+4-1Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/config-utils.js.map

Copy file name to clipboardExpand all lines: lib/config-utils.js.map
+1-1Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/config-utils.test.js

Copy file name to clipboardExpand all lines: lib/config-utils.test.js
+11-4Lines changed: 11 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/config-utils.test.js.map

Copy file name to clipboardExpand all lines: lib/config-utils.test.js.map
+1-1Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/config-utils.test.ts

Copy file name to clipboardExpand all lines: src/config-utils.test.ts
+11-4Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1788,7 +1788,8 @@ const mlPoweredQueriesMacro = test.macro({
17881788
}`,
17891789
});
17901790

1791-
// macro, isMlPoweredQueriesFlagEnabled, packsInput, queriesInput, versionString
1791+
// macro, codeQLVersion, isMlPoweredQueriesFlagEnabled, packsInput, queriesInput, expectedVersionString
1792+
// Test that ML-powered queries aren't run on v2.7.4 of the CLI.
17921793
test(
17931794
mlPoweredQueriesMacro,
17941795
"2.7.4",
@@ -1797,6 +1798,7 @@ test(
17971798
"security-extended",
17981799
undefined
17991800
);
1801+
// Test that ML-powered queries aren't run when the feature flag is off.
18001802
test(
18011803
mlPoweredQueriesMacro,
18021804
"2.7.5",
@@ -1805,28 +1807,33 @@ test(
18051807
"security-extended",
18061808
undefined
18071809
);
1810+
// Test that ML-powered queries aren't run when the user hasn't specified that we should run the
1811+
// `security-extended` or `security-and-quality` query suite.
18081812
test(mlPoweredQueriesMacro, "2.7.5", true, undefined, undefined, undefined);
1813+
// Test that ML-powered queries are run on non-Windows platforms running `security-extended`.
18091814
test(
18101815
mlPoweredQueriesMacro,
18111816
"2.7.5",
18121817
true,
18131818
undefined,
18141819
"security-extended",
1815-
"~0.1.0"
1820+
process.platform === "win32" ? undefined : "~0.1.0"
18161821
);
1822+
// Test that ML-powered queries are run on non-Windows platforms running `security-and-quality`.
18171823
test(
18181824
mlPoweredQueriesMacro,
18191825
"2.7.5",
18201826
true,
18211827
undefined,
18221828
"security-and-quality",
1823-
"~0.1.0"
1829+
process.platform === "win32" ? undefined : "~0.1.0"
18241830
);
1831+
// Test that we don't inject an ML-powered query pack if the user has already specified one.
18251832
test(
18261833
mlPoweredQueriesMacro,
18271834
"2.7.5",
18281835
true,
18291836
"codeql/javascript-experimental-atm-queries@0.0.1",
18301837
"security-and-quality",
1831-
"0.0.1"
1838+
process.platform === "win32" ? undefined : "0.0.1"
18321839
);

‎src/config-utils.ts

Copy file name to clipboardExpand all lines: src/config-utils.ts
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,8 @@ async function addBuiltinSuiteQueries(
299299
// opted into the ML-powered queries beta, and a user hasn't already added the ML-powered query
300300
// pack, then add the ML-powered query pack so that we run ML-powered queries.
301301
if (
302+
// Disable ML-powered queries on Windows
303+
process.platform !== "win32" &&
302304
languages.includes("javascript") &&
303305
(found === "security-extended" || found === "security-and-quality") &&
304306
!packs.javascript?.some(

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.