Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
17 changes: 10 additions & 7 deletions src/postGithubIssue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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("")}
</details>

## Investigation Status
| Repo | Errors | Outcome |
|------|--------|---------|
`;

const resultPaths = pu.glob(resultDirPath, `**/*.${resultFileNameSuffix}`).sort((a, b) => path.basename(a).localeCompare(path.basename(b)));
Expand All @@ -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];
Expand Down
6 changes: 4 additions & 2 deletions src/utils/exerciseLspServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -487,7 +489,7 @@ async function exerciseLspServerWorker(testDir: string, lspServerPath: string, r
params: lsp.NotificationToParams[K],
): Promise<void> {
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 {
Expand Down
2 changes: 2 additions & 0 deletions src/utils/hashStackTrace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export function getHashForGoStack(stack: string): string {
}
// Strip goroutine IDs: "goroutine 554 [running]:" -> "goroutine [running]:"
line = line.replace(/goroutine \d+/, "goroutine <number>");
// Strip range expressions e.g. "[:1234]" -> "[:]"
line = line.replace(/\[\d*:\d*\]/g, "[:]");
// Strip function arguments
line = line.replace(/^(.+)\(.+$/g, "$1()");
return line;
Expand Down