Skip to content

Put the report on the pull request: summary, comment and label - #77

Merged
Mpdreamz merged 1 commit into
mainfrom
pull-request
Nov 14, 2026
Merged

Mpdreamz merged 1 commit into
mainfrom
pull-request

Conversation

@Mpdreamz

Copy link
Copy Markdown
Contributor

A new pull-request command reads api-changes.json and puts it on the pull request a GitHub Actions run is for. It writes the job summary, keeps one comment up to date, and sets the release label the suggested change calls for.

Prompt summary: The tool is being dusted off. It needs a clear path to hooking it up to pull requests, and it should set labels. The label it sets is the one release-drafter turns into the next version, which closes the loop between an API change and its release.

Why

The GitHub Action ran the diff and stopped. Posting the github-comment file, finding the old comment and choosing a label was left to each repository's workflow, and nothing set a label from the suggested change.

What

One comment, kept up to date

The comment opens with a hidden marker, <!-- assembly-differ -->. A later run finds it and edits it, so a pull request never collects one comment per push. It shows the suggested change, the baseline when there is one, the number of breaking changes, and each assembly's changes as a nested list in a collapsed block. Past 60,000 characters it stops and says how many changes did not fit. The same text goes to GITHUB_STEP_SUMMARY.

Labels it owns, and only those

Major sets breaking, Minor sets feature, and Patch sets none. --major-label, --minor-label and --patch-label change that. The comment records which labels this tool set. A later run removes only those, so a label a person added stays, and a change that drops from Major to Minor swaps breaking for feature.

Forks and other runs

A read-only token, as on a pull request from a fork, gets 403 or 404. The command then writes the job summary, prints a warning and exits 0. Outside a pull request, with no number in GITHUB_EVENT_PATH and no --pull-request, it writes the summary only. If GitHub cannot be reached, it prints why and exits 1. Requests and responses use HttpClient and Utf8JsonWriter, so the native-AOT binary runs it.

Verify

mise run test
# PullRequestTests run the command against FakeGitHub, an in-memory GitHub API on localhost

Stack: 2 of 2, on top of #76.

🤖 Generated with Claude Code

@Mpdreamz Mpdreamz added the feature A new capability (minor bump) label Nov 14, 2026
Base automatically changed from baseline to main November 14, 2026 08:19
Getting a report onto a pull request took a hand-written workflow that
posted the comment and guessed the label. pull-request reads the json
report and writes the job summary, keeps one comment up to date, and sets
the release-drafter label the suggested change calls for, removing only
labels it set itself. Without write access, as on a fork's pull request,
it writes the summary, warns and succeeds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Mpdreamz
Mpdreamz merged commit 9cf0a2e into main Nov 14, 2026
6 checks passed
@Mpdreamz
Mpdreamz deleted the pull-request branch November 14, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature A new capability (minor bump)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant