Skip to content

[V4] Add thread safety note to service clients docs#4402

Merged
dscpinheiro merged 2 commits intodevelopmentfrom
dspin/gh-2098
May 4, 2026
Merged

[V4] Add thread safety note to service clients docs#4402
dscpinheiro merged 2 commits intodevelopmentfrom
dspin/gh-2098

Conversation

@dscpinheiro
Copy link
Copy Markdown
Contributor

Resolves #2098

Motivation and Context

Adds a note to all generated service clients about thread safety, and also a recommendation to create a single instance and re-use it for the application's lifetime.

Message will be displayed below Implementation for accessing ... and before the service documentation.

Before:
image

After:
image

Dry-runs

  • DotNet Dry-run ID: DRY_RUN-bbfbe4df-8583-4af9-9a63-86f47e14998c
    • Completed successfully
  • PowerShell Dry-run ID: DRY_RUN-7a9d6e52-d701-46db-a73e-37d555bb4198
    • Completed successfully

Breaking Changes Assessment

N/A

License

  • I confirm that this pull request can be released under the Apache 2 license

Copilot AI review requested due to automatic review settings May 4, 2026 14:27
@dscpinheiro dscpinheiro requested review from a team as code owners May 4, 2026 14:27
@dscpinheiro dscpinheiro requested review from muhammad-othman and peterrsongg and removed request for a team May 4, 2026 14:27
@dscpinheiro dscpinheiro changed the title [V4] Add thread safety to service clients [V4] Add thread safety note to service clients docs May 4, 2026
Copy link
Copy Markdown
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 PR updates the service client generator so all generated V4 service client classes include an XML documentation note stating that client instances are thread-safe and recommending reuse.

Changes:

  • Added a thread-safety/reuse <para> block to the generated service client class summary documentation.
  • Regenerated the T4 preprocessed output for BaseGenerator to include the new doc block.
  • Added a DevConfig entry describing the change for release/changelog processing.

Reviewed changes

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

File Description
generator/ServiceClientGeneratorLib/Generators/BaseGenerator.tt Adds the new thread-safety/reuse note to the generated service client XML docs.
generator/ServiceClientGeneratorLib/Generators/BaseGenerator.cs Updated preprocessed T4 output to reflect the template change (also includes environment/version/path churn).
generator/.DevConfigs/6e10e7e5-61f3-4259-937f-340f2f9c93b3.json DevConfig metadata to capture the change in release notes.

Comment thread generator/ServiceClientGeneratorLib/Generators/BaseGenerator.tt Outdated
Comment thread generator/ServiceClientGeneratorLib/Generators/BaseGenerator.cs
Comment thread generator/ServiceClientGeneratorLib/Generators/BaseGenerator.cs
@dscpinheiro dscpinheiro merged commit 7606821 into development May 4, 2026
6 checks passed
@dscpinheiro dscpinheiro deleted the dspin/gh-2098 branch May 4, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants