Skip to content

Conversation

@azure-sdk
Copy link
Collaborator

Generated by branded - http-client-csharp-mgmt build 20251107.1
Triggered from branch: main

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 PR updates the Azure Management TypeSpec generator version and applies generated code changes from that update. The changes include alphabetical reordering of attributes and an optimization of the URI building logic to use a single StringBuilder for both path and query string construction.

  • Updated Azure Management TypeSpec generator dependency to version 1.0.0-alpha.20251107.1
  • Refactored ClientUriBuilder to consolidate path and query string building into a single StringBuilder
  • Alphabetized ModelReaderWriterBuildable attributes in AzureAIProjectsContext

Reviewed Changes

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

File Description
AzureAIProjectsContext.cs Reordered ModelReaderWriterBuildable attributes alphabetically (Paged* types moved before Unknown* types)
ClientUriBuilder.cs Refactored to use single StringBuilder for path and query string construction with path length tracking
azure-typespec-http-client-csharp-mgmt-emitter-package.json Updated generator dependency version from 1.0.0-alpha.20251105.3 to 1.0.0-alpha.20251107.1
azure-typespec-http-client-csharp-mgmt-emitter-package-lock.json Updated lock file to match new generator version and integrity hash
Files not reviewed (1)
  • eng/azure-typespec-http-client-csharp-mgmt-emitter-package-lock.json: Language not supported

UriBuilder.Query = PathAndQuery.ToString(_pathLength + 1, PathAndQuery.Length - _pathLength - 1);
}
if (_queryBuilder != null)
if (PathAndQuery.Length == _pathLength)
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

The else if construct would be more appropriate here since the conditions are mutually exclusive (PathAndQuery.Length can't be both > _pathLength and == _pathLength simultaneously). This would make the intent clearer and avoid unnecessary condition evaluation.

Suggested change
if (PathAndQuery.Length == _pathLength)
else if (PathAndQuery.Length == _pathLength)

Copilot uses AI. Check for mistakes.
value = Uri.EscapeDataString(value);
}
if (PathBuilder.Length > 0 && PathBuilder[PathBuilder.Length - 1] == '/' && value[0] == '/')
if (_pathLength > 0 && PathAndQuery[_pathLength - 1] == '/' && value[0] == '/')
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

Missing null or empty check for the value parameter before accessing value[0]. If an empty string is passed, this will throw an IndexOutOfRangeException.

Copilot uses AI. Check for mistakes.
@live1206 live1206 closed this Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants