Skip to content
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

Customer Assigned Fault Domain on VM referencing VMSS - SDK and Tests #16844

Conversation

shpa-microsoft
Copy link

Api pull request Azure/azure-rest-api-specs#11409

Do not merge, this PR is to confirm that .Net SDK code can be generated from Swagger change.

@ghost ghost added the Compute label Nov 10, 2020
@shpa-microsoft shpa-microsoft changed the title Customer Assigned Fault Domain on VM referencing VMSS - SDK Generation [DO-NOT-MERGE] Customer Assigned Fault Domain on VM referencing VMSS - SDK Generation Nov 10, 2020
@check-enforcer
Copy link

This pull request is protected by Check Enforcer.

What is Check Enforcer?

Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass.

Why am I getting this message?

You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged.

What should I do now?

If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows:
/check-enforcer evaluate
Typically evaulation only takes a few seconds. If you know that your pull request is not covered by a pipeline and this is expected you can override Check Enforcer using the following command:
/check-enforcer override
Note that using the override command triggers alerts so that follow-up investigations can occur (PRs still need to be approved as normal).

What if I am onboarding a new service?

Often, new services do not have validation pipelines associated with them, in order to bootstrap pipelines for a new service, you can issue the following command as a pull request comment:
/azp run prepare-pipelines
This will run a pipeline that analyzes the source tree and creates the pipelines necessary to build and validate your pull request. Once the pipeline has been created you can trigger the pipeline using the following comment:
/azp run net - [service] - ci

Copy link
Member

@markcowl markcowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code changes look OK, but there are some things that are missing:

  • Please add in a reference to the corresponding Swagger PR for this change
  • running the generation script produces an updated metadata file in the eng directory, please add this in to the PR
  • When api versions change, you need to update Az.Sdk.RP.props to change the tag to match the new api-version
  • You sill need to re-record the tests and add in new tests for any new functionality

@markcowl
Copy link
Member

@shpa-microsoft Also, please ensure you update this branch by pulling in the latest from master.

@shpa-microsoft
Copy link
Author

@markcowl Addressed your comments with some questions on offline chat.

@shpa-microsoft
Copy link
Author

Can't perform tests due to ARM API release issues. Spoke offline about it.

@jsquire
Copy link
Member

jsquire commented Dec 11, 2020

Hi @shpa-microsoft. There hasn't been recent engagement on this PR. Would you please be so kind as to let us know if this is still an active work stream or if the PR should be closed out?

@jsquire jsquire added the no-recent-activity There has been no recent activity on this issue. label Dec 11, 2020
@@ -134,7 +138,7 @@ public async Task<AzureOperationResponse<Gallery>> UpdateWithHttpMessagesAsync(s
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<AzureOperationResponse<Gallery>> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
public async Task<AzureOperationResponse<Gallery>> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, string select = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a customization to fix this breaking change - essentially you need a method that implements the old parameters, with 'customHeaders' being non-optional, like the following:

public partial class GalleriesOperations {

    public async Task<AzureOperationResponse<Gallery>> GetWithHttpMessagesAsync(string resourceGroupName, string galleryName, Dictionary<string, List<string>> customHeaders, CancellationToken cancellationToken = default(CancellationToken))
    {
         return GetWithHttpMessagesAsync(resourceGroupName, galleryName, null, customHeaders, cancellationToken);
    }
}

/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<Gallery> GetAsync(this IGalleriesOperations operations, string resourceGroupName, string galleryName, CancellationToken cancellationToken = default(CancellationToken))
public static async Task<Gallery> GetAsync(this IGalleriesOperations operations, string resourceGroupName, string galleryName, string select = default(string), CancellationToken cancellationToken = default(CancellationToken))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above

@@ -57,7 +57,7 @@ public partial interface IVirtualMachineScaleSetVMExtensionsOperations
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<VirtualMachineExtension>> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineExtension extensionParameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to compensate for these breaking changes:

(1) ensure that the return type has all the properties of the previous return type
(2) add method overloads through customizing thre partial interface using the old signature

@@ -154,7 +157,7 @@ public partial interface IVirtualMachinesOperations
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse> DeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
Task<AzureOperationResponse> DeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? forceDeletion = default(bool?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add overloads as above to fix these breakign changes

[JsonProperty(PropertyName = "contentType")]
public string ContentType { get; set; }
[JsonProperty(PropertyName = "manageActions")]
public UserArtifactManage ManageActions { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change - you will have to maintain a ContentType property, even if unused

/// Gets or sets required. The fileName of the artifact.
/// </summary>
[JsonProperty(PropertyName = "fileName")]
public string FileName { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot trmoeve this property - must maintain the property

@@ -74,10 +74,10 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public async Task<AzureOperationResponse<VirtualMachineExtension>> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineExtension extensionParameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
public async Task<AzureOperationResponse<VirtualMachineScaleSetVMExtension>> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issues as above:
(1) Need to verify that return tyoe contains all the properties of the previous return type
(2) Need to add a customization to implement the old parameter set, as above.

This applies for all the similar breaking method signature changes in this file

@@ -42,7 +42,7 @@ public static partial class VirtualMachineScaleSetVMExtensionsOperationsExtensio
/// <param name='extensionParameters'>
/// Parameters supplied to the Create Virtual Machine Extension operation.
/// </param>
public static VirtualMachineExtension CreateOrUpdate(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineExtension extensionParameters)
public static VirtualMachineScaleSetVMExtension CreateOrUpdate(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in previous file - need to add customizations to fix these breaking changes

/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task DeleteAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken))
public static async Task DeleteAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? forceDeletion = default(bool?), CancellationToken cancellationToken = default(CancellationToken))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to add an overload to fix this breaking change

/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task BeginDeleteAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken))
public static async Task BeginDeleteAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? forceDeletion = default(bool?), CancellationToken cancellationToken = default(CancellationToken))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to add an overload to fix this breaking change

@markcowl
Copy link
Member

@shpa-microsoft Marked the breaking changes that need to be fixed through customization

@jsquire jsquire removed the no-recent-activity There has been no recent activity on this issue. label Dec 18, 2020
@shpa-microsoft shpa-microsoft force-pushed the shpa/CustomerAssignedFaultDomain branch from de7685e to 061b946 Compare January 5, 2021 21:03
@shpa-microsoft shpa-microsoft changed the title [DO-NOT-MERGE] Customer Assigned Fault Domain on VM referencing VMSS - SDK Generation Customer Assigned Fault Domain on VM referencing VMSS - SDK and Tests Jan 5, 2021
@markcowl
Copy link
Member

markcowl commented Jan 6, 2021

@shpa-microsoft It looks like this PR is out of date, can you fix the merge conflicts?

@shpa-microsoft
Copy link
Author

@markcowl all the comments made for breaking changes are unrelated to my changes; and generated automatically with autorest. Is there a way I only regenerate my code for this PR?

@shpa-microsoft shpa-microsoft force-pushed the shpa/CustomerAssignedFaultDomain branch from 061b946 to 25285c7 Compare January 6, 2021 01:55
@markcowl
Copy link
Member

@shpa-microsoft There is a discussion about these API changes, and a proposed resolution on the compute team. Please contact @Sandido for details.

@allenjzhang allenjzhang self-assigned this Jan 21, 2021
@markcowl markcowl removed their assignment Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants