Skip to content

Commit c61b0ca

Browse files
authored
Address user feedback (microsoft#80)
* Update deps * Tweak repro step text * Exclude minified files since failures are relatively low priority * Display a warning if not all repos were processed * Add a table for investigation notes
1 parent f694388 commit c61b0ca

File tree

5 files changed

+43
-13
lines changed

5 files changed

+43
-13
lines changed

package-lock.json

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@octokit/rest": "^16.43.2",
1515
"@typescript/github-link": "^0.2.1",
1616
"@typescript/server-harness": "^0.3.4",
17-
"@typescript/server-replay": "^0.2.10",
17+
"@typescript/server-replay": "^0.2.11",
1818
"glob": "^7.2.3",
1919
"json5": "^2.2.1",
2020
"random-seed": "^0.3.0",

src/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,10 @@ ${fs.readFileSync(replayScriptPath, { encoding: "utf-8" }).split(/\r?\n/).slice(
332332
}
333333

334334
// The URL of the artifact can be determined via AzDO REST APIs, but not until after the artifact is published
335-
summary += `<li>Download <code>${replayScriptArtifactPath}</code> from the <a href="${artifactFolderUrlPlaceholder}">artifact folder</a></li>\n`;
335+
summary += `<li>Back in the initial folder, download <code>${replayScriptArtifactPath}</code> from the <a href="${artifactFolderUrlPlaceholder}">artifact folder</a></li>\n`;
336336
summary += `<li><code>npm install --no-save @typescript/server-replay</code></li>\n`;
337337
summary += `<li><code>npx tsreplay ./${repo.name} ./${replayScriptName} path/to/tsserver.js</code></li>\n`;
338+
summary += `<li><code>npx tsreplay --help</code> to learn about helpful switches for debugging, logging, etc</li>\n`;
338339

339340
summary += `</ol>
340341
</details>

src/postGithubIssue.ts

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,51 @@ const title = entrypoint === "tsserver"
5151
const description = entrypoint === "tsserver"
5252
? `The following errors were reported by ${newTscResolvedVersion}`
5353
: `The following errors were reported by ${newTscResolvedVersion}, but not by ${oldTscResolvedVersion}`;
54-
const header = `${description}
54+
let header = `${description}
5555
[Pipeline that generated this bug](https://typescript.visualstudio.com/TypeScript/_build?definitionId=48)
5656
[Logs for the pipeline run](${logUri})
5757
[File that generated the pipeline](https://github.com/microsoft/typescript-error-deltas/blob/main/azure-pipelines-gitTests.yml)
5858
5959
This run considered ${repoCount} popular TS repos from GH (after skipping the top ${repoStartIndex}).
6060
6161
<details>
62-
<summary>Successfully analyzed ${analyzedCount} of ${totalCount} visited repos</summary>
62+
<summary>Successfully analyzed ${analyzedCount} of ${totalCount} visited repos${totalCount < +repoCount ? ` (:warning: expected ${repoCount})` : ""}</summary>
6363
6464
| Outcome | Count |
6565
|---------|-------|
6666
${Object.keys(statusCounts).sort().map(status => `| ${status} | ${statusCounts[status as RepoStatus]} |\n`).join("")}
67-
</details>`;
67+
</details>
68+
69+
## Investigation Status
70+
| Repo | Errors | Outcome |
71+
|------|--------|---------|
72+
`;
6873

6974
const resultPaths = pu.glob(resultDirPath, `**/*.${resultFileNameSuffix}`).sort((a, b) => path.basename(a).localeCompare(path.basename(b)));
7075
const outputs = resultPaths.map(p => fs.readFileSync(p, { encoding: "utf-8" }).replace(new RegExp(artifactFolderUrlPlaceholder, "g"), artifactsUri));
7176

77+
for (let i = 0; i < outputs.length; i++) {
78+
const resultPath = resultPaths[i];
79+
const output = outputs[i];
80+
81+
const fileName = path.basename(resultPath);
82+
const repoString = fileName.substring(0, fileName.length - resultFileNameSuffix.length - 1);
83+
const repoName = repoString.replace(".", "/"); // The owner *probably* doesn't have a dot in it
84+
85+
let errorCount = 0;
86+
if (entrypoint === "tsserver") {
87+
errorCount = 1;
88+
}
89+
else {
90+
const re = /^\W*error TS\d+/gm;
91+
while (re.exec(output)) {
92+
errorCount++;
93+
}
94+
}
95+
96+
header += `|${repoName}|${errorCount}| |\n`;
97+
}
98+
99+
72100
const bodyChunks = [header, ...outputs];
73101
git.createIssue(postResult, title, bodyChunks, /*sawNewErrors*/ !!outputs.length);

src/utils/exerciseServer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export async function exerciseServer(testDir: string, replayScriptPath: string,
6060

6161
async function exerciseServerWorker(testDir: string, tsserverPath: string, replayScriptHandle: fs.promises.FileHandle, requestTimes: Record<string, number>, requestCounts: Record<string, number>): Promise<void> {
6262
const files = await (new Promise<string[]>((resolve, reject) => {
63-
glob("**/*.@(ts|tsx|js|jsx)", { cwd: testDir, absolute: false, ignore: ["**/node_modules/**"], nodir: true, follow: false }, (err, results) => {
63+
glob("**/*.@(ts|tsx|js|jsx)", { cwd: testDir, absolute: false, ignore: ["**/node_modules/**", "**/*.min.js"], nodir: true, follow: false }, (err, results) => {
6464
if (err) {
6565
reject(err);
6666
}

0 commit comments

Comments
 (0)