Skip to content

Report each repo in a separate comment for easier triaging #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 21, 2022
Merged
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
20 changes: 3 additions & 17 deletions src/postGithubIssue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ for (const path of metadataFilePaths) {
const title = entrypoint === "tsserver"
? `[ServerErrors][${language}] ${newTscResolvedVersion}`
: `[NewErrors] ${newTscResolvedVersion} vs ${oldTscResolvedVersion}`;

const description = entrypoint === "tsserver"
? `The following errors were reported by ${newTscResolvedVersion}`
: `The following errors were reported by ${newTscResolvedVersion}, but not by ${oldTscResolvedVersion}`;
Expand All @@ -63,25 +64,10 @@ This run considered ${repoCount} popular TS repos from GH (after skipping the to
| Outcome | Count |
|---------|-------|
${Object.keys(statusCounts).sort().map(status => `| ${status} | ${statusCounts[status as RepoStatus]} |\n`).join("")}
</details>


`;
</details>`;

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


// GH caps the maximum body length, so paginate if necessary
const bodyChunks: string[] = [];
let chunk = header;
for (const output of outputs) {
if (chunk.length + output.length > 65535) {
bodyChunks.push(chunk);
chunk = "";
}
chunk += output;
}
bodyChunks.push(chunk);

const bodyChunks = [header, ...outputs];
git.createIssue(postResult, title, bodyChunks, /*sawNewErrors*/ !!outputs.length);