Remove CLI_VERSION_WITH_PER_QUERY_EVAL_LOG constraint

This commit is contained in:
Charis Kyriakou
2023-07-24 08:24:07 +00:00
parent 0f594704d5
commit e80ef7c1dc
5 changed files with 6 additions and 41 deletions

View File

@@ -1077,17 +1077,17 @@
{ {
"command": "codeQLQueryHistory.showEvalLog", "command": "codeQLQueryHistory.showEvalLog",
"group": "4_queryHistory@1", "group": "4_queryHistory@1",
"when": "codeql.supportsEvalLog && viewItem == rawResultsItem || codeql.supportsEvalLog && viewItem == interpretedResultsItem || codeql.supportsEvalLog && viewItem == cancelledResultsItem" "when": "viewItem == rawResultsItem || viewItem == interpretedResultsItem || viewItem == cancelledResultsItem"
}, },
{ {
"command": "codeQLQueryHistory.showEvalLogSummary", "command": "codeQLQueryHistory.showEvalLogSummary",
"group": "4_queryHistory@2", "group": "4_queryHistory@2",
"when": "codeql.supportsEvalLog && viewItem == rawResultsItem || codeql.supportsEvalLog && viewItem == interpretedResultsItem || codeql.supportsEvalLog && viewItem == cancelledResultsItem" "when": "viewItem == rawResultsItem || viewItem == interpretedResultsItem || viewItem == cancelledResultsItem"
}, },
{ {
"command": "codeQLQueryHistory.showEvalLogViewer", "command": "codeQLQueryHistory.showEvalLogViewer",
"group": "4_queryHistory@3", "group": "4_queryHistory@3",
"when": "config.codeQL.canary && codeql.supportsEvalLog && viewItem == rawResultsItem || config.codeQL.canary && codeql.supportsEvalLog && viewItem == interpretedResultsItem || config.codeQL.canary && codeql.supportsEvalLog && viewItem == cancelledResultsItem" "when": "config.codeQL.canary && viewItem == rawResultsItem || config.codeQL.canary && viewItem == interpretedResultsItem || config.codeQL.canary && viewItem == cancelledResultsItem"
}, },
{ {
"command": "codeQLQueryHistory.showQueryText", "command": "codeQLQueryHistory.showQueryText",

View File

@@ -1468,13 +1468,6 @@ export class CodeQLCliServer implements Disposable {
); );
// this._version is only undefined upon config change, so we reset CLI-based context key only when necessary. // this._version is only undefined upon config change, so we reset CLI-based context key only when necessary.
await this.app.commands.execute(
"setContext",
"codeql.supportsEvalLog",
newVersion.compare(
CliVersionConstraint.CLI_VERSION_WITH_PER_QUERY_EVAL_LOG,
) >= 0,
);
await this.app.commands.execute( await this.app.commands.execute(
"setContext", "setContext",
"codeql.supportsQuickEvalCount", "codeql.supportsQuickEvalCount",
@@ -1803,17 +1796,6 @@ export class CliVersionConstraint {
*/ */
public static CLI_VERSION_WITH_RESOLVE_EXTENSIONS = new SemVer("2.10.2"); public static CLI_VERSION_WITH_RESOLVE_EXTENSIONS = new SemVer("2.10.2");
/**
* CLI version that supports rotating structured logs to produce one per query.
*
* Note that 2.8.4 supports generating the evaluation logs and summaries,
* but 2.9.0 includes a new option to produce the end-of-query summary logs to
* the query server console. For simplicity we gate all features behind 2.9.0,
* but if a user is tied to the 2.8 release, we can enable evaluator logs
* and summaries for them.
*/
public static CLI_VERSION_WITH_PER_QUERY_EVAL_LOG = new SemVer("2.9.0");
/** /**
* CLI version that supports the `--sourcemap` option for log generation. * CLI version that supports the `--sourcemap` option for log generation.
*/ */
@@ -1879,12 +1861,6 @@ export class CliVersionConstraint {
); );
} }
async supportsPerQueryEvalLog() {
return this.isVersionAtLeast(
CliVersionConstraint.CLI_VERSION_WITH_PER_QUERY_EVAL_LOG,
);
}
async supportsSourceMap() { async supportsSourceMap() {
return this.isVersionAtLeast( return this.isVersionAtLeast(
CliVersionConstraint.CLI_VERSION_WITH_SOURCEMAP, CliVersionConstraint.CLI_VERSION_WITH_SOURCEMAP,

View File

@@ -36,7 +36,6 @@ import {
} from "./query-status"; } from "./query-status";
import { readQueryHistoryFromFile, writeQueryHistoryToFile } from "./store"; import { readQueryHistoryFromFile, writeQueryHistoryToFile } from "./store";
import { pathExists } from "fs-extra"; import { pathExists } from "fs-extra";
import { CliVersionConstraint } from "../codeql-cli/cli";
import { HistoryItemLabelProvider } from "./history-item-label-provider"; import { HistoryItemLabelProvider } from "./history-item-label-provider";
import { ResultsView, WebviewReveal } from "../local-queries"; import { ResultsView, WebviewReveal } from "../local-queries";
import { EvalLogTreeBuilder, EvalLogViewer } from "../query-evaluation-logging"; import { EvalLogTreeBuilder, EvalLogViewer } from "../query-evaluation-logging";
@@ -760,7 +759,7 @@ export class QueryHistoryManager extends DisposableObject {
private warnNoEvalLogs() { private warnNoEvalLogs() {
void showAndLogWarningMessage( void showAndLogWarningMessage(
this.app.logger, this.app.logger,
`Evaluator log, summary, and viewer are not available for this run. Perhaps it failed before evaluation, or you are running with a version of CodeQL before ' + ${CliVersionConstraint.CLI_VERSION_WITH_PER_QUERY_EVAL_LOG}?`, `Evaluator log, summary, and viewer are not available for this run. Perhaps it failed before evaluation?`,
); );
} }

View File

@@ -146,10 +146,6 @@ export class QueryServerClient extends DisposableObject {
args.push("--require-db-registration"); args.push("--require-db-registration");
if (!(await this.cliServer.cliConstraints.supportsPerQueryEvalLog())) {
args.push("--old-eval-stats");
}
const structuredLogFile = `${this.opts.contextStoragePath}/structured-evaluator-log.json`; const structuredLogFile = `${this.opts.contextStoragePath}/structured-evaluator-log.json`;
await ensureFile(structuredLogFile); await ensureFile(structuredLogFile);

View File

@@ -129,10 +129,7 @@ async function runQuery(
dbDir: dbContents.datasetUri.fsPath, dbDir: dbContents.datasetUri.fsPath,
workingSet: "default", workingSet: "default",
}; };
if ( if (generateEvalLog) {
generateEvalLog &&
(await qs.cliServer.cliConstraints.supportsPerQueryEvalLog())
) {
await qs.sendRequest(messages.startLog, { await qs.sendRequest(messages.startLog, {
db: dataset, db: dataset,
logPath: outputDir.evalLogPath, logPath: outputDir.evalLogPath,
@@ -149,10 +146,7 @@ async function runQuery(
await qs.sendRequest(messages.runQueries, params, token, progress); await qs.sendRequest(messages.runQueries, params, token, progress);
} finally { } finally {
qs.unRegisterCallback(callbackId); qs.unRegisterCallback(callbackId);
if ( if (generateEvalLog) {
generateEvalLog &&
(await qs.cliServer.cliConstraints.supportsPerQueryEvalLog())
) {
await qs.sendRequest(messages.endLog, { await qs.sendRequest(messages.endLog, {
db: dataset, db: dataset,
logPath: outputDir.evalLogPath, logPath: outputDir.evalLogPath,