Repository navigation
Remove obsolete backcompat handling - #12573
JoshLove01 wants to merge 8 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
commit: |
|
No changes needing a change description found. |
There was a problem hiding this comment.
🟡 Changes recommended
Obsolete-attribute reconciliation can leave duplicate attributes that break SDK compilation, and existing ClientModel tests still assert the removed behavior.
2 open issues
What changed in this PR
This PR updates the C# client generator so backward-compatible methods retain current deprecation metadata rather than inheriting the previous contract’s obsolete status.
Changes:
- Apply current
Obsoleteattributes to restored overloads and reordered methods. - Prefer visitor-supplied deprecation attributes over generated attributes.
- Update provider tests to expect current deprecation messages.
| File | Description |
|---|---|
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TypeProviderTests.cs |
Updates deprecation expectations for restored and reordered methods. |
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Utilities/BackCompatHelper.cs |
Copies current deprecation metadata to restored overloads. |
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/TypeProvider.cs |
Replaces prior-contract deprecation filtering with visitor-attribute precedence. |
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Repeated visitor-supplied Obsolete attributes remain duplicated on restored overloads, causing CS0579 compilation failures, and the regression test omits the main visitor pass that exposes the issue.
1 open issue
2 resolved since last review
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The restored overload can expose a different deprecation message or DiagnosticId because it selects the first visitor-added Obsolete attribute while the current method keeps the last, and the regression test cannot detect this mismatch.
1 open issue
1 resolved since last review
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The regression test’s filter excludes restored overloads from visitor attribute updates, leaving duplicate-attribute reconciliation on those overloads untested.
1 open issue
1 resolved since last review
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>


Summary
Obsoleteattributes from types, properties, existing methods, and restored methodsObsoleteprecedence while preventing duplicate attributesTesting
TypeProviderTests: 191 passedMicrosoft.TypeSpec.Generator.ClientModel.Tests: 2,780 passed