Disambiguate default legacy resource names - #5247
Draft
Dapeng Zhang (ArcturusZhang) wants to merge 2 commits into
Draft
Disambiguate default legacy resource names#5247Dapeng Zhang (ArcturusZhang) wants to merge 2 commits into
Dapeng Zhang (ArcturusZhang) wants to merge 2 commits into
Conversation
Cover the Compute pattern where VirtualMachineRunCommand is reused across virtual machine and VMSS VM parent paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 10e564a2-4523-48ae-821e-a1c3e878765f
commit: |
Contributor
|
❌ There is undocummented changes. Run The following packages have changes but are not documented.
Show changes |
Contributor
📦 Package size report1 package changed size, +1.33 KB (+0.0%) packed overall.
12 package(s) with no notable change
Packed = gzipped |
Contributor
|
You can try these changes here
|
Avoid duplicate default resource names when distinct legacy resource identities share the same last two resource type segments. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 10e564a2-4523-48ae-821e-a1c3e878765f
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.
Summary
Fixes #5251 by disambiguating implicit default legacy resource names only when distinct resolved resources would otherwise collide.
The Compute run-command case now keeps distinct names for both preserved resource identities:
Microsoft.Compute/virtualMachines/runCommands->VirtualMachinesRunCommandsMicrosoft.Compute/virtualMachineScaleSets/virtualMachines/runCommands->VirtualMachineScaleSetsVirtualMachinesRunCommandsExplicit resource names are preserved. Non-colliding default names keep existing behavior.
Validation
pnpm exec prettier --write packages/typespec-azure-resource-manager/src/resource.ts packages/typespec-azure-resource-manager/test/resource-resolution.test.tspnpm exec vitest run test/resource-resolution.test.tspnpm --filter @azure-tools/typespec-azure-resource-manager lint