Remove support for CodeQL CLI versions older than 2.14.6 (#3562)
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
## [UNRELEASED]
|
||||
|
||||
- Remove support for CodeQL CLI versions older than 2.14.6. [#3562](https://github.com/github/vscode-codeql/pull/3562)
|
||||
|
||||
## 1.12.5 - 9 April 2024
|
||||
|
||||
- Add new supported source and sink kinds in the CodeQL Model Editor [#3511](https://github.com/github/vscode-codeql/pull/3511)
|
||||
|
||||
@@ -1912,22 +1912,7 @@ function shouldDebugCliServer() {
|
||||
export class CliVersionConstraint {
|
||||
// The oldest version of the CLI that we support. This is used to determine
|
||||
// whether to show a warning about the CLI being too old on startup.
|
||||
public static OLDEST_SUPPORTED_CLI_VERSION = new SemVer("2.13.5");
|
||||
|
||||
/**
|
||||
* CLI version where the `generate extensible-predicate-metadata`
|
||||
* command was implemented.
|
||||
*/
|
||||
public static CLI_VERSION_WITH_EXTENSIBLE_PREDICATE_METADATA = new SemVer(
|
||||
"2.14.3",
|
||||
);
|
||||
|
||||
/**
|
||||
* CLI version where the langauge server supports visisbility change notifications.
|
||||
*/
|
||||
public static CLI_VERSION_WITH_VISIBILITY_NOTIFICATIONS = new SemVer(
|
||||
"2.14.0",
|
||||
);
|
||||
public static OLDEST_SUPPORTED_CLI_VERSION = new SemVer("2.14.6");
|
||||
|
||||
/**
|
||||
* CLI version where the query server supports the `evaluation/trimCache` method
|
||||
@@ -1952,18 +1937,6 @@ export class CliVersionConstraint {
|
||||
return (await this.cli.getVersion()).compare(v) >= 0;
|
||||
}
|
||||
|
||||
async supportsVisibilityNotifications() {
|
||||
return this.isVersionAtLeast(
|
||||
CliVersionConstraint.CLI_VERSION_WITH_VISIBILITY_NOTIFICATIONS,
|
||||
);
|
||||
}
|
||||
|
||||
async supportsGenerateExtensiblePredicateMetadata() {
|
||||
return this.isVersionAtLeast(
|
||||
CliVersionConstraint.CLI_VERSION_WITH_EXTENSIBLE_PREDICATE_METADATA,
|
||||
);
|
||||
}
|
||||
|
||||
async preservesExtensiblePredicatesInMrvaPack() {
|
||||
// Negated, because we _stopped_ preserving these in 2.16.1.
|
||||
return !(await this.isVersionAtLeast(
|
||||
|
||||
@@ -1078,14 +1078,12 @@ async function activateWithInstalledDistribution(
|
||||
});
|
||||
|
||||
// Handle visibility changes in the CodeQL language client.
|
||||
if (await cliServer.cliConstraints.supportsVisibilityNotifications()) {
|
||||
Window.onDidChangeVisibleTextEditors((editors) => {
|
||||
languageClient.notifyVisibilityChange(editors);
|
||||
});
|
||||
// Send an inital notification to the language server
|
||||
// to set the initial state of the visible editors.
|
||||
languageClient.notifyVisibilityChange(Window.visibleTextEditors);
|
||||
}
|
||||
Window.onDidChangeVisibleTextEditors((editors) => {
|
||||
languageClient.notifyVisibilityChange(editors);
|
||||
});
|
||||
// Send an inital notification to the language server
|
||||
// to set the initial state of the visible editors.
|
||||
languageClient.notifyVisibilityChange(Window.visibleTextEditors);
|
||||
|
||||
// Jump-to-definition and find-references
|
||||
void extLogger.log("Registering jump-to-definition handlers.");
|
||||
|
||||
@@ -204,18 +204,14 @@ async function copyExistingQueryPack(
|
||||
// Also include query files that contain extensible predicates. These query files are not
|
||||
// needed for the query to run, but they are needed for the query pack to pass deep validation
|
||||
// of data extensions.
|
||||
if (
|
||||
await cliServer.cliConstraints.supportsGenerateExtensiblePredicateMetadata()
|
||||
) {
|
||||
const metadata = await cliServer.generateExtensiblePredicateMetadata(
|
||||
qlPackDetails.qlPackRootPath,
|
||||
);
|
||||
metadata.extensible_predicates.forEach((predicate) => {
|
||||
if (predicate.path.endsWith(".ql")) {
|
||||
toCopy.push(join(qlPackDetails.qlPackRootPath, predicate.path));
|
||||
}
|
||||
});
|
||||
}
|
||||
const metadata = await cliServer.generateExtensiblePredicateMetadata(
|
||||
qlPackDetails.qlPackRootPath,
|
||||
);
|
||||
metadata.extensible_predicates.forEach((predicate) => {
|
||||
if (predicate.path.endsWith(".ql")) {
|
||||
toCopy.push(join(qlPackDetails.qlPackRootPath, predicate.path));
|
||||
}
|
||||
});
|
||||
|
||||
[
|
||||
// also copy the lock file (either new name or old name) and the query file itself. These are not included in the packlist.
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
"v2.16.6",
|
||||
"v2.15.5",
|
||||
"v2.14.6",
|
||||
"v2.13.5",
|
||||
"nightly"
|
||||
]
|
||||
|
||||
@@ -295,15 +295,6 @@ describe("Variant Analysis Manager", () => {
|
||||
// Test running core java queries to ensure that we can compile queries in packs
|
||||
// that contain queries with extensible predicates
|
||||
it("should run a remote query that is part of the java pack", async () => {
|
||||
if (
|
||||
!(await cli.cliConstraints.supportsGenerateExtensiblePredicateMetadata())
|
||||
) {
|
||||
console.log(
|
||||
`Skipping test because generating extensible predicate metadata was only introduced in CLI version ${CliVersionConstraint.CLI_VERSION_WITH_EXTENSIBLE_PREDICATE_METADATA}.`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!process.env.TEST_CODEQL_PATH) {
|
||||
fail(
|
||||
"TEST_CODEQL_PATH environment variable not set. It should point to the absolute path to a checkout of the codeql repository.",
|
||||
|
||||
Reference in New Issue
Block a user