Fix typo in 'evaluatorLogPaths'

This commit is contained in:
Asger F
2024-11-20 11:22:32 +01:00
parent 4e32a108a6
commit eee593973d
4 changed files with 15 additions and 15 deletions

View File

@@ -94,12 +94,12 @@ export class LogScannerService extends DisposableObject {
public async scanEvalLog(query: QueryHistoryInfo | undefined): Promise<void> { public async scanEvalLog(query: QueryHistoryInfo | undefined): Promise<void> {
this.diagnosticCollection.clear(); this.diagnosticCollection.clear();
if (query?.t !== "local" || query.evalutorLogPaths === undefined) { if (query?.t !== "local" || query.evaluatorLogPaths === undefined) {
return; return;
} }
const { summarySymbols, jsonSummary, humanReadableSummary } = const { summarySymbols, jsonSummary, humanReadableSummary } =
query.evalutorLogPaths; query.evaluatorLogPaths;
if (jsonSummary === undefined || humanReadableSummary === undefined) { if (jsonSummary === undefined || humanReadableSummary === undefined) {
return; return;

View File

@@ -781,7 +781,7 @@ export class QueryHistoryManager extends DisposableObject {
private async warnNoEvalLogSummary(item: LocalQueryInfo) { private async warnNoEvalLogSummary(item: LocalQueryInfo) {
const evalLogLocation = const evalLogLocation =
item.evalutorLogPaths?.log ?? item.initialInfo.outputDir?.evalLogPath; item.evaluatorLogPaths?.log ?? item.initialInfo.outputDir?.evalLogPath;
// Summary log file doesn't exist. // Summary log file doesn't exist.
if (evalLogLocation && (await pathExists(evalLogLocation))) { if (evalLogLocation && (await pathExists(evalLogLocation))) {
@@ -801,7 +801,7 @@ export class QueryHistoryManager extends DisposableObject {
} }
const evalLogLocation = const evalLogLocation =
item.evalutorLogPaths?.log ?? item.initialInfo.outputDir?.evalLogPath; item.evaluatorLogPaths?.log ?? item.initialInfo.outputDir?.evalLogPath;
if (evalLogLocation && (await pathExists(evalLogLocation))) { if (evalLogLocation && (await pathExists(evalLogLocation))) {
await tryOpenExternalFile(this.app.commands, evalLogLocation); await tryOpenExternalFile(this.app.commands, evalLogLocation);
@@ -816,14 +816,14 @@ export class QueryHistoryManager extends DisposableObject {
} }
// If the summary file location wasn't saved, display error // If the summary file location wasn't saved, display error
if (!item.evalutorLogPaths?.humanReadableSummary) { if (!item.evaluatorLogPaths?.humanReadableSummary) {
await this.warnNoEvalLogSummary(item); await this.warnNoEvalLogSummary(item);
return; return;
} }
await tryOpenExternalFile( await tryOpenExternalFile(
this.app.commands, this.app.commands,
item.evalutorLogPaths.humanReadableSummary, item.evaluatorLogPaths.humanReadableSummary,
); );
} }
@@ -833,7 +833,7 @@ export class QueryHistoryManager extends DisposableObject {
} }
// If the JSON summary file location wasn't saved, display error // If the JSON summary file location wasn't saved, display error
if (item.evalutorLogPaths?.jsonSummary === undefined) { if (item.evaluatorLogPaths?.jsonSummary === undefined) {
await this.warnNoEvalLogSummary(item); await this.warnNoEvalLogSummary(item);
return; return;
} }
@@ -841,7 +841,7 @@ export class QueryHistoryManager extends DisposableObject {
// TODO(angelapwen): Stream the file in. // TODO(angelapwen): Stream the file in.
try { try {
const evalLogData: EvalLogData[] = await parseViewerData( const evalLogData: EvalLogData[] = await parseViewerData(
item.evalutorLogPaths.jsonSummary, item.evaluatorLogPaths.jsonSummary,
); );
const evalLogTreeBuilder = new EvalLogTreeBuilder( const evalLogTreeBuilder = new EvalLogTreeBuilder(
item.getQueryName(), item.getQueryName(),
@@ -850,7 +850,7 @@ export class QueryHistoryManager extends DisposableObject {
this.evalLogViewer.updateRoots(await evalLogTreeBuilder.getRoots()); this.evalLogViewer.updateRoots(await evalLogTreeBuilder.getRoots());
} catch { } catch {
throw new Error( throw new Error(
`Could not read evaluator log summary JSON file to generate viewer data at ${item.evalutorLogPaths.jsonSummary}.`, `Could not read evaluator log summary JSON file to generate viewer data at ${item.evaluatorLogPaths.jsonSummary}.`,
); );
} }
} }

View File

@@ -25,10 +25,10 @@ export function mapLocalQueryInfoToDto(
return { return {
initialInfo: mapInitialQueryInfoToDto(query.initialInfo), initialInfo: mapInitialQueryInfoToDto(query.initialInfo),
t: "local", t: "local",
evalLogLocation: query.evalutorLogPaths?.log, evalLogLocation: query.evaluatorLogPaths?.log,
evalLogSummaryLocation: query.evalutorLogPaths?.humanReadableSummary, evalLogSummaryLocation: query.evaluatorLogPaths?.humanReadableSummary,
jsonEvalLogSummaryLocation: query.evalutorLogPaths?.jsonSummary, jsonEvalLogSummaryLocation: query.evaluatorLogPaths?.jsonSummary,
evalLogSummarySymbolsLocation: query.evalutorLogPaths?.summarySymbols, evalLogSummarySymbolsLocation: query.evaluatorLogPaths?.summarySymbols,
failureReason: query.failureReason, failureReason: query.failureReason,
completedQuery: completedQuery:
query.completedQuery && mapCompletedQueryToDto(query.completedQuery), query.completedQuery && mapCompletedQueryToDto(query.completedQuery),

View File

@@ -200,7 +200,7 @@ export class LocalQueryInfo {
private cancellationSource?: CancellationTokenSource, // used to cancel in progress queries private cancellationSource?: CancellationTokenSource, // used to cancel in progress queries
public failureReason?: string, public failureReason?: string,
public completedQuery?: CompletedQueryInfo, public completedQuery?: CompletedQueryInfo,
public evalutorLogPaths?: EvaluatorLogPaths, public evaluatorLogPaths?: EvaluatorLogPaths,
) { ) {
/**/ /**/
} }
@@ -226,7 +226,7 @@ export class LocalQueryInfo {
/** Sets the paths to the various structured evaluator logs. */ /** Sets the paths to the various structured evaluator logs. */
public setEvaluatorLogPaths(logPaths: EvaluatorLogPaths): void { public setEvaluatorLogPaths(logPaths: EvaluatorLogPaths): void {
this.evalutorLogPaths = logPaths; this.evaluatorLogPaths = logPaths;
} }
/** /**