Skip to content

Support XML ApiCompat baselines in C# generator#11395

Open
JoshLove-msft wants to merge 1 commit into
microsoft:mainfrom
JoshLove-msft:joshlove/apicompat-baseline-xml
Open

Support XML ApiCompat baselines in C# generator#11395
JoshLove-msft wants to merge 1 commit into
microsoft:mainfrom
JoshLove-msft:joshlove/apicompat-baseline-xml

Conversation

@JoshLove-msft

Copy link
Copy Markdown
Contributor

Summary

  • support modern XML ApiCompat suppression baselines while retaining legacy text baseline support
  • recognize CP0001 type and CP0002 member removals, including constructors, accessors, generic methods, and nested types
  • prefer XML when both baseline formats exist and ignore parameter-name suppressions that do not require API resurrection

This is required by Azure/azure-sdk-for-net#61353, which migrates the repository baselines to XML.

Validation

  • dotnet test ...Microsoft.TypeSpec.Generator.Tests.csproj --filter FullyQualifiedName~ApiCompatBaselineTests (28 passed)
  • stacked the change on the exact @typespec/http-client-csharp@1.0.0-alpha.20260722.4 generator embedded by Azure.ResourceManager.AppService in Replace legacy ApiCompat build integration Azure/azure-sdk-for-net#61353; regeneration produced no tracked SDK diffs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 883420ab-f215-4afc-91a2-3433270335bb
@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp label Jul 24, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 24, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-client-csharp@11395

commit: 66771e8

@github-actions

Copy link
Copy Markdown
Contributor

No changes needing a change description found.

}

[Test]
public void ParsesXmlSuppressions()

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.

minor nit: it would be great if we could get parity with any existing baseline tests we have using the .txt extension. maybe as a follow up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants