Add C# emitter regression coverage for model-level API version filtering - #11949
Open
JoshLove-msft with Copilot wants to merge 2 commits into
Open
Add C# emitter regression coverage for model-level API version filtering#11949JoshLove-msft with Copilot wants to merge 2 commits into
JoshLove-msft with Copilot wants to merge 2 commits into
Conversation
|
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. |
4 tasks
Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix unexpected versioning behavior in http-client-csharp emitter
Add C# emitter regression coverage for model-level API version filtering
Sep 11, 2026
JoshLove-msft
marked this pull request as ready for review
September 11, 2026 23:43
JoshLove-msft
requested review from
Jorge Rangel (jorgerangel-msft),
Jose Arriaga Maldonado (joseharriaga),
Jesse Squire (jsquire) and
m-nash
as code owners
September 11, 2026 23:43
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The undefined case does not exercise the shipped emitter’s default version selection.
Pull request overview
Adds C# emitter regression coverage for model- and property-level API version filtering without production changes.
Changes:
- Tests explicit, latest, and default version selection.
- Verifies model
@added/@removedand property@addedbehavior. - Covers unreferenced models.
File summaries
| File | Description |
|---|---|
packages/http-client-csharp/emitter/test/Unit/client-model-builder.test.ts |
Adds API-version filtering regression tests. |
Review details
Suppressed comments (1)
packages/http-client-csharp/emitter/test/Unit/client-model-builder.test.ts:610
- The
undefinedcase does not exercise the emitter's default selection: this test callscreateSdkContextdirectly, while the shipped emitter first runsresolveOptions(src/emitter.ts:50), wheredefaultOptionssuppliesapi-version: "latest"(src/options.ts:168-191). As written, it tests TCGC with an explicitly undefined option rather than the C# emitter default; resolve the options or drive the emitter entrypoint for this case.
const context = createEmitterContext(program, { "api-version": apiVersion });
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
commit: |
JoshLove-msft
approved these changes
Sep 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The reported behavior emitted models marked
@added(v2)when targeting v1, despite correctly excluding v2 properties. The current implementation already filters both correctly; this PR adds regression coverage without changing production code.@addedand@removed, alongside property-level@added.@usageso assertions exercise version filtering rather than omission of unused types.