Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 23, 2025

Description

Analyzed custom code patterns across 17 migrated Management Plane Generator (MPG) services (85 custom files total) to document how and when to use custom code during migration from AutoRest to the new TypeSpec-based generator.

New Documentation

Location: eng/packages/http-client-csharp-mgmt/docs/CustomCodeUsageDuringMigration.md

Contents:

  • 16 customization patterns identified from production code:

    1. Model Factory Customizations (backwards compatibility, mocking)
    2. Missing Property Additions (spec gaps)
    3. Constructor Parameter Reordering (API compatibility)
    4. Custom Collection Operations (complex scenarios)
    5. Extension Method Customizations (resource operations)
    6. Mockable Resource Extensions (testing/DI)
    7. Custom Pageable Operations (pagination support)
    8. Custom REST Operations (spec/generator workarounds)
    9. Serialization Customizations (type handling)
    10. Abstract Base Class Modifications (constructor accessibility)
    11. Unknown Type Renaming (naming consistency)
    12. Operation Suppression (hiding operations)
    13. Internal Model Visibility (encapsulation)
    14. Patch Properties Customization (update operations)
    15. Enum Customizations (value extensions)
    16. Custom Collection Results (pagination logic)
  • Real code examples from: nginx, quota, storagesync, hardwaresecuritymodules, healthdataaiservices, paloaltonetworks.ngfw, storagemover, agricultureplatform, databasewatcher, deviceregistry, workloadorchestration, carbon, dellstorage, impactreporting, neonpostgres, portalservices, virtualenclaves

  • Best practices, file organization, common scenarios with solutions, migration checklist

Also updated: eng/packages/http-client-csharp-mgmt/docs/index.mdx to link new guide


This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

SDK Generation Guidelines

  • If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.
  • The generate.cmd file for the SDK has been updated with the version of AutoRest, as well as the commitid of your swagger spec or link to the swagger spec, used to generate the code.
  • The *.csproj and AssemblyInfo.cs files have been updated with the new version of the SDK.
Original prompt

This section details on the original issue you should resolve

<issue_title>Analyze Custom Code Usage in Migrated Management Plane Libraries</issue_title>
<issue_description>Description:
We need to analyze the purpose and necessity of custom code in services that have been migrated to the new Management Plane Generator (MPG). The list of migrated services can be found in the Library Inventory.

Task:
For each migrated service, perform the following analysis on its src

Identify Customizations: Locate the custom or customization folder.
Analyze Each File: For every custom code file found:
Delete the file.
Run the generation command: dotnet build /t:GenerateCode.
Run the build command: dotnet build.
Capture & Analyze: Note any generation or build errors that occur. Use these errors to deduce the specific functionality or gap the custom code is addressing.
Restore: Restore the deleted file before moving to the next one.
Deliverable:
After completing the analysis for all services, synthesize your findings into a comprehensive document explaining how to use custom code during MPG migration.

Output Location: Create a new documentation file in azure-sdk-for
-net/eng/packages/http-client-csharp-mgmt/docs`.

Content: The document should categorize common customization patterns, explain why they are needed, and provide examples based on the errors observed during the analysis.</issue_description>

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


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Analyze custom code usage in migrated management plane libraries Add comprehensive custom code usage guide for MPG migration Dec 23, 2025
Copilot AI requested a review from haiyuazhang December 23, 2025 10:09
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.

Analyze Custom Code Usage in Migrated Management Plane Libraries

2 participants