-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Clean up typespec issues in ACR #39031
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
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 |
|---|---|---|
|
|
@@ -9,29 +9,16 @@ using TypeSpec.Rest; | |
| using Azure.ResourceManager; | ||
| using TypeSpec.Http; | ||
| using TypeSpec.Versioning; | ||
| using TypeSpec.OpenAPI; | ||
|
|
||
| namespace Microsoft.ContainerRegistry; | ||
|
|
||
| // we must have this legacy operations right now because there is a virtual resource `Package` between `Achieve` and `Registry` | ||
| // but we did not decide about how to represent such scenarios with "virtual resources" therefore we leave this legacy operations here for now. | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| interface AchieveOperationOps | ||
| extends Azure.ResourceManager.Legacy.LegacyOperations< | ||
| { | ||
| ...ApiVersionParameter, | ||
| ...SubscriptionIdParameter, | ||
| ...ResourceGroupParameter, | ||
| ...Azure.ResourceManager.Legacy.Provider, | ||
|
|
||
| /** | ||
| * The name of the container registry. | ||
| */ | ||
| @path | ||
| @segment("registries") | ||
| @pattern("^[a-zA-Z0-9]*$") | ||
| @minLength(5) | ||
| @maxLength(50) | ||
| @doc("The name of the container registry.") | ||
| registryName: string, | ||
| ...ResourceInstanceParameters<Registry>, | ||
|
|
||
| /** | ||
| * The package type. | ||
|
|
@@ -58,40 +45,6 @@ interface AchieveOperationOps | |
| } | ||
| > {} | ||
|
|
||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| interface AchieveOps | ||
| extends Azure.ResourceManager.Legacy.LegacyOperations< | ||
| { | ||
| ...ApiVersionParameter, | ||
| ...SubscriptionIdParameter, | ||
| ...ResourceGroupParameter, | ||
| ...Azure.ResourceManager.Legacy.Provider, | ||
|
|
||
| /** | ||
| * The name of the container registry. | ||
| */ | ||
| @path | ||
| @segment("registries") | ||
| @pattern("^[a-zA-Z0-9]*$") | ||
| @minLength(5) | ||
| @maxLength(50) | ||
| @doc("The name of the container registry.") | ||
| registryName: string, | ||
|
|
||
| /** | ||
| * The package type. | ||
| */ | ||
| @path | ||
| @minLength(3) | ||
| @maxLength(50) | ||
| @pattern("^[a-zA-Z]*$") | ||
| @segment("packages") | ||
| @doc("The package type.") | ||
| packageType: string, | ||
| }, | ||
| {} | ||
| > {} | ||
|
Comment on lines
-61
to
-93
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. this is no longer used, because the operation that previously used this should not be using this in the first place. |
||
|
|
||
| /** | ||
| * An object that represents a archive for a container registry. | ||
| */ | ||
|
|
@@ -137,9 +90,10 @@ interface Archives { | |
| /** | ||
| * Lists all archives for the specified container registry and package type. | ||
| */ | ||
| @action("archives") | ||
| @list | ||
| list is AchieveOps.Read<Archive, Response = ArmResponse<ArchiveListResult>>; | ||
| list is AchieveOperationOps.List< | ||
| Archive, | ||
| Response = ArmResponse<ArchiveListResult> | ||
| >; | ||
|
Comment on lines
+93
to
+96
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. two issues: |
||
| } | ||
|
|
||
| @@maxLength(Archive.name, 200); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,29 +9,15 @@ using TypeSpec.Rest; | |
| using Azure.ResourceManager; | ||
| using TypeSpec.Http; | ||
| using TypeSpec.Versioning; | ||
| using TypeSpec.OpenAPI; | ||
|
|
||
| namespace Microsoft.ContainerRegistry; | ||
|
|
||
| // we must have this legacy operations right now because there is a virtual resource `Package` between `Achieve` and `Registry` | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| interface ArchiveVersionOperationOps | ||
| extends Azure.ResourceManager.Legacy.LegacyOperations< | ||
| { | ||
| ...ApiVersionParameter, | ||
| ...SubscriptionIdParameter, | ||
| ...ResourceGroupParameter, | ||
| ...Azure.ResourceManager.Legacy.Provider, | ||
|
|
||
| /** | ||
| * The name of the container registry. | ||
| */ | ||
| @path | ||
| @segment("registries") | ||
| @pattern("^[a-zA-Z0-9]*$") | ||
| @minLength(5) | ||
| @maxLength(50) | ||
| @doc("The name of the container registry.") | ||
| registryName: string, | ||
|
Comment on lines
-20
to
-34
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. same reason, simplification |
||
| ...ResourceInstanceParameters<Registry>, | ||
|
|
||
| /** | ||
| * The package type. | ||
|
|
@@ -69,50 +55,6 @@ interface ArchiveVersionOperationOps | |
| } | ||
| > {} | ||
|
|
||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| interface ArchiveVersionListOps | ||
| extends Azure.ResourceManager.Legacy.LegacyOperations< | ||
| { | ||
| ...ApiVersionParameter, | ||
| ...SubscriptionIdParameter, | ||
| ...ResourceGroupParameter, | ||
| ...Azure.ResourceManager.Legacy.Provider, | ||
|
|
||
| /** | ||
| * The name of the container registry. | ||
| */ | ||
| @path | ||
| @segment("registries") | ||
| @pattern("^[a-zA-Z0-9]*$") | ||
| @minLength(5) | ||
| @maxLength(50) | ||
| @doc("The name of the container registry.") | ||
| registryName: string, | ||
|
|
||
| /** | ||
| * The package type. | ||
| */ | ||
| @path | ||
| @segment("packages") | ||
| @minLength(3) | ||
| @maxLength(50) | ||
| @pattern("^[a-zA-Z]*$") | ||
| @doc("The package type.") | ||
| packageType: string, | ||
|
|
||
| /** | ||
| * The name of the archive resource. | ||
| */ | ||
| @path | ||
| @segment("archives") | ||
| @pattern("^[a-zA-Z0-9-]*$") | ||
| @minLength(5) | ||
| @maxLength(200) | ||
| @doc("The name of the archive resource.") | ||
| archiveName: string, | ||
| }, | ||
| {} | ||
| > {} | ||
|
Comment on lines
-72
to
-115
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. this is no longer used. |
||
| /** | ||
| * An object that represents an export pipeline for a container registry. | ||
| */ | ||
|
|
@@ -152,9 +94,7 @@ interface ArchiveVersions { | |
| /** | ||
| * Lists all archive versions for the specified container registry, repository type and archive name. | ||
| */ | ||
| @action("versions") | ||
| @list | ||
| list is ArchiveVersionListOps.Read< | ||
| list is ArchiveVersionOperationOps.List< | ||
|
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. change to fix its purpose - this is a list, not action or get. |
||
| ArchiveVersion, | ||
| Response = ArmResponse<ArchiveVersionListResult> | ||
| >; | ||
|
|
||
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.
I changed this to simplify. They exactly the same.