Skip to content

Skip C# back compatibility for previously released experimental types - #12159

Draft
Jorge Rangel (jorgerangel-msft) with Copilot wants to merge 14 commits into
mainfrom
copilot/consider-evaluating-experimental-types
Draft

Jorge Rangel (jorgerangel-msft) with Copilot wants to merge 14 commits into
mainfrom
copilot/consider-evaluating-experimental-types

Conversation

Copilot AI commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

C# back-compat handling currently preserves experimental APIs as stable contracts, restricting changes even when those types graduate to stable.

  • Contract lookup: Exclude released types carrying System.Diagnostics.CodeAnalysis.ExperimentalAttribute from the shared compatibility lookup, covering type-shape preservation and member restoration.
  • Compatibility boundaries: Base the decision on the previous release. Newly marking a stable type experimental does not remove its compatibility guarantees; member-level experimental handling remains unchanged.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
@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 Oct 12, 2026
Copilot AI changed the title [WIP] Consider evaluating experimental types for back compat handling Skip C# back compatibility for previously released experimental types Oct 12, 2026
@pkg-pr-new

pkg-pr-new Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 8e77a2f

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.

🟢 Approval recommended

The focused implementation matches the stated compatibility boundary and is comprehensively tested.

0 open findings

What changed in this PR

Prevents C# compatibility logic from preserving APIs on types that were experimental in the previous release.

Changes:

  • Filters experimental types from previous-contract lookup.
  • Adds coverage for classes and fixed/extensible enums.
  • Confirms current experimental status and unrelated attributes do not affect compatibility.
File Description
SourceInputModel.cs Excludes previously experimental types.
TypeProviderTests.cs Tests type compatibility boundaries.
Types.cs Provides type contract fixtures.
EnumProviderTests.cs Tests enum compatibility behavior.
Choice.cs (2 files) Provides fixed and extensible enum fixtures.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>

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.

🟢 Approval recommended

The implementation is narrowly scoped and comprehensively tests previous-versus-current experimental status across supported type shapes.

0 open findings

🧠 Review effort: Balanced

Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>

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.

🟡 Changes recommended

The implementation changes member-level compatibility despite the PR description explicitly preserving that boundary.

2 open findings
1 resolved since last review

🧠 Review effort: Balanced

Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>

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.

🔵 Needs a closer look

Member-level behavior contradicts the stated scope, and the documentation overstates fixed-enum handling.

0 open findings

2 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Medium severity Fixed enums can resurrect experimental members without filtering

packages/​http-client-csharp/​generator/​docs/​backward-compatibility.md:59

The member-level claim is not true for fixed enums: FixedEnumProvider.cs:129-180 iterates every historical field and can resurrect an experimental enum member without consulting this attribute. Since the PR description also says member handling is unchanged, remove these member-level guarantees; otherwise the fixed-enum path needs matching filtering and coverage.

🧠 Review effort: Balanced

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.

🔵 Needs a closer look

Member-level filtering contradicts the stated requirement that member-level experimental handling remain unchanged.

0 open findings

🧠 Review effort: Balanced

This branch has not been deployed

No deployments
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.

Consider Evaluating Experimental Types as Part of Back Compat Handling

3 participants