Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 21, 2025

Rename Etag to ETag in management plane generator

  • Understand the current property naming behavior in NameVisitor.cs
  • Add logic to rename Etag properties to ETag in DoPreVisitProperty methods
  • Create test case to verify the Etag to ETag renaming
  • Build and test the changes to ensure they work correctly
  • Generate test projects to validate the changes
  • Refactor to use dictionary for extensibility
  • Organize code by moving dictionary closer to its usage

Summary of changes:

  • Introduced _propertyNameRenamingMap dictionary to hold property name renaming mappings (currently mapping "Etag" -> "ETag")
  • Renamed DoPreVisitPropertyForEtagPropertyName to DoPreVisitPropertyNameRenaming for generic extensibility
  • Refactored method to use dictionary lookup instead of hardcoded string comparison
  • Moved dictionary declaration to be right before the method that uses it for better code organization
  • This design allows easy addition of more property name transformations in the future
  • Added unit test TestTransformEtagToETag to verify the renaming behavior
  • All existing tests continue to pass
  • Generated test projects successfully build with the new changes
Original prompt

This section details on the original issue you should resolve

<issue_title>rename Etag to ETag in new mpg generator</issue_title>
<issue_description></issue_description>

<agent_instructions>In NameVisitor.cs, we can apply the logic to rename Etag to Etag for perperties. </agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes #53392


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Rename Etag to ETag in new mpg generator Rename Etag to ETag in management plane generator Oct 21, 2025
Copilot AI requested a review from live1206 October 21, 2025 10:21
Copilot finished work on behalf of live1206 October 21, 2025 10:21
Copilot AI requested a review from live1206 October 22, 2025 03:06
Copilot finished work on behalf of live1206 October 22, 2025 03:06
@live1206 live1206 marked this pull request as ready for review October 22, 2025 03:08
Copilot AI review requested due to automatic review settings October 22, 2025 03:08
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 renames Etag properties to ETag in the management plane generator to follow proper capitalization conventions. The implementation uses a dictionary-based approach for extensibility, allowing future property name transformations to be easily added.

Key Changes:

  • Introduced _propertyNameRenamingMap dictionary to centralize property name transformations
  • Added DoPreVisitPropertyNameRenaming method to handle property renaming using dictionary lookups
  • Added unit test to verify the Etag → ETag transformation

Reviewed Changes

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

File Description
eng/packages/http-client-csharp-mgmt/generator/Azure.Generator.Management/src/Visitors/NameVisitor.cs Added dictionary-based property renaming infrastructure and method to transform Etag to ETag
eng/packages/http-client-csharp-mgmt/generator/Azure.Generator.Management/test/NameVisitorTests.cs Added test case to verify Etag property is renamed to ETag

Copilot AI requested a review from live1206 October 22, 2025 03:17
Copilot finished work on behalf of live1206 October 22, 2025 03:17
@live1206
Copy link
Member

/check-enforcer override

@live1206 live1206 merged commit e773d19 into main Oct 24, 2025
22 checks passed
@live1206 live1206 deleted the copilot/rename-etag-to-etag branch October 24, 2025 05:52
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.

rename Etag to ETag in new mpg generator

4 participants