Skip to content

Add a json format for tools to read - #74

Merged
Mpdreamz merged 1 commit into
mainfrom
json-report
Nov 14, 2026
Merged

Mpdreamz merged 1 commit into
mainfrom
json-report

Conversation

@Mpdreamz

Copy link
Copy Markdown
Contributor

--format json writes api-changes.json: the suggested version change, the number of breaking changes, and each assembly's changes as a tree.

Prompt summary: The tool is being dusted off. The next steps post a comment and set release labels on pull requests, and a GitHub Action passes the suggested version on as an output. Each of those needs the result in a form a program can read, not console text to scrape.

Why

Every format was written for people. To find the suggested version, a script had to match [diff] Suggested version change: Minor on the console. Nothing machine-readable said which changes break.

What

One document for all assemblies

The top level holds suggestedVersionChange, breakingChanges, assemblies, removedAssemblies and addedAssemblies. Each assembly has its own suggestedVersionChange, breakingChanges and changes. A change has a kind (Type, Method, Property, Field, Event, Attribute, AssemblyReference or Declaration), a name as the other reports show it, a change (added, removed or modified) and the suggestedVersionChange it calls for on its own. A new abstract or required member also has addsObligation: true. Nested changes sit under changes.

The same rules as the comment

breakingChanges counts the changes that on their own call for Major, the count the GitHub comment shows. The writer uses Utf8JsonWriter without reflection, so it works in the native-AOT build: ./build.sh smokeaot passes.

Verify

mise run test
dotnet run -c Release -f net11.0 --project src/assembly-differ -- diff 'nuget|Proc|0.13.0|netstandard2.0' 'nuget|Proc|0.14.0|netstandard2.0' -t proc -f json

DiffCommandTests now snapshots every scenario in json too.

🤖 Generated with Claude Code

The reports were written for people; a tool that wanted the suggested
version or the breaking changes had to scrape the console. --format json
writes api-changes.json with the suggested version change, the number of
breaking changes, and every assembly's changes as a tree, each with the
version change it calls for.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Mpdreamz Mpdreamz added the feature A new capability (minor bump) label Nov 14, 2026
@Mpdreamz
Mpdreamz merged commit 17916d1 into main Nov 14, 2026
6 of 7 checks passed
@Mpdreamz
Mpdreamz deleted the json-report branch November 14, 2026 07:44
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