MPG migration SDK - Billing#59328
Open
mzhongl524 wants to merge 5 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR starts migrating Azure.ResourceManager.Billing to the TypeSpec-based management-plane generator by pinning the spec location/commit and removing the AutoRest dependency toggle from the project file.
Changes:
- Added
tsp-location.yamlto pin the Billing TypeSpec directory and spec commit SHA. - Removed
<IncludeAutorestDependency>true</IncludeAutorestDependency>from the Billing SDK project to stop pulling AutoRest tooling.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| sdk/billing/Azure.ResourceManager.Billing/tsp-location.yaml | Adds TypeSpec spec repo/directory/commit pin and emitter package path. |
| sdk/billing/Azure.ResourceManager.Billing/src/Azure.ResourceManager.Billing.csproj | Removes AutoRest dependency flag to align with TypeSpec-based codegen. |
…ta.1)
Major migration from AutoRest/Swagger to TypeSpec-based code generation using
the http-client-csharp-mgmt emitter:
- Updated tsp-location.yaml to point at the pr-billing-mpg branch in the spec repo
- Bumped package version to 2.0.0-beta.1 (major) and updated CHANGELOG
- ApiCompatVersion left empty for this migration; surface is rebuilt and breaking
changes are documented in CHANGELOG.md
- Regenerated entire Generated/ tree from TypeSpec
- Added Custom partial classes to work around generator quirks:
* BillingAccountPolicyResource / BillingProfilePolicyResource: re-expose
Update/UpdateAsync as wrappers over CreateOrUpdate (the tag boilerplate
expects Update but the resource only has CreateOrUpdate)
* BillingTransferDetailsResource / PartnerTransferDetailsResource: replace
the wrongly-typed generator-emitted Update(...,Data,...) with an overload
that throws NotSupportedException, because the underlying op is
"initiate" and uses a different request payload
* BillingRequestContentHelper: provide IEnumerable<T>.ToRequestContent and
DateTimeOffset.ToRequestContent helpers that the generator currently
emits as invalid C#
- post-regen-patch.ps1: deterministic post-regeneration script that patches the
remaining generator quirks (IEnumerable<T>.ToRequestContent call sites,
DateTimeOffset.ToRequestContent call sites, SubscriptionRenewalTermDetails
TermDuration TimeSpan -> string, BillingExtensions XML cref repairs). Run
after each regeneration.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Point tsp-location.yaml at the post-merge spec commit 69d49addebe83e54eec8fc6d994e6fe957f20d89 which contains the MPG wrapper-resource additions required to work around the generator's shared-resource LRO bug, together with the client.tsp customizations for the Billing MPG migration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Point tsp-location.yaml at the latest pr-billing-mpg spec commit: 462da3cc9c9f67e06109e96f23f2c7e21608bc0b That commit carries the partial MPG scaffolding (tspconfig + client.tsp + the PaymentMethod 4th-arg friendly-name override + the SavingsPlanModelListResult extends->spread normalization). All changes there have 0 openapi.json delta vs Azure/azure-rest-api-specs main. The migration itself remains blocked by codegen bug Azure#59362 (KeyNotFoundException in BuildLroHandling when multiple ResourceClientProviders share one ResourceData type and at least one has an LRO operation). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed: #58564
TSP PR: Azure/azure-rest-api-specs#43330
Use the new code generator to generate SDK code from TSP.
Contributing to the Azure SDK
Please see our CONTRIBUTING.md if you are not familiar with contributing to this repository or have questions.
For specific information about pull request etiquette and best practices, see this section.