Skip to content

[http-client-csharp] Upgrade TypeSpec dependency - #11918

Merged
JoshLove-msft merged 5 commits into
microsoft:mainfrom
JoshLove-msft:joshlove-msft-csharp-spector-dependency-upgrade
Sep 10, 2026
Merged

[http-client-csharp] Upgrade TypeSpec dependency#11918
JoshLove-msft merged 5 commits into
microsoft:mainfrom
JoshLove-msft:joshlove-msft-csharp-spector-dependency-upgrade

Conversation

@JoshLove-msft

@JoshLove-msft JoshLove-msft commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Upgrade the complete TypeSpec dependency set for the C# emitter to the stable September releases, including matching peer declarations and the npm lockfile.

Dependencies Versions
Compiler, HTTP, OpenAPI, JSON Schema 1.16.0
Events, REST, SSE, Streams, Versioning, XML, library linter 0.86.0
Azure core and client-generator core (TCGC) 0.72.0
HTTP specs / Azure HTTP specs 0.1.0-alpha.43 / 0.1.0-alpha.45
Spec API / Spector / TSP documentation tools 0.1.0-alpha.17 / 0.1.0-alpha.29 / 0.77.1

All 18 TypeSpec/Azure development dependencies are upgraded together. Installation resolves without peer-dependency overrides. Newly published packages are resolved through the public Azure SDK npm feed.

Regenerated fixtures

Use the latest stable @typespec/http-specs release, 0.1.0-alpha.43, which includes the shared SSE ProtocolInfo model rename from #11920. The generated clients no longer need a C# name-collision customization. Remove the temporary customization and the generator, stub-library, and regression-test changes introduced solely to support it.

Regenerate the complete fixture set, including SSE protocol stubs and the new response/body-or-no-content fixture and launch profile. Wire contracts remain unchanged.

No C# or TypeSpec collision customization, shared TypeSpec import-helper changes, generator behavior changes, or streaming scenario test changes are included. New streaming scenario coverage remains in the separate PR.

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

pkg-pr-new Bot commented Sep 10, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 40d04f4

@github-actions

Copy link
Copy Markdown
Contributor

No changes needing a change description found.

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

It combines a dependency upgrade with large regenerated Spector artifacts and scripting/documentation changes, so it should receive final human verification (including end-to-end regen/test runs) before approval.

Pull request overview

This PR upgrades the packages/http-client-csharp test-spec dependency @typespec/http-specs to 0.1.0-alpha.42-dev.3 to bring in newer fixtures (notably SSE protocol fixtures and the new response/body-or-no-content fixture) while keeping the emitter pinned to the current TypeSpec/TCGC versions. It also updates the C# generator’s Spector regeneration flow to optionally include spec-local TypeSpec customizations via a customizations.tsp file, and documents that workflow.

Changes:

  • Bump @typespec/http-specs to 0.1.0-alpha.42-dev.3 (and update lockfile resolution accordingly).
  • Regenerate/introduce Spector test project artifacts for SSE protocol additions and the new response/body-or-no-content fixture, including a new launch profile.
  • Add optional customizations.tsp support to generation scripts and document how to use it.
File summaries
File Description
packages/http-client-csharp/package.json Updates devDependency on @typespec/http-specs to pick up new fixtures.
packages/http-client-csharp/package-lock.json Locks the upgraded @typespec/http-specs package to the resolved tarball and peer/dependency ranges.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/tspCodeModel.json Regenerated code model reflecting new SSE protocol fixtures and renamed model.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/src/Generated/StreamingSseModelFactory.cs Regenerated factory surface including ProtocolInfo.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/src/Generated/SseClient.cs Regenerated top-level client exposing the new Protocol sub-client.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/src/Generated/ProtocolData.cs New regenerated protocol data client for SSE protocol scenarios.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/src/Generated/Protocol.cs New regenerated protocol client with protocol streaming methods and sub-client access.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/src/Generated/Models/StreamingSseContext.cs Regenerated serialization context includes ProtocolInfo.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/src/Generated/Models/ProtocolInfo.Serialization.cs New regenerated serialization for ProtocolInfo.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/src/Generated/Models/ProtocolInfo.cs New regenerated model type ProtocolInfo.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/customizations.tsp New per-spec TypeSpec customization to rename Protocol.Info to ProtocolInfo for C# to avoid collisions.
packages/http-client-csharp/generator/TestProjects/Spector/http/response/body-or-no-content/tspCodeModel.json New code model fixture for “body or no content” responses.
packages/http-client-csharp/generator/TestProjects/Spector/http/response/body-or-no-content/src/Response.BodyOrNoContent.csproj New generated test project for the fixture.
packages/http-client-csharp/generator/TestProjects/Spector/http/response/body-or-no-content/src/Generated/schema/ConfigurationSchema.json New generated configuration schema for the fixture project.
packages/http-client-csharp/generator/TestProjects/Spector/http/response/body-or-no-content/src/Generated/ResponseBodyOrNoContentModelFactory.cs New generated model factory for the fixture project.
packages/http-client-csharp/generator/TestProjects/Spector/http/response/body-or-no-content/src/Generated/Models/ResponseBodyOrNoContentContext.cs New generated serialization context for the fixture project.
packages/http-client-csharp/generator/TestProjects/Spector/http/response/body-or-no-content/src/Generated/Models/BlobLayout.Serialization.cs New generated model serialization for BlobLayout.
packages/http-client-csharp/generator/TestProjects/Spector/http/response/body-or-no-content/src/Generated/Models/BlobLayout.cs New generated model type BlobLayout.
packages/http-client-csharp/generator/TestProjects/Spector/http/response/body-or-no-content/src/Generated/BodyOrNoContentClientSettings.cs New generated settings type for the fixture client.
packages/http-client-csharp/generator/TestProjects/Spector/http/response/body-or-no-content/src/Generated/BodyOrNoContentClientOptions.cs New generated client options type for the fixture client.
packages/http-client-csharp/generator/TestProjects/Spector/http/response/body-or-no-content/src/Generated/BodyOrNoContentClient.cs New generated client surface for the fixture operations.
packages/http-client-csharp/generator/TestProjects/Spector/http/response/body-or-no-content/Response.BodyOrNoContent.slnx New solution file for the fixture project.
packages/http-client-csharp/generator/TestProjects/Spector/http/response/body-or-no-content/Response.BodyOrNoContent.NuGet.targets New NuGet targets wiring for schema segments.
packages/http-client-csharp/generator/TestProjects/Spector/http/response/body-or-no-content/Configuration.json New generator configuration for the fixture project.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Properties/launchSettings.json Adds a launch profile for generating the new Spector fixture project.
packages/http-client-csharp/generator/docs/spector.md Documents the new customizations.tsp mechanism for C#-scoped TypeSpec customizations.
packages/http-client-csharp/eng/scripts/Generation.psm1 Updates generation command construction to include customizations.tsp via CLI --import when present.
Review details

