Skip to content

Conversation

@kazrael2119
Copy link
Member

@azure-sdk
Copy link
Collaborator

azure-sdk commented Dec 25, 2025

❌ There is undocummented changes. Run chronus add to add a changeset or click here.

The following packages have changes but are not documented.

  • @azure-tools/typespec-client-generator-core

The following packages have already been documented:

  • @azure-tools/azure-http-specs
Show changes

@azure-tools/azure-http-specs - fix ✏️

add nested test cases for client-initialization

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 25, 2025

Open in StackBlitz

npm i https://pkg.pr.new/Azure/typespec-azure/@azure-tools/azure-http-specs@3697
npm i https://pkg.pr.new/Azure/typespec-azure/@azure-tools/typespec-client-generator-core@3697

commit: 7cbffcc

@azure-sdk
Copy link
Collaborator

azure-sdk commented Dec 25, 2025

You can try these changes here

🛝 Playground 🌐 Website

@kazrael2119 kazrael2119 marked this pull request as ready for review December 29, 2025 06:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request refactors the client-initialization test cases from a flat structure into a nested directory structure, adding comprehensive test coverage for different client initialization patterns. The changes address issue #3405 by organizing test scenarios into three distinct categories: default, individually, and individuallyParent initialization behaviors.

Changes:

  • Removed the monolithic mockapi.ts file and reorganized test cases into three subdirectories
  • Added new test scenarios for individually-initialized and individually-parent-initialized clients
  • Updated routing paths and namespace definitions to reflect the new nested structure

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/azure-http-specs/specs/azure/client-generator-core/client-initialization/mockapi.ts Deleted the original flat mockapi.ts file
packages/azure-http-specs/specs/azure/client-generator-core/client-initialization/default/mockapi.ts Created mock API definitions for default client initialization scenarios
packages/azure-http-specs/specs/azure/client-generator-core/client-initialization/default/main.tsp Added service interface definitions for default initialization patterns
packages/azure-http-specs/specs/azure/client-generator-core/client-initialization/default/client.tsp Defined client interfaces with default initialization behavior, including new QueryParam scenario
packages/azure-http-specs/specs/azure/client-generator-core/client-initialization/individually/mockapi.ts Created mock API definitions for individually-initialized client scenarios
packages/azure-http-specs/specs/azure/client-generator-core/client-initialization/individually/main.tsp Added service interface definitions for individual initialization patterns
packages/azure-http-specs/specs/azure/client-generator-core/client-initialization/individually/client.tsp Defined client interfaces with individually initialization behavior
packages/azure-http-specs/specs/azure/client-generator-core/client-initialization/individuallyParent/mockapi.ts Created mock API definitions for individually-parent-initialized client scenarios
packages/azure-http-specs/specs/azure/client-generator-core/client-initialization/individuallyParent/main.tsp Added service interface definitions for individually-parent initialization patterns
packages/azure-http-specs/specs/azure/client-generator-core/client-initialization/individuallyParent/client.tsp Defined client interfaces with both individual and parent initialization behavior (incomplete - missing ParamAlias scenario)
.chronus/changes/nested-test-cases-for-clientinit-2025-11-25-9-26-9.md Added changelog entry documenting the fix

@weidongxu-microsoft
Copy link
Member

I've requested Copilot review. If comment is not valid, feel free to resolve them.

blobName: string;
}

model DefaultQueryParamClientOptions {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wonder why do we need Default prefix here but not for other ClientOptions?

name: string;
}

model DefaultQueryParam {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we call it BlobQueryParam?

@global.Azure.ClientGenerator.Core.clientInitialization({
parameters: DefaultQueryParamClientOptions,
})
@route("/query")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to define the @route again?

```
""")
@scenario
@global.Azure.ClientGenerator.Core.client({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use @@global.Azure.ClientGenerator.Core.client(Service.QueryParam, {name: "QueryParamClient", service: Service})?

@microsoft-github-policy-service microsoft-github-policy-service bot added the lib:tcgc Issues for @azure-tools/typespec-client-generator-core library label Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lib:tcgc Issues for @azure-tools/typespec-client-generator-core library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[epic] issues found when adding spector test cases for clientInitialization

4 participants