Skip to content

Suggest the version change semantic versioning calls for - #69

Merged
Mpdreamz merged 2 commits into
mainfrom
version-change
Nov 14, 2026
Merged

Mpdreamz merged 2 commits into
mainfrom
version-change

Conversation

@Mpdreamz

Copy link
Copy Markdown
Contributor

The suggested version change now follows semantic versioning: additions suggest Minor, an unchanged API suggests None, and only a change existing code has to act on suggests Major.

Prompt summary: The tool is being dusted off, and its suggested version change is what the pull request labels will be based on. Today every diff with a change suggests Major, so the suggestion has to be right before anything builds on it.

Why

SuggestedVersionChange looked only at the assembly's direct children, the modules, and a module with any change counts as modified, so every change suggested Major (#58, #28). An unchanged API suggested Patch, so --prevent-change patch failed with exit code 4 on a build that changed nothing.

What

Classified over the whole tree

The suggestion walks every difference and takes the largest. A removed type or member, or a breaking declaration change, is Major. A new type or member, or a compatible change such as a member becoming more visible, is Minor. A dropped assembly reference is Patch, and no difference at all is None.

New members that existing code must act on

A new abstract member, which includes an interface member without a default implementation, is Major, because every implementer has to add it. So is a new required member, because every object initializer has to set it. The engine marks these on the new member's diff item; the reports do not change.

Attributes

An added or removed attribute, such as [Obsolete], is Minor. The compiler's own bookkeeping attributes in System.Runtime.CompilerServices are Patch: with nullable annotations on, the compiler moves NullableContextAttribute whenever members change. The property test for additions found that case. Before this change, it made a pure addition Major.

Verify

mise run test
dotnet run -c Release -f net11.0 --project src/assembly-differ -- diff 'nuget|Proc|0.12.0|netstandard2.0' 'nuget|Proc|0.13.0|netstandard2.0' -t proc
# [diff] Suggested version change: Minor

The snapshots change only in their suggested version and in the exit codes of Prevent_change_sets_the_exit_code. The XML and the other reports are unchanged. The property Only_adding_is_minor is no longer skipped.

Breaking: A build that runs --prevent-change minor or major now fails less often, since additions are no longer Major. A build that parses the last line sees None for an unchanged API instead of Patch.

🤖 Generated with Claude Code

Every diff with a change suggested Major, because the module itself
counted as modified, and an unchanged API suggested Patch, which failed
--prevent-change patch. Additions now suggest Minor, assembly reference
changes Patch, and an unchanged API None; a new abstract, interface or
required member is Major, because existing code has to change for it.

Fixes #58, fixes #28.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Mpdreamz Mpdreamz added the bug A defect fixed (patch) label Nov 14, 2026
Proc 0.20.0 only adds members to 0.17.0, so Minor is the right answer;
Major was the bug this branch fixes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Mpdreamz
Mpdreamz merged commit c420db9 into main Nov 14, 2026
6 checks passed
@Mpdreamz
Mpdreamz deleted the version-change branch November 14, 2026 07:21
Mpdreamz added a commit that referenced this pull request Nov 14, 2026
The `github-comment` format now counts the breaking changes it marks,
the assemblies it scanned, and each assembly's own differences.

**Prompt summary:** The tool is being dusted off, and its GitHub comment
is about to be posted on pull requests. Its summary contradicts the
details below it, so it has to be right first.

## Why
Without `--prevent-change`, the summary always said `+ 0 breaking
change(s) detected.`, even above changes it marked 💥. It counted only
changes matching the prevent level, and the default level matched none.
It always said `Scanned: 📑 1 assemblies(s)`, and every assembly's
details said "Click here to see the N differences" with the total of all
assemblies.

## What

#### Breaking means what the suggestion means
A change counts as breaking when it alone calls for a `Major` version,
the rule the suggested version uses since
[#69](#69). A removed
member, a changed signature, and a new interface or `required` member
count. A moved `NullableContextAttribute` does not. A modified member is
not counted on top of the change inside it. Across the 100 corpus seeds,
a suggestion is `Major` exactly when the comment counts a breaking
change.

#### Counts per comment and per assembly
The summary names the number of assemblies scanned and the number with
breaking changes, as "1 assembly" or "3 assemblies". Each assembly's
details count only that assembly's differences.

## Verify
```bash
mise run test
```

The snapshots change only in their `github-comment` sections.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug A defect fixed (patch)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant