-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[ServiceLinker] SDK validation for TypeSpec #52773
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?
Conversation
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
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.
Pull Request Overview
This PR updates the Azure ServiceLinker SDK to validate TypeSpec specification changes, updating from swagger-based to TypeSpec-based generation while maintaining backward compatibility for breaking changes.
- Updates autorest configuration to reference the latest TypeSpec specification
- Replaces manual directive transformations with rename-mapping configurations
- Adds custom compatibility classes to prevent breaking changes from VnetSolution and SecretStore model updates
Reviewed Changes
Copilot reviewed 4 out of 146 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| autorest.md | Updates spec reference and replaces directives with rename-mappings for TypeSpec compatibility |
| LinkerResourcePatch.cs | Adds backward-compatible properties for VnetSolution and SecretStore changes |
| LinkerResourceData.cs | Mirrors compatibility properties from LinkerResourcePatch for consistency |
| ArmServiceLinkerModelFactory.cs | Provides factory methods supporting the deprecated property signatures |
sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Custom/Models/LinkerResourcePatch.cs
Show resolved
Hide resolved
sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Custom/LinkerResourceData.cs
Show resolved
Hide resolved
...servicelinker/Azure.ResourceManager.ServiceLinker/src/Custom/ArmServiceLinkerModelFactory.cs
Outdated
Show resolved
Hide resolved
...servicelinker/Azure.ResourceManager.ServiceLinker/src/Custom/ArmServiceLinkerModelFactory.cs
Outdated
Show resolved
Hide resolved
...servicelinker/Azure.ResourceManager.ServiceLinker/src/Custom/ArmServiceLinkerModelFactory.cs
Outdated
Show resolved
Hide resolved
...servicelinker/Azure.ResourceManager.ServiceLinker/src/Custom/ArmServiceLinkerModelFactory.cs
Outdated
Show resolved
Hide resolved
| @@ -6,6 +6,20 @@ internal AzureResourceManagerServiceLinkerContext() { } | |||
| public static Azure.ResourceManager.ServiceLinker.AzureResourceManagerServiceLinkerContext Default { get { throw null; } } | |||
| protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } | |||
| } | |||
| public partial class DryrunResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel<Azure.ResourceManager.ServiceLinker.DryrunResourceData>, System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.DryrunResourceData> | |||
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.
looks like this RP has multi-path resources.
We should rename this model - this is too generic.
Maybe it could be ServiceLinkerDryrun
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.
Renamed to ServiceLinkerDryrun
| System.Collections.Generic.IEnumerator<Azure.ResourceManager.ServiceLinker.LocationDryrunResource> System.Collections.Generic.IEnumerable<Azure.ResourceManager.ServiceLinker.LocationDryrunResource>.GetEnumerator() { throw null; } | ||
| System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } | ||
| } | ||
| public partial class LocationDryrunResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel<Azure.ResourceManager.ServiceLinker.DryrunResourceData>, System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.DryrunResourceData> |
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.
maybe this should be ServiceLinkerLocationDryrunResource?
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.
Renamed to ServiceLinkerLocationDryrunResource
| public static Azure.Pageable<Azure.ResourceManager.ServiceLinker.Models.ConfigurationNameItem> GetConfigurationNames(this Azure.ResourceManager.Resources.TenantResource tenantResource, string filter = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } | ||
| public static Azure.AsyncPageable<Azure.ResourceManager.ServiceLinker.Models.ConfigurationNameItem> GetConfigurationNamesAsync(this Azure.ResourceManager.Resources.TenantResource tenantResource, string filter = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } |
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.
extension methods should have more explicit names.
For instance this could be GetServiceLinkerConfigurationNames
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.
Renamed to GetServiceLinkerConfigurationNames
| public static Azure.Pageable<Azure.ResourceManager.ServiceLinker.Models.DaprConfigurationResourceItem> GetDaprConfigurationsLinkers(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } | ||
| public static Azure.AsyncPageable<Azure.ResourceManager.ServiceLinker.Models.DaprConfigurationResourceItem> GetDaprConfigurationsLinkersAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } |
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.
these operation names are not really making sense.
It could be GetServiceLinkerDaprConfigurations
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.
Renamed to GetServiceLinkerDaprConfigurations
| System.BinaryData System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.AccessKeyInfoBase>.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } | ||
| } | ||
| [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] | ||
| public readonly partial struct AccessKeyPermission : System.IEquatable<Azure.ResourceManager.ServiceLinker.Models.AccessKeyPermission> |
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.
this name is too generic
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.
Renamed to TargetServiceAccessKeyPermission
| System.BinaryData System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.BasicErrorDryrunPrerequisiteResult>.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } | ||
| } | ||
| [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] | ||
| public readonly partial struct ConfigurationActionType : System.IEquatable<Azure.ResourceManager.ServiceLinker.Models.ConfigurationActionType> |
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.
this name is too generic
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.
Renamed to SourceApplicationConfigurationActionType
| public override string ToString() { throw null; } | ||
| } | ||
| [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] | ||
| public readonly partial struct ConfigurationAuthMode : System.IEquatable<Azure.ResourceManager.ServiceLinker.Models.ConfigurationAuthMode> |
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.
this name is too generic
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.
Renamed to ServiceLinkerAuthMode
| public static bool operator !=(Azure.ResourceManager.ServiceLinker.Models.ConfigurationAuthMode left, Azure.ResourceManager.ServiceLinker.Models.ConfigurationAuthMode right) { throw null; } | ||
| public override string ToString() { throw null; } | ||
| } | ||
| public partial class ConfigurationNameItem : System.ClientModel.Primitives.IJsonModel<Azure.ResourceManager.ServiceLinker.Models.ConfigurationNameItem>, System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.ConfigurationNameItem> |
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.
this name is too generic
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.
Renamed to LinkerConfigurationNameItem
| System.BinaryData System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.DaprProperties>.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } | ||
| } | ||
| [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] | ||
| public readonly partial struct DeleteOrUpdateBehavior : System.IEquatable<Azure.ResourceManager.ServiceLinker.Models.DeleteOrUpdateBehavior> |
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.
this name is too generic
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.
Renamed to LinkerDeleteOrUpdateBehavior
| string System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.DryrunOperationPreview>.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } | ||
| System.BinaryData System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.DryrunOperationPreview>.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } | ||
| } | ||
| public partial class DryrunPatch : System.ClientModel.Primitives.IJsonModel<Azure.ResourceManager.ServiceLinker.Models.DryrunPatch>, System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.DryrunPatch> |
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.
this name should follow the same change for the name change for Dryrun model above
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.
Renamed to ServiceLinkerDryrunPatch
| string System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.EasyAuthMicrosoftEntraIdAuthInfo>.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } | ||
| System.BinaryData System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.EasyAuthMicrosoftEntraIdAuthInfo>.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } | ||
| } | ||
| public partial class FabricPlatform : Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo, System.ClientModel.Primitives.IJsonModel<Azure.ResourceManager.ServiceLinker.Models.FabricPlatform>, System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.FabricPlatform> |
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.
this name looks like belong to other RP, we need to specify it.
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.
Renamed to LinkerTargetFabricPlatform
| System.BinaryData System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.FabricPlatform>.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } | ||
| } | ||
| [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] | ||
| public readonly partial struct FirewallRulesAllowType : System.IEquatable<Azure.ResourceManager.ServiceLinker.Models.FirewallRulesAllowType> |
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.
this name is too generic
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.
Renamed to LinkerTargetServiceFirewallRulesAllowType
| string System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.PermissionsMissingDryrunPrerequisiteResult>.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } | ||
| System.BinaryData System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.PermissionsMissingDryrunPrerequisiteResult>.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } | ||
| } | ||
| public partial class PublicNetworkSolution : System.ClientModel.Primitives.IJsonModel<Azure.ResourceManager.ServiceLinker.Models.PublicNetworkSolution>, System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.PublicNetworkSolution> |
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.
this name is too generic
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.
Renamed to LinkerPublicNetworkSolution
| @@ -342,12 +951,72 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer | |||
| string System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.SecretBaseInfo>.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } | |||
| System.BinaryData System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.SecretBaseInfo>.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } | |||
| } | |||
| [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] | |||
| public readonly partial struct SecretSourceType : System.IEquatable<Azure.ResourceManager.ServiceLinker.Models.SecretSourceType> | |||
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.
this name is too generic
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.
Renamed to LinkerKeyVaultSecretSourceType
| string System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerCreateOrUpdateDryrunParametersContent>.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } | ||
| System.BinaryData System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerCreateOrUpdateDryrunParametersContent>.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } | ||
| } | ||
| public abstract partial class ServiceLinkerDryrunParametersContent : System.ClientModel.Primitives.IJsonModel<Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunParametersContent>, System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunParametersContent> |
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 think ServiceLinkerDryrunContent should be fine
Parameters and Content just mean the same thing
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.
Renamed to ServiceLinkerDryrunContent
| @@ -411,18 +1089,47 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer | |||
| string System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo>.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } | |||
| System.BinaryData System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.TargetServiceBaseInfo>.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } | |||
| } | |||
| public partial class UserAccountAuthInfo : Azure.ResourceManager.ServiceLinker.Models.AuthBaseInfo, System.ClientModel.Primitives.IJsonModel<Azure.ResourceManager.ServiceLinker.Models.UserAccountAuthInfo>, System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.UserAccountAuthInfo> | |||
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.
this name is too generic
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.
Renamed to LinkerUserAccountAuthInfo
| protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } | ||
| Azure.ResourceManager.ServiceLinker.Models.UserAssignedIdentityAuthInfo System.ClientModel.Primitives.IJsonModel<Azure.ResourceManager.ServiceLinker.Models.UserAssignedIdentityAuthInfo>.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } | ||
| void System.ClientModel.Primitives.IJsonModel<Azure.ResourceManager.ServiceLinker.Models.UserAssignedIdentityAuthInfo>.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } | ||
| Azure.ResourceManager.ServiceLinker.Models.UserAssignedIdentityAuthInfo System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.UserAssignedIdentityAuthInfo>.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } | ||
| string System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.UserAssignedIdentityAuthInfo>.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } | ||
| System.BinaryData System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.UserAssignedIdentityAuthInfo>.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } | ||
| } | ||
| public partial class VnetSolution : System.ClientModel.Primitives.IJsonModel<Azure.ResourceManager.ServiceLinker.Models.VnetSolution>, System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.Models.VnetSolution> |
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.
this name is too generic
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.
Renamed to LinkerVnetSolution
| System.Collections.Generic.IEnumerator<Azure.ResourceManager.ServiceLinker.LocationConnectorResource> System.Collections.Generic.IEnumerable<Azure.ResourceManager.ServiceLinker.LocationConnectorResource>.GetEnumerator() { throw null; } | ||
| System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } | ||
| } | ||
| public partial class LocationConnectorResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel<Azure.ResourceManager.ServiceLinker.LinkerResourceData>, System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.ServiceLinker.LinkerResourceData> |
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 think we should rename this resource as well. The current name is too generic
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.
Renamed to ServiceLinkerLocationConnectorResource
| public virtual Azure.ResourceManager.ArmOperation<Azure.ResourceManager.ServiceLinker.ServiceLinkerLocationDryrunResource> Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } | ||
| public virtual System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.ServiceLinker.ServiceLinkerLocationDryrunResource>> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ServiceLinker.Models.ServiceLinkerDryrunPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } | ||
| } | ||
| public partial class ServiceLinkerLocationDryrunResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable<Azure.ResourceManager.ServiceLinker.ServiceLinkerLocationDryrunResource>, System.Collections.Generic.IEnumerable<Azure.ResourceManager.ServiceLinker.ServiceLinkerLocationDryrunResource>, System.Collections.IEnumerable |
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.
why this is XXXResourceCollection? we should fix this.
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.
Fixed
TSP PR: Azure/azure-rest-api-specs#34326
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.