feat(ci): publish build-matrix results as a sticky PR comment#36
Merged
Conversation
Add a `matrix-comment` job to `csharp-ci.yaml` and `scala-ci.yaml` (`needs: build-and-test`, `if: always()`) that queries the run's per-shard job outcomes via the GitHub API and upserts a `shard | result | duration` table via marocchino/sticky-pull-request-comment under a `<artifact-prefix>-build-matrix` header, distinct from the coverage comment. No-ops without `build-matrix`, on non-PR events, and for dependabot. Rendering is done by a new, unit-tested `scripts/render_matrix_comment.py`.
…celled() Restore the `## [2.3.4] - 2026-07-10` release heading and its Fixed block (#30, #32) that the previous commit accidentally folded under [Unreleased]; keep only the #21 Added bullet in [Unreleased]. Change the matrix-comment job's `if` from `always()` to `!cancelled()` in csharp-ci.yaml and scala-ci.yaml so it still runs on shard failure (fail-fast is false) but does not post a wall of cancelled shards on a manual run cancellation.
Signed-off-by: monsieurleberre <monsieurleberre@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #21.
Summary
csharp-ci.yaml@v2andscala-ci.yaml@v2support an OS × archbuild-matrix, but per-shard results were only visible in the PR checks panel. This adds amatrix-commentaggregator job to both reusable workflows that posts the shard results as a sticky PR comment.Details
matrix-commentjob:needs: build-and-test,if: ${{ !cancelled() && inputs.build-matrix != '' && github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' }}. It renders even when a shard fails (the case where the table is most useful), and no-ops when nobuild-matrixis passed, on non-PR events, and for dependabot.gh api --paginate .../actions/runs/${GITHUB_RUN_ID}/jobs, then upserts ashard | result | durationmarkdown table (each shard links to its job) viamarocchino/sticky-pull-request-comment— same pin as the coverage comment, under a distinct<artifact-prefix>-build-matrixheader so it never clobbers the coverage comment.scripts/render_matrix_comment.py(new): self-anchors on the aggregator's own job name to isolate its shards from sibling reusable-workflow jobs sharinggithub.run_id; fails loud on unknown conclusions, a missing/duplicate self-job, or no shards. Helpers checked out atjob.workflow_sha(no bare local action path).test/render_matrix_comment_test.py(new): 10 hermetic tests — sorting, links, durations, sibling-workflow isolation, paginated parsing, and every loud-failure path. Auto-discovered by thebuild-and-testself-test job.Verification
actionlintclean on both workflows; fullpython3 -m unittest discover= 62 pass.## [2.3.4]release heading) — now restored, CHANGELOG diff is a pure### Addedaddition — and recommendedalways()→!cancelled(), applied in follow-up commitf591ced. It approved the self-anchoring design and thebuild-matrix != ''gating as-is.Follow-up (not in scope for #21)
A multi-shard
os-listrun (nobuild-matrix) intentionally gets no comment per the issue's literal scope; keying the gate on computed matrix length instead could be a future enhancement if the table is wanted there too.