From 074c84e6a3a9449c7495b13551ea9c499e21f4f0 Mon Sep 17 00:00:00 2001 From: Gabriela Araujo Britto Date: Thu, 19 Feb 2026 00:17:07 +0000 Subject: [PATCH] fixes --- src/main.ts | 4 ++-- src/postGithubIssue.ts | 17 ++++++++++------- src/utils/exerciseLspServer.ts | 6 ++++-- src/utils/hashStackTrace.ts | 2 ++ 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/main.ts b/src/main.ts index fdc3991..872d568 100644 --- a/src/main.ts +++ b/src/main.ts @@ -458,8 +458,8 @@ function groupErrors(summaries: Summary[]) { if (summary.tsServerResult.newServerFailed) { // Group new errors error = isLsp - ? parseLspHarnessOutput(summary.tsServerResult.newSpawnResult!.stdout) - : parseServerHarnessOutput(summary.tsServerResult.newSpawnResult!.stdout); + ? parseLspHarnessOutput(summary.tsServerResult.newSpawnResult.stdout) + : parseServerHarnessOutput(summary.tsServerResult.newSpawnResult.stdout); group = groupedNewErrors; } else if (summary.tsServerResult.oldServerFailed) { diff --git a/src/postGithubIssue.ts b/src/postGithubIssue.ts index 4021a16..7b7e915 100644 --- a/src/postGithubIssue.ts +++ b/src/postGithubIssue.ts @@ -52,9 +52,11 @@ const description = entrypoint === "tsserver" : entrypoint == "lsp" ? `The following errors were reported by ${newTscResolvedVersion}` : `The following errors were reported by ${newTscResolvedVersion}, but not by ${oldTscResolvedVersion}`; -// TODO: modify for tsgo +const pipelineUri = entrypoint === "lsp" ? + "https://dev.azure.com/typescript/TypeScript/_build?definitionId=75" : + "https://typescript.visualstudio.com/TypeScript/_build?definitionId=48"; let header = `${description} -[Pipeline that generated this bug](https://typescript.visualstudio.com/TypeScript/_build?definitionId=48) +[Pipeline that generated this bug](${pipelineUri}) [Logs for the pipeline run](${logUri}) [File that generated the pipeline](https://github.com/microsoft/typescript-error-deltas/blob/main/azure-pipelines-gitTests.yml) @@ -67,10 +69,6 @@ This run considered ${repoCount} popular TS repos from GH (after skipping the to |---------|-------| ${Object.keys(statusCounts).sort().map(status => `| ${status} | ${statusCounts[status as RepoStatus]} |\n`).join("")} - -## Investigation Status -| Repo | Errors | Outcome | -|------|--------|---------| `; const resultPaths = pu.glob(resultDirPath, `**/*.${resultFileNameSuffix}`).sort((a, b) => path.basename(a).localeCompare(path.basename(b))); @@ -82,7 +80,12 @@ const outputs = resultPaths.map(p => // tsserver groups results by error, causing the summary to not make sense. Remove the list for now. // See issue: https://github.com/microsoft/typescript-error-deltas/issues/114 -if (entrypoint !== "tsserver") { +if (entrypoint !== "tsserver" || "lsp") { + header += ` +## Investigation Status +| Repo | Errors | Outcome | +|------|--------|---------| +` // Prints the investigation status list. for (let i = 0; i < outputs.length; i++) { const resultPath = resultPaths[i]; diff --git a/src/utils/exerciseLspServer.ts b/src/utils/exerciseLspServer.ts index fedf167..c6235dd 100644 --- a/src/utils/exerciseLspServer.ts +++ b/src/utils/exerciseLspServer.ts @@ -9,6 +9,7 @@ import * as protocol from "vscode-languageserver-protocol"; import { EXIT_BAD_ARGS, EXIT_SERVER_COMMUNICATION_ERROR, EXIT_SERVER_CRASH, EXIT_UNHANDLED_EXCEPTION, EXIT_SERVER_ERROR } from "./exerciseServerConstants"; import { pathToFileURL } from "url"; +const testDirUriPlaceholder = "@PROJECT_ROOT_URI@"; const testDirPlaceholder = "@PROJECT_ROOT@"; const argv = process.argv; @@ -82,6 +83,7 @@ async function exerciseLspServerWorker(testDir: string, lspServerPath: string, r const serverArgs: string[] = ["--lsp", "--stdio"]; replayScriptHandle.write(JSON.stringify({ + rootDirUriPlaceholder: testDirUriPlaceholder, rootDirPlaceholder: testDirPlaceholder, serverArgs, }) + "\n"); @@ -453,7 +455,7 @@ async function exerciseLspServerWorker(testDir: string, lspServerPath: string, r if (prng.random() > prob) return undefined as any; const replayEntry = { kind: "request", method, params }; - const replayStr = JSON.stringify(replayEntry).replaceAll(testDirUrl, testDirPlaceholder); + const replayStr = JSON.stringify(replayEntry).replaceAll(testDirUrl, testDirUriPlaceholder).replaceAll(testDir, testDirPlaceholder); await replayScriptHandle.write(replayStr + "\n"); const start = performance.now(); @@ -487,7 +489,7 @@ async function exerciseLspServerWorker(testDir: string, lspServerPath: string, r params: lsp.NotificationToParams[K], ): Promise { const replayEntry = { kind: "notification", method, params }; - const replayStr = JSON.stringify(replayEntry).replaceAll(testDirUrl, testDirPlaceholder); + const replayStr = JSON.stringify(replayEntry).replaceAll(testDirUrl, testDirUriPlaceholder).replaceAll(testDir, testDirPlaceholder); await replayScriptHandle.write(replayStr + "\n"); try { diff --git a/src/utils/hashStackTrace.ts b/src/utils/hashStackTrace.ts index 7ca6363..98a5b70 100644 --- a/src/utils/hashStackTrace.ts +++ b/src/utils/hashStackTrace.ts @@ -35,6 +35,8 @@ export function getHashForGoStack(stack: string): string { } // Strip goroutine IDs: "goroutine 554 [running]:" -> "goroutine [running]:" line = line.replace(/goroutine \d+/, "goroutine "); + // Strip range expressions e.g. "[:1234]" -> "[:]" + line = line.replace(/\[\d*:\d*\]/g, "[:]"); // Strip function arguments line = line.replace(/^(.+)\(.+$/g, "$1()"); return line;