Files not reviewed (1)

  • packages/http-client-csharp/package-lock.json: Generated file
  • Files reviewed: 11/27 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

Comment thread packages/http-client-csharp/generator/docs/spector.md Outdated
Upgrade all TypeSpec and Azure toolchain dependencies and matching peer declarations to the stable September releases. Keep SSE customizations and scenario generation out of the dependency PR.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 10, 2026 00:23

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 changes are limited to consistent dependency/version bumps in package.json and the corresponding lockfile update, with no additional code changes.

Review details
  • Files reviewed: 1/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Support namespace-qualified CodeGenType mappings, preserve used customization attributes in stubs, and regenerate fixtures for the full TypeSpec upgrade. Keep streaming scenario tests in their separate PR.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 10, 2026 01:18

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

It combines a broad dependency upgrade with large-scale regenerated fixture outputs and core generator behavior changes, which warrants final human validation despite added regression tests.

Review details
  • Files reviewed: 21/38 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 10, 2026 01:31

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

It combines a broad dependency upgrade with large regenerated fixture updates, which warrants human validation of downstream build/test results beyond the targeted unit tests included here.

Review details
  • Files reviewed: 20/37 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

…on workaround

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 10, 2026 19:39

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 dependency updates and corresponding regenerated Spector fixtures appear consistent with the stated upgrade targets and introduce no verified issues in the reviewed diffs.

Review details
  • Files reviewed: 8/24 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@JoshLove-msft
JoshLove-msft added this pull request to the merge queue Sep 10, 2026
Merged via the queue into microsoft:main with commit 9b8c51d Sep 10, 2026
30 checks passed
@JoshLove-msft
JoshLove-msft deleted the joshlove-msft-csharp-spector-dependency-upgrade branch September 10, 2026 21:15
JoshLove-msft added a commit to JoshLove-msft/typespec that referenced this pull request Sep 10, 2026
Merge Microsoft main after the dependency upgrade in microsoft#11918. Keep the PR limited to the seven SSE protocol scenario tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
pull Bot pushed a commit to jrcribb/cadl that referenced this pull request Sep 11, 2026
)

## Summary

Add the seven missing SSE protocol Spector tests: `WithEnvelope`,
`WithoutEnvelope`, `Id`, `InvalidId`, `Retry`, `InvalidRetry`, and
`Reconnect`. Assert exact event counts, types, and payloads, preserve
valid metadata, and ignore invalid ID/retry metadata. Reconnect is
explicit using `RequestOptions`: send `Last-Event-ID` from the first
event, then assert resumed event 2.

The diff against `main` is only `SseTests.cs` (+109 lines). Existing
JSONL and basic SSE tests are unchanged. This PR adds no generator,
dependency, or TypeSpec customization changes.

microsoft#11918 has merged, and this branch is synchronized with Microsoft `main`
at `9b8c51de8c15b6dc748ea9cf576d87f91ef058c4`. It uses the pinned
`@typespec/http-specs` `0.1.0-alpha.43` and native unique SSE model
names from microsoft#11920, without the temporary naming workaround.

## Validation

- Regenerated only JSONL and SSE runtime implementations against
alpha.43, then ran all 12 Streaming tests together: 12 passed, 0 failed,
0 skipped.
- All 12 Streaming Spector coverage entries pass. Retained the TRX and
coverage evidence.
- Regenerated both libraries back to stubs. Generated files and
dependency manifests match `main`, and no temporary C# customization or
generated stub `CodeGenTypeAttribute` remains.
- The main synchronization preserved the entire previously validated C#
emitter tree and pinned manifests unchanged. The post-sync stubbed
test-project build passed with 0 warnings and 0 errors; targeted
scenario whitespace formatting, manifest formatting, and emitter lint
passed. Cop checks passed on the identical C# source tree.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

3 participants