Skip to content

Commit 515132f

Browse files
committed
Remove support for CodeQL CLI versions older than v2.16.6
1 parent b6b707e commit 515132f

File tree

4 files changed

+2
-52
lines changed

4 files changed

+2
-52
lines changed

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

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,38 +1909,12 @@ function shouldDebugCliServer() {
19091909
export class CliVersionConstraint {
19101910
// The oldest version of the CLI that we support. This is used to determine
19111911
// whether to show a warning about the CLI being too old on startup.
1912-
public static OLDEST_SUPPORTED_CLI_VERSION = new SemVer("v2.15.5");
1913-
1914-
public static CLI_VERSION_WITHOUT_MRVA_EXTENSIBLE_PREDICATE_HACK = new SemVer(
1915-
"2.16.1",
1916-
);
1917-
1918-
/**
1919-
* CLI version where there is support for multiple queries on the pack create command.
1920-
*/
1921-
public static CLI_VERSION_WITH_MULTI_QUERY_PACK_CREATE = new SemVer("2.16.1");
1912+
public static OLDEST_SUPPORTED_CLI_VERSION = new SemVer("2.16.6");
19221913

19231914
constructor(private readonly cli: CodeQLCliServer) {
19241915
/**/
19251916
}
19261917

1927-
private async isVersionAtLeast(v: SemVer) {
1928-
return (await this.cli.getVersion()).compare(v) >= 0;
1929-
}
1930-
1931-
async preservesExtensiblePredicatesInMrvaPack() {
1932-
// Negated, because we _stopped_ preserving these in 2.16.1.
1933-
return !(await this.isVersionAtLeast(
1934-
CliVersionConstraint.CLI_VERSION_WITHOUT_MRVA_EXTENSIBLE_PREDICATE_HACK,
1935-
));
1936-
}
1937-
1938-
async supportsPackCreateWithMultipleQueries() {
1939-
return this.isVersionAtLeast(
1940-
CliVersionConstraint.CLI_VERSION_WITH_MULTI_QUERY_PACK_CREATE,
1941-
);
1942-
}
1943-
19441918
async supportsMrvaPackCreate(): Promise<boolean> {
19451919
return (await this.cli.getFeatures()).mrvaPackCreate === true;
19461920
}

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,6 @@ async function generateQueryPack(
116116

117117
let precompilationOpts: string[];
118118
if (cliSupportsMrvaPackCreate) {
119-
if (
120-
qlPackDetails.queryFiles.length > 1 &&
121-
!(await cliServer.cliConstraints.supportsPackCreateWithMultipleQueries())
122-
) {
123-
throw new Error(
124-
`Installed CLI version does not allow creating a MRVA pack with multiple queries`,
125-
);
126-
}
127-
128119
const queryOpts = qlPackDetails.queryFiles.flatMap((q) => [
129120
"--query",
130121
join(targetPackPath, relative(qlPackDetails.qlPackRootPath, q)),

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.18.4",
44
"v2.17.6",
55
"v2.16.6",
6-
"v2.15.5",
76
"nightly"
87
]

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

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -347,13 +347,6 @@ describe("Variant Analysis Manager", () => {
347347
const queryToRun =
348348
"Security/CWE/CWE-020/ExternalAPIsUsedWithUntrustedData.ql";
349349

350-
// Recent versions of the CLI don't preserve queries with extensible predicates in MRVA packs,
351-
// because all the necessary info is in the `.packinfo` file.
352-
const extraQueries =
353-
(await cli.cliConstraints.preservesExtensiblePredicatesInMrvaPack())
354-
? ["Telemetry/ExtractorInformation.ql"]
355-
: [];
356-
357350
const qlPackRootPath = join(process.env.TEST_CODEQL_PATH, "java/ql/src");
358351
const queryPath = join(qlPackRootPath, queryToRun);
359352
const qlPackFilePath = join(qlPackRootPath, "qlpack.yml");
@@ -362,7 +355,7 @@ describe("Variant Analysis Manager", () => {
362355
qlPackRootPath,
363356
qlPackFilePath,
364357
expectedPackName: "codeql/java-queries",
365-
filesThatExist: [queryToRun, ...extraQueries],
358+
filesThatExist: [queryToRun, ...["Telemetry/ExtractorInformation.ql"]],
366359
filesThatDoNotExist: [],
367360
qlxFilesThatExist: [],
368361
dependenciesToCheck: ["codeql/java-all"],
@@ -372,13 +365,6 @@ describe("Variant Analysis Manager", () => {
372365
});
373366

374367
it("should run multiple queries that are part of the same pack", async () => {
375-
if (!(await cli.cliConstraints.supportsPackCreateWithMultipleQueries())) {
376-
console.log(
377-
`Skipping test because MRVA with multiple queries is only suppported in CLI version ${CliVersionConstraint.CLI_VERSION_WITH_MULTI_QUERY_PACK_CREATE} or later.`,
378-
);
379-
return;
380-
}
381-
382368
await doVariantAnalysisTest({
383369
queryPaths: [
384370
"data-qlpack-multiple-queries/query1.ql",

0 commit comments

Comments
 (0)