Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 6 additions & 26 deletions extensions/ql-vscode/src/codeql-cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1428,21 +1428,13 @@ export class CodeQLCliServer implements Disposable {

async packPacklist(dir: string, includeQueries: boolean): Promise<string[]> {
const args = includeQueries ? [dir] : ["--no-include-queries", dir];
// since 2.7.1, packlist returns an object with a "paths" property that is a list of packs.
// previous versions return a list of packs.
const results: { paths: string[] } | string[] =
await this.runJsonCodeQlCliCommand(
["pack", "packlist"],
args,
"Generating the pack list",
);
const results: { paths: string[] } = await this.runJsonCodeQlCliCommand(
["pack", "packlist"],
args,
"Generating the pack list",
);

// Once we no longer need to support 2.7.0 or earlier, we can remove this and assume all versions return an object.
if ("paths" in results) {
return results.paths;
} else {
return results;
}
return results.paths;
}

async packResolveDependencies(
Expand Down Expand Up @@ -1811,12 +1803,6 @@ export class CliVersionConstraint {
*/
public static CLI_VERSION_WITH_RESOLVE_EXTENSIONS = new SemVer("2.10.2");

/**
* CLI version where the `--evaluator-log` and related options to the query server were introduced,
* on a per-query server basis.
*/
public static CLI_VERSION_WITH_STRUCTURED_EVAL_LOG = new SemVer("2.8.2");

/**
* CLI version that supports rotating structured logs to produce one per query.
*
Expand Down Expand Up @@ -1893,12 +1879,6 @@ export class CliVersionConstraint {
);
}

async supportsStructuredEvalLog() {
return this.isVersionAtLeast(
CliVersionConstraint.CLI_VERSION_WITH_STRUCTURED_EVAL_LOG,
);
}

async supportsPerQueryEvalLog() {
return this.isVersionAtLeast(
CliVersionConstraint.CLI_VERSION_WITH_PER_QUERY_EVAL_LOG,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,11 @@ export class QueryServerClient extends DisposableObject {
args.push("--old-eval-stats");
}

if (await this.cliServer.cliConstraints.supportsStructuredEvalLog()) {
const structuredLogFile = `${this.opts.contextStoragePath}/structured-evaluator-log.json`;
await ensureFile(structuredLogFile);
const structuredLogFile = `${this.opts.contextStoragePath}/structured-evaluator-log.json`;
await ensureFile(structuredLogFile);

args.push("--evaluator-log");
args.push(structuredLogFile);

// We hard-code the verbosity level to 5 and minify to false.
// This will be the behavior of the per-query structured logging in the CLI after 2.8.3.
args.push("--evaluator-log-level");
args.push("5");
}
args.push("--evaluator-log");
args.push(structuredLogFile);

if (this.config.debug) {
args.push("--debug", "--tuple-counting");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,6 @@ export class QueryServerClient extends DisposableObject {
args.push("--evaluator-log");
args.push(structuredLogFile);

// We hard-code the verbosity level to 5 and minify to false.
// This will be the behavior of the per-query structured logging in the CLI after 2.8.3.
args.push("--evaluator-log-level");
args.push("5");

if (this.config.debug) {
args.push("--debug", "--tuple-counting");
}
Expand Down