Skip to content

Commit 66ae46f

Browse files
committed
Drop support for CLI versions < v2.11.6
1 parent 424e8d3 commit 66ae46f

File tree

10 files changed

+21
-508
lines changed

10 files changed

+21
-508
lines changed

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

Lines changed: 6 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -881,10 +881,9 @@ export class CodeQLCliServer implements Disposable {
881881
additionalPacks: string[],
882882
queryPath: string,
883883
): Promise<MlModelsInfo> {
884-
const args = (await this.cliConstraints.supportsPreciseResolveMlModels())
885-
? // use the dirname of the path so that we can handle query libraries
886-
[...this.getAdditionalPacksArg(additionalPacks), dirname(queryPath)]
887-
: this.getAdditionalPacksArg(additionalPacks);
884+
const args =
885+
// use the dirname of the path so that we can handle query libraries
886+
[...this.getAdditionalPacksArg(additionalPacks), dirname(queryPath)];
888887
return await this.runJsonCodeQlCliCommand<MlModelsInfo>(
889888
["resolve", "ml-models"],
890889
args,
@@ -988,9 +987,7 @@ export class CodeQLCliServer implements Disposable {
988987
const subcommandArgs = [
989988
"--format=text",
990989
`--end-summary=${endSummaryPath}`,
991-
...((await this.cliConstraints.supportsSourceMap())
992-
? ["--sourcemap"]
993-
: []),
990+
"--sourcemap",
994991
inputPath,
995992
outputPath,
996993
];
@@ -1712,41 +1709,7 @@ export function shouldDebugCliServer() {
17121709
export class CliVersionConstraint {
17131710
// The oldest version of the CLI that we support. This is used to determine
17141711
// whether to show a warning about the CLI being too old on startup.
1715-
public static OLDEST_SUPPORTED_CLI_VERSION = new SemVer("2.9.4");
1716-
1717-
/**
1718-
* CLI version where building QLX packs for remote queries is supported.
1719-
* (The options were _accepted_ by a few earlier versions, but only from
1720-
* 2.11.3 will it actually use the existing compilation cache correctly).
1721-
*/
1722-
public static CLI_VERSION_QLX_REMOTE = new SemVer("2.11.3");
1723-
1724-
/**
1725-
* CLI version where the `resolve ml-models` subcommand was enhanced to work with packaging.
1726-
*/
1727-
public static CLI_VERSION_WITH_PRECISE_RESOLVE_ML_MODELS = new SemVer(
1728-
"2.10.0",
1729-
);
1730-
1731-
/**
1732-
* CLI version where the `resolve extensions` subcommand exists.
1733-
*/
1734-
public static CLI_VERSION_WITH_RESOLVE_EXTENSIONS = new SemVer("2.10.2");
1735-
1736-
/**
1737-
* CLI version that supports the `--sourcemap` option for log generation.
1738-
*/
1739-
public static CLI_VERSION_WITH_SOURCEMAP = new SemVer("2.10.3");
1740-
1741-
/**
1742-
* CLI version that supports the new query server.
1743-
*/
1744-
public static CLI_VERSION_WITH_NEW_QUERY_SERVER = new SemVer("2.11.1");
1745-
1746-
/**
1747-
* CLI version that supports `${workspace}` references in qlpack.yml files.
1748-
*/
1749-
public static CLI_VERSION_WITH_WORKSPACE_RFERENCES = new SemVer("2.11.3");
1712+
public static OLDEST_SUPPORTED_CLI_VERSION = new SemVer("2.11.6");
17501713

17511714
/**
17521715
* CLI version that supports the `--kind` option for the `resolve qlpacks` command.
@@ -1796,48 +1759,9 @@ export class CliVersionConstraint {
17961759
return (await this.cli.getVersion()).compare(v) >= 0;
17971760
}
17981761

1799-
async supportsQlxRemote() {
1800-
return this.isVersionAtLeast(CliVersionConstraint.CLI_VERSION_QLX_REMOTE);
1801-
}
1802-
1803-
async supportsPreciseResolveMlModels() {
1804-
return this.isVersionAtLeast(
1805-
CliVersionConstraint.CLI_VERSION_WITH_PRECISE_RESOLVE_ML_MODELS,
1806-
);
1807-
}
1808-
1809-
async supportsResolveExtensions() {
1810-
return this.isVersionAtLeast(
1811-
CliVersionConstraint.CLI_VERSION_WITH_RESOLVE_EXTENSIONS,
1812-
);
1813-
}
1814-
1815-
async supportsSourceMap() {
1816-
return this.isVersionAtLeast(
1817-
CliVersionConstraint.CLI_VERSION_WITH_SOURCEMAP,
1818-
);
1819-
}
1820-
18211762
async supportsNewQueryServer() {
18221763
// This allows users to explicitly opt-out of the new query server.
1823-
return (
1824-
allowCanaryQueryServer() &&
1825-
this.isVersionAtLeast(
1826-
CliVersionConstraint.CLI_VERSION_WITH_NEW_QUERY_SERVER,
1827-
)
1828-
);
1829-
}
1830-
1831-
async supportsNewQueryServerForTests() {
1832-
return this.isVersionAtLeast(
1833-
CliVersionConstraint.CLI_VERSION_WITH_NEW_QUERY_SERVER,
1834-
);
1835-
}
1836-
1837-
async supportsWorkspaceReferences() {
1838-
return this.isVersionAtLeast(
1839-
CliVersionConstraint.CLI_VERSION_WITH_WORKSPACE_RFERENCES,
1840-
);
1764+
return allowCanaryQueryServer();
18411765
}
18421766

18431767
async supportsQlpacksKind() {

extensions/ql-vscode/src/model-editor/model-editor-module.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,6 @@ export class ModelEditorModule extends DisposableObject {
155155
return;
156156
}
157157

158-
if (
159-
!(await this.cliServer.cliConstraints.supportsResolveExtensions())
160-
) {
161-
void showAndLogErrorMessage(
162-
this.app.logger,
163-
`This feature requires CodeQL CLI version ${CliVersionConstraint.CLI_VERSION_WITH_RESOLVE_EXTENSIONS.format()} or later.`,
164-
);
165-
return;
166-
}
167-
168158
const modelFile = await pickExtensionPack(
169159
this.cliServer,
170160
db,

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

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -105,19 +105,15 @@ async function generateQueryPack(
105105
await cliServer.clearCache();
106106

107107
let precompilationOpts: string[] = [];
108-
if (await cliServer.cliConstraints.supportsQlxRemote()) {
109-
if (await cliServer.cliConstraints.usesGlobalCompilationCache()) {
110-
precompilationOpts = ["--qlx"];
111-
} else {
112-
const ccache = join(originalPackRoot, ".cache");
113-
precompilationOpts = [
114-
"--qlx",
115-
"--no-default-compilation-cache",
116-
`--compilation-cache=${ccache}`,
117-
];
118-
}
108+
if (await cliServer.cliConstraints.usesGlobalCompilationCache()) {
109+
precompilationOpts = ["--qlx"];
119110
} else {
120-
precompilationOpts = ["--no-precompile"];
111+
const ccache = join(originalPackRoot, ".cache");
112+
precompilationOpts = [
113+
"--qlx",
114+
"--no-default-compilation-cache",
115+
`--compilation-cache=${ccache}`,
116+
];
121117
}
122118

123119
if (await cliServer.useExtensionPacks()) {
@@ -540,7 +536,7 @@ async function getControllerRepoFromApi(
540536
}
541537
}
542538

543-
export function removeWorkspaceRefs(qlpack: QlPackFile) {
539+
function removeWorkspaceRefs(qlpack: QlPackFile) {
544540
if (!qlpack.dependencies) {
545541
return;
546542
}

extensions/ql-vscode/supported_cli_versions.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@
44
"v2.13.5",
55
"v2.12.7",
66
"v2.11.6",
7-
"v2.9.4",
8-
"v2.10.5",
97
"nightly"
108
]

extensions/ql-vscode/test/vscode-tests/cli-integration/debugger/debugger.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,6 @@ describeWithCodeQL()("Debugger", () => {
179179
});
180180

181181
it("should pass additionalArgs through to query server", async () => {
182-
if (!(await cli.cliConstraints.supportsNewQueryServerForTests())) {
183-
// Only works with the new query server.
184-
return;
185-
}
186182
await withDebugController(appCommands, async (controller) => {
187183
await controller.startDebugging(
188184
{

0 commit comments

Comments
 (0)