-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Functionality for the 2020-12-01 Compute Rest API release #18498
Conversation
sync forked repo
sync .Net SDK repo to master
* Delete TestVMExtensionOperations.json * Delete TestVMScaleSetExtensions.json
* Update SdkInfo_ComputeManagementClient.cs * Update VirtualMachineRunCommandsOperations.cs * Update VirtualMachineScaleSetVMRunCommandsOperations.cs * Create TestVMExtensionOperations.json * Delete TestVMExtensionOperations.json * Create TestVMExtensionOperations.json * Create TestVMScaleSetExtensions.json
* adding 2020-12-01 compute generated files * update default sku * update tests * test updates * records * tests fixes * all the recorded tests * more update * more update * more update * last test fixes * Updated TestVMIdentitySystemAssignedUserAssigned SDK Test to create User Assigned Identity using SDK (#17861) * Updated TestVMIdentitySystemAssignedUserAssigned SDK Test to create User Assigned MI using MSI SDK * Resolved Merge Conflicts and updated the test Co-authored-by: Pavan Rachapudy <vrachapu@microsoft.com> * Delete AppGW tests (#17977) * Delete VMScaleSetAppGwWithAS.json * Delete VMScaleSetAppGwWithAS_A1V2.json * Delete VMScaleSetAppGwWithAS_SPG_False.json * Delete VMScaleSetAppGwWithAS_Spot.json * Delete VMScaleSetAppGWTests.cs * Delete deprecated ContainerService tests (#17976) * Delete ContainerServiceOperationalTests.cs * Delete ContainerServiceTestsBase.cs * Delete ContainerServiceUpdateTests.cs * Delete TestDCOSOperations.json * Delete TestSwarmOperations.json * Delete TestContainerServiceUpdateOperations.json * test * remove test text Co-authored-by: pavanrachapudy <pavanrachapudy@gmail.com> Co-authored-by: Pavan Rachapudy <vrachapu@microsoft.com> Co-authored-by: Adam Sandor <adsandor@microsoft.com>
* Delete CloudServiceExtensionTests.cs * Delete CloudServiceOperationTests.cs * Delete CloudServiceRoleInstanceTests.cs * Delete CloudServiceScenarioTests.cs * Delete CloudServiceTestsBase.cs * Delete CloudServiceUpdateTests.cs * Delete MultiRole_CreateUpdateGetAndDeleteWithExtension_WorkerAndWebRole.json * Delete MultiRole_CreateUpdateGetAndDeleteWithExtension_WorkerAndWebRole_MultiRoleExtension.json * Delete Test_Create_PowerOff_Start_CloudServiceOperation.json * Delete Test_ListCloudServicesOperation.json * Delete Test_CloudServiceRoleInstanceOperations.json * Delete TestCloudServiceScenarioOperations.json * Delete TestCloudServiceScenarioOperations_DeleteCloudService.json * Delete TestCloudServiceScenarioOperations_ExtensionProfile.json * Delete TestCloudServiceScenarioOperations_InstanceView.json * Delete TestCloudServiceOperations_ScaleIn_ScaleOut.json * Delete TestCloudServiceUpdateOperations.json * Update AzSdk.RP.props * Update AzSdk.RP.props remove containerService * Delete ServiceConfigurationHelpers.cs
I just regenerated the .Net SDK from Master, and it showed no changes to what is currently in this PR. The CI failure seems incorrect. |
The CI failure seems incorrect. |
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: 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, please perform following steps: For data-plane/track 2 SDKs Issue the following command as a pull request comment:
For track 1 management-plane SDKsPlease open a separate PR and to your service SDK path in this file. Once that PR has been merged, you can re-run the pipeline to trigger the verification. |
@Sandido looks like there is no change to management metadata file in /eng/mgmt/. This can cause the ci generation to not use the same commit in the rest-api-specs repo that you are using. Please include the updated management metadata file. |
cleanup
c;eamup2
fix build error? removed Plan
resolve errors
resolve errors
resolve errors
resolve errors
/// <param name='cancellationToken'> | ||
/// The cancellation token. | ||
/// </param> | ||
public async Task<AzureOperationResponse> DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) |
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.
public async Task<AzureOperationResponse> DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) | |
public async Task<AzureOperationResponse> DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary<string, List<string>> customHeaders) |
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.
Also need to add one more overload:
public async Task<AzureOperationResponse> DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary<string, List<string>> customHeaders, CancellationToken cancellationToken)
In this way, calls like:
Delete(string, string, string) // generated overload
Delete(string, string, string, headers) // added overload 1
Delete(string, string, string, null, token) // added overload2
All map to exactly one overload
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.
The same applies to begin* below.
To verify, I would suggest a simple test that calls each of the overloads - it should be fairly simple
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.
Ignoring these comments as directed.
public VirtualMachineImage(string name, string location, string id, IDictionary<string, string> tags, PurchasePlan plan, OSDiskImage osDiskImage, IList<DataDiskImage> dataDiskImages, AutomaticOSUpgradeProperties automaticOSUpgradeProperties, string hyperVGeneration, DisallowedConfiguration disallowed) | ||
: base(name, location, id, tags) | ||
{ | ||
Plan = plan; |
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 looks OK, but I would have thought you would call this(...al parameters) rather than tre-implementing the constructor
public async Task<AzureOperationResponse> DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary<string, List<string>> customHeaders) | ||
{ | ||
// Send request | ||
CancellationToken cancellationToken = default(CancellationToken); |
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.
Note that, as above, you can call the generated method here, rather than re-implementing the body
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.
@markcowl , is there any special syntax to call the generated method?
Or just call the method again like this: #17341 (comment) ?
@@ -281,21 +275,26 @@ public async Task<AzureOperationResponse<CloudServiceRole>> GetWithHttpMessagesA | |||
/// <return> | |||
/// A response object containing the response body and response headers. | |||
/// </return> | |||
public async Task<AzureOperationResponse<IPage<CloudServiceRole>>> ListWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) | |||
public async Task<AzureOperationResponse> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, Dictionary<string, List<string>> customHeaders = null) | |||
{ | |||
if (resourceGroupName == 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.
Especially here, calling the underlying method would be more attractive than duplicating the method body, but I will not block the check-in for this
@@ -12,12 +12,10 @@ namespace Microsoft.Azure.Management.Compute.Models | |||
{ | |||
|
|||
/// <summary> | |||
/// Defines values for CloudServiceUpgradeMode. |
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.
Yes, this is a git diff oddity
@@ -16,11 +16,7 @@ namespace Microsoft.Azure.Management.Compute.Models | |||
/// </summary> | |||
public static class PatchAssessmentState | |||
{ | |||
public const string Installed = "Installed"; |
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.
Is this part of the approved breakign change?
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.
@markcowl , yes, the other values were removed here: https://github.com/Azure/azure-rest-api-specs/pull/11768/files#diff-221803bb4dd158b19c43e5b4bc886f69fcf8529ff1c195063f6a8b0840faf724L7860
string testVaultId = @"/subscriptions/0296790d-427c-48ca-b204-8b729bbd8670/resourceGroups/longrunningrg-centraluseuap/providers/Microsoft.KeyVault/vaults/swaggerKeyVault5"; | ||
string encryptionKeyUri = @"https://swaggerkeyvault5.vault.azure.net/keys/swaggerKey/52317b056a2c49d0b8673a67d072655e"; | ||
string secretUri = @"https://swaggerkeyvault5.vault.azure.net/secrets/swaggerSecret/0e01a1ab339e40ff9f01ea98ae8ee6b5"; | ||
string testVaultId = @"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/RGforSDKtestResources/providers/Microsoft.KeyVault/vaults/testingkvsdk"; |
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 pattern is highly discouraged. It is best if tests do their own setup, bothto minimize code changes when updating the api-version and to reduce the amount of knowledge you need to have about the tests before running them live.
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.
@markcowl , agreed, we were not in charge of these tests and don't currently have the knowledge to change it. The DiskRP team needs to modify this. We will be curating these tests in the future.
@@ -48,7 +48,7 @@ public void TestCreateImage_without_DiskEncryptionSet() | |||
{ | |||
using (MockContext context = MockContext.Start(this.GetType())) | |||
{ | |||
Environment.SetEnvironmentVariable("AZURE_VM_TEST_LOCATION", "FranceCentral"); | |||
Environment.SetEnvironmentVariable("AZURE_VM_TEST_LOCATION", "eastus2"); |
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.
same comment as 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.
@markcowl , not sure if it is the same issue. It's something that will need to be modified when next re-recorded. We don't have the knowledge to improve it right now.
@@ -13,8 +13,8 @@ namespace Microsoft.Azure.Management.Compute.Tests.ScenarioTests | |||
{ | |||
public class VMInstanceViewPatchStatusTests : VMTestBase | |||
{ | |||
private const string RgName = "PatchStatusRg"; | |||
private const string VmName = "testVm"; | |||
private const string RgName = "RGforSDKtestResources"; |
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.
Hopefully these are base names using the random name generator. Otherwise, this is an anti-pattern - hard coding names makes rerunning tests a big problem for the next developer. Again, FYI
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.
@markcowl , agreed, we were not in charge of these tests and don't currently have the knowledge to change it. We will be curating these tests in the future.
@@ -31,28 +31,6 @@ public void GetVMInstanceViewWithPatchStatus() | |||
|
|||
Assert.NotNull(vmInstanceView); | |||
Assert.NotNull(vmInstanceView.PatchStatus); | |||
Assert.NotNull(vmInstanceView.PatchStatus.AvailablePatchSummary); |
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.
It is dangerous to remove assertions - if the underlyign type has changed, there should be analogous assertiosn for the new type structure
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.
We are doing this for now as we do not have the knowledge to manually setup the test to have these values and complete the test. I will add them back in but commented out.
@@ -161,7 +164,7 @@ protected DiskEncryptionSettings GetEncryptionSettings(bool addKek = false) | |||
|
|||
protected string getDefaultDiskEncryptionSetId() | |||
{ | |||
return "/subscriptions/0296790d-427c-48ca-b204-8b729bbd8670/resourceGroups/longrunning-eastus2RG/providers/Microsoft.Compute/diskEncryptionSets/longlivedBvtDES"; | |||
return "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/RGforSDKtestResources/providers/Microsoft.Compute/diskEncryptionSets/EncryptionSetforTest"; |
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.
Not sure what this is for. This seems to be bypassing the test recording system, and is another thing the next dev will have to change when the api-version is updated again.
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 this is due to us not knowing how to create a DiskEncryptionSetId dynamically. Similar issue to above. This needs to be changed when tests are re-recorded. These tests will be curated and improved in the future.
Small fixes to swagger in Microsoft.Sql AdvancedThreatProtectionSettings API for 2021-11-01-preview (Azure#18498)
Most of the Swagger edits are here: Azure/azure-rest-api-specs#12334
This PR introduced the VMGuestPatch breaking changes. It was approved by Azure Breaking Change Review board as the feature is in preview.
Notable Changes:
All SDK Contribution checklist:
This checklist is used to make sure that common guidelines for a pull request are followed.
Draft
mode if it is:General Guidelines and Best Practices
Testing Guidelines
SDK Generation Guidelines
*.csproj
andAssemblyInfo.cs
files have been updated with the new version of the SDK. Please double check nuget.org current release version.Additional management plane SDK specific contribution checklist:
Note: Only applies to
Microsoft.Azure.Management.[RP]
orAzure.ResourceManager.[RP]
Management plane SDK Troubleshooting
new service
label and/or contact assigned reviewer.Verify Code Generation
step, please ensure:generate.ps1/cmd
to generate this PR instead of callingautorest
directly.Please pay attention to the @microsoft.csharp version output after running generate.ps1. If it is lower than current released version (2.3.82), please run it again as it should pull down the latest version,
Old outstanding PR cleanup
Please note:
If PRs (including draft) has been out for more than 60 days and there are no responses from our query or followups, they will be closed to maintain a concise list for our reviewers.