Skip to content

Commit 0df508d

Browse files
authored
Remove support for CodeQL CLI versions older than 2.14.6 (#3562)
1 parent 2e7586c commit 0df508d

File tree

6 files changed

+17
-58
lines changed

6 files changed

+17
-58
lines changed

extensions/ql-vscode/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## [UNRELEASED]
44

5+
- Remove support for CodeQL CLI versions older than 2.14.6. [#3562](https://github.com/github/vscode-codeql/pull/3562)
6+
57
## 1.12.5 - 9 April 2024
68

79
- Add new supported source and sink kinds in the CodeQL Model Editor [#3511](https://github.com/github/vscode-codeql/pull/3511)

extensions/ql-vscode/src/codeql-cli/cli.ts

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1912,22 +1912,7 @@ function shouldDebugCliServer() {
19121912
export class CliVersionConstraint {
19131913
// The oldest version of the CLI that we support. This is used to determine
19141914
// whether to show a warning about the CLI being too old on startup.
1915-
public static OLDEST_SUPPORTED_CLI_VERSION = new SemVer("2.13.5");
1916-
1917-
/**
1918-
* CLI version where the `generate extensible-predicate-metadata`
1919-
* command was implemented.
1920-
*/
1921-
public static CLI_VERSION_WITH_EXTENSIBLE_PREDICATE_METADATA = new SemVer(
1922-
"2.14.3",
1923-
);
1924-
1925-
/**
1926-
* CLI version where the langauge server supports visisbility change notifications.
1927-
*/
1928-
public static CLI_VERSION_WITH_VISIBILITY_NOTIFICATIONS = new SemVer(
1929-
"2.14.0",
1930-
);
1915+
public static OLDEST_SUPPORTED_CLI_VERSION = new SemVer("2.14.6");
19311916

19321917
/**
19331918
* CLI version where the query server supports the `evaluation/trimCache` method
@@ -1952,18 +1937,6 @@ export class CliVersionConstraint {
19521937
return (await this.cli.getVersion()).compare(v) >= 0;
19531938
}
19541939

1955-
async supportsVisibilityNotifications() {
1956-
return this.isVersionAtLeast(
1957-
CliVersionConstraint.CLI_VERSION_WITH_VISIBILITY_NOTIFICATIONS,
1958-
);
1959-
}
1960-
1961-
async supportsGenerateExtensiblePredicateMetadata() {
1962-
return this.isVersionAtLeast(
1963-
CliVersionConstraint.CLI_VERSION_WITH_EXTENSIBLE_PREDICATE_METADATA,
1964-
);
1965-
}
1966-
19671940
async preservesExtensiblePredicatesInMrvaPack() {
19681941
// Negated, because we _stopped_ preserving these in 2.16.1.
19691942
return !(await this.isVersionAtLeast(

extensions/ql-vscode/src/extension.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,14 +1078,12 @@ async function activateWithInstalledDistribution(
10781078
});
10791079

10801080
// Handle visibility changes in the CodeQL language client.
1081-
if (await cliServer.cliConstraints.supportsVisibilityNotifications()) {
1082-
Window.onDidChangeVisibleTextEditors((editors) => {
1083-
languageClient.notifyVisibilityChange(editors);
1084-
});
1085-
// Send an inital notification to the language server
1086-
// to set the initial state of the visible editors.
1087-
languageClient.notifyVisibilityChange(Window.visibleTextEditors);
1088-
}
1081+
Window.onDidChangeVisibleTextEditors((editors) => {
1082+
languageClient.notifyVisibilityChange(editors);
1083+
});
1084+
// Send an inital notification to the language server
1085+
// to set the initial state of the visible editors.
1086+
languageClient.notifyVisibilityChange(Window.visibleTextEditors);
10891087

10901088
// Jump-to-definition and find-references
10911089
void extLogger.log("Registering jump-to-definition handlers.");

extensions/ql-vscode/src/variant-analysis/run-remote-query.ts

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -204,18 +204,14 @@ async function copyExistingQueryPack(
204204
// Also include query files that contain extensible predicates. These query files are not
205205
// needed for the query to run, but they are needed for the query pack to pass deep validation
206206
// of data extensions.
207-
if (
208-
await cliServer.cliConstraints.supportsGenerateExtensiblePredicateMetadata()
209-
) {
210-
const metadata = await cliServer.generateExtensiblePredicateMetadata(
211-
qlPackDetails.qlPackRootPath,
212-
);
213-
metadata.extensible_predicates.forEach((predicate) => {
214-
if (predicate.path.endsWith(".ql")) {
215-
toCopy.push(join(qlPackDetails.qlPackRootPath, predicate.path));
216-
}
217-
});
218-
}
207+
const metadata = await cliServer.generateExtensiblePredicateMetadata(
208+
qlPackDetails.qlPackRootPath,
209+
);
210+
metadata.extensible_predicates.forEach((predicate) => {
211+
if (predicate.path.endsWith(".ql")) {
212+
toCopy.push(join(qlPackDetails.qlPackRootPath, predicate.path));
213+
}
214+
});
219215

220216
[
221217
// also copy the lock file (either new name or old name) and the query file itself. These are not included in the packlist.

extensions/ql-vscode/supported_cli_versions.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
"v2.16.6",
44
"v2.15.5",
55
"v2.14.6",
6-
"v2.13.5",
76
"nightly"
87
]

extensions/ql-vscode/test/vscode-tests/cli-integration/variant-analysis/variant-analysis-manager.test.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -295,15 +295,6 @@ describe("Variant Analysis Manager", () => {
295295
// Test running core java queries to ensure that we can compile queries in packs
296296
// that contain queries with extensible predicates
297297
it("should run a remote query that is part of the java pack", async () => {
298-
if (
299-
!(await cli.cliConstraints.supportsGenerateExtensiblePredicateMetadata())
300-
) {
301-
console.log(
302-
`Skipping test because generating extensible predicate metadata was only introduced in CLI version ${CliVersionConstraint.CLI_VERSION_WITH_EXTENSIBLE_PREDICATE_METADATA}.`,
303-
);
304-
return;
305-
}
306-
307298
if (!process.env.TEST_CODEQL_PATH) {
308299
fail(
309300
"TEST_CODEQL_PATH environment variable not set. It should point to the absolute path to a checkout of the codeql repository.",

0 commit comments

Comments
 (0)