Hide obsolete Job summaries (#902)

- Injects a `<!-- gradle-job-summary: ${jobCorrelator} -->` marker on
each job summary
- Lists 100 last comments: unfortunately there is no API to specifically
filter for comments, and checking the last 100 comments (the limit) is
usually enough and does not require iterating over pages
- Mutate comments having this expected marker

I tried to add some tests, but I'm not familiar enough to setup a
complete test suite with proper mocking of GitHub/Octokit with jest.

I could potentially extract the `prComment` creation to check for the
marker presence, let me know.

Note: it seems like there is currently an issue on mutating comments as
`OUTDATED` through graphql. Although it does not work as expected
(flagging as OUTDATED) the comments are still minimized, which is what
we want.
- https://github.com/orgs/community/discussions/19865

Implements #176

---------

Co-authored-by: Daz DeBoer <daz@gradle.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Simon Marquis
2026-06-10 10:14:48 -06:00
committed by GitHub
co-authored by Daz DeBoer Claude Opus 4.8
parent a740661292
commit 318eed7038
4 changed files with 124 additions and 4 deletions
+4
View File
@@ -206,6 +206,10 @@ export class SummaryConfig {
return this.shouldAddJobSummary(this.getJobSummaryOption(), hasFailure)
}
canAddPRComment(): boolean {
return this.getPRCommentOption() !== JobSummaryOption.Never
}
shouldAddPRComment(hasFailure: boolean): boolean {
return this.shouldAddJobSummary(this.getPRCommentOption(), hasFailure)
}