Skip to content

Suppress redundant [Stage] diff line for added/removed types in API diff comment - #38444

Merged
AndriySvyryd merged 2 commits into
mainfrom
copilot/fix-api-diff-experimental-label
Jun 18, 2026
Merged

AndriySvyryd merged 2 commits into
mainfrom
copilot/fix-api-diff-experimental-label

Conversation

Copilot AI commented Jun 17, 2026 •

Copy link
Copy Markdown
Contributor

The API diff comment emits a redundant + [Stage] Experimental line when a new experimental type is introduced — the type header already carries the [Experimental] tag (e.g. + [Experimental] MyType). The stage line is only meaningful when the stage of a pre-existing type changes.

Changes

  • In ApiModel.CreateTypeDelta, gate addedStage/removedStage on stageChanged (both currentType and baselineType present with differing stages) instead of also firing when one side is null. Added/removed types fall through to Stable, so AppendStageDiffLine no longer emits a line for them.

Resulting output

- + [Experimental] Microsoft.EntityFrameworkCore.Foo
- + [Stage] Experimental
+ + [Experimental] Microsoft.EntityFrameworkCore.Foo

Stage-change diffs on existing types are unaffected:

  Microsoft.EntityFrameworkCore.Foo
- [Stage] Experimental
+ [Stage] Stable

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates ApiChief’s delta-model generation so the markdown API diff no longer emits a redundant + [Stage] Experimental / - [Stage] Experimental line for newly added or removed experimental types, since the type header already carries the [Experimental] tag. Stage diff lines are intended to appear only when an existing type’s stage changes between baseline and current.

Changes:

  • In ApiModel.CreateTypeDelta, compute addedStage/removedStage only when the stage actually changed between baseline/current (both present and differing).
  • As a result, EmitDelta.AppendStageDiffLine will no longer print a [Stage] ... line for added/removed types whose stage isn’t changing (only their presence is).

Comment thread eng/Tools/ApiChief/Model/ApiModel.cs Resolved
Copilot AI requested a review from AndriySvyryd June 17, 2026 21:29
@AndriySvyryd
AndriySvyryd marked this pull request as ready for review June 17, 2026 21:38
@AndriySvyryd
AndriySvyryd requested a review from wtgodbe as a code owner June 17, 2026 21:38
Copilot AI review requested due to automatic review settings June 17, 2026 21:38
@AndriySvyryd
AndriySvyryd enabled auto-merge (squash) June 17, 2026 21:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@AndriySvyryd
AndriySvyryd merged commit 689ec65 into main Jun 18, 2026
14 checks passed
@AndriySvyryd
AndriySvyryd deleted the copilot/fix-api-diff-experimental-label branch June 18, 2026 17:06
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants