From 75ea6d8989e44cbff6da3d5a0b15e6dd6d943d7a Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Mon, 5 Oct 2026 12:41:51 -0700 Subject: [PATCH 1/4] Show package names in DT result summaries Collapsed result sections otherwise look identical, making it hard to find a package without expanding every report. --- packages/dtslint-runner/src/post-results.ts | 3 ++- packages/dtslint-runner/test/results.test.ts | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/dtslint-runner/src/post-results.ts b/packages/dtslint-runner/src/post-results.ts index e899c68774..38d80bc143 100644 --- a/packages/dtslint-runner/src/post-results.ts +++ b/packages/dtslint-runner/src/post-results.ts @@ -181,13 +181,14 @@ function getDiffReports(main: Errors, branch: Errors): DiffReport[] { } function formatReport(report: DiffReport, maxErrorLength = Infinity): string { + const packageName = escapeHtml((report.branch ?? report.main)!.path); const errors = [ ...(report.main ? [`Main error:\n${formatProjects(report.main)}${formatError(report.main, maxErrorLength)}`] : []), ...(report.branch ? [`Branch error:\n${formatProjects(report.branch)}${formatError(report.branch, maxErrorLength)}`] : []), ]; - return `
\n${report.title}\n\n${formatPackage((report.branch ?? report.main)!)}\n${errors.join("\n")}\n
`; + return `
\n${report.title} ${packageName}\n\n${formatPackage((report.branch ?? report.main)!)}\n${errors.join("\n")}\n
`; } export function getResultComments(main: Errors, branch: Errors, userToTag: string, logUrl: string): string[] { diff --git a/packages/dtslint-runner/test/results.test.ts b/packages/dtslint-runner/test/results.test.ts index 7830ebafc6..8ad94f97de 100644 --- a/packages/dtslint-runner/test/results.test.ts +++ b/packages/dtslint-runner/test/results.test.ts @@ -166,9 +166,9 @@ test("renders all three difference categories, retaining each side's links", () { path: "changed", error: "new", errorLinks: [{ start: 0, end: 3, url: branchUrl }] }, ], )!; - expect(comment).toContain("Branch only errors:"); - expect(comment).toContain("Main only errors:"); - expect(comment).toContain("Errors that changed between main and the branch:"); + expect(comment).toContain("Branch only errors: new"); + expect(comment).toContain("Main only errors: fixed"); + expect(comment).toContain("Errors that changed between main and the branch: changed"); expect(comment).toContain(`
old
`); expect(comment).toContain(`
new
`); expect(comment).toContain("
old failure
"); @@ -188,6 +188,7 @@ test("escapes diagnostic HTML and refuses non-DT links", () => { }, ], )!; + expect(comment).toContain("Branch only errors: <example>"); expect(comment).toContain("Package: <example>"); expect(comment).toContain("</pre><script>alert("oops")</script>\n```\n& <T>"); expect(comment).not.toContain("