-
Notifications
You must be signed in to change notification settings - Fork 65
Remove single service restriction arm #3572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| # Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking | ||
| changeKind: feature | ||
| packages: | ||
| - "@azure-tools/typespec-azure-resource-manager" | ||
| --- | ||
|
|
||
| Remove single service restriction for ARM specs |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1204,3 +1204,32 @@ it("recognizes resource with customResource identifier", async () => { | |
| `); | ||
| expectDiagnosticEmpty(diagnostics); | ||
| }); | ||
|
|
||
| describe("multiple services", () => { | ||
| it("assign resources to the correct service", async () => { | ||
| const { program } = await Tester.compile(` | ||
| @armProviderNamespace | ||
| namespace Microsoft.ServiceA { | ||
| model ResA is TrackedResource<{}> { | ||
| @key @segment("foos") @path name: string; | ||
| } | ||
| } | ||
|
|
||
| @armProviderNamespace | ||
| namespace Microsoft.ServiceB { | ||
| model ResB is TrackedResource<{}> { | ||
| @key @segment("foos") @path name: string; | ||
| } | ||
| } | ||
| `); | ||
|
|
||
| const resources = getArmResources(program); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there is a plan that we deprecate this API.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hhm maybe but this is what all the tests in this file are using and I don't think it will fully go away(at least internally) as this is just the low level accessor |
||
| expect(resources).toHaveLength(2); | ||
|
|
||
| const [ResA, ResB] = resources; | ||
| expect(ResA.name).toEqual("ResA"); | ||
| expect(ResA.armProviderNamespace).toEqual("Microsoft.ServiceA"); | ||
| expect(ResB.name).toEqual("ResB"); | ||
| expect(ResB.armProviderNamespace).toEqual("Microsoft.ServiceB"); | ||
| }); | ||
| }); | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so how would it behave if we have two parts with the same provider namespace but with different api version enum? this case happen in compute.
Do we have to do something like this?
and if we have to do it in the above way, we might not be able to just put them into the one client.tsp without changing their specs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah that would be how to do it I asssume playground