Skip to content

Conversation

sambitratha
Copy link
Contributor

@sambitratha sambitratha commented Sep 11, 2019

Description

Cmdlet Review : https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/378

Checklist

  • I have read the Submitting Changes section of CONTRIBUTING.md
  • The title of the PR is clear and informative
  • The appropriate ChangeLog.md file(s) has been updated:
    • For any service, the ChangeLog.md file can be found at src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
    • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header -- no new version header should be added
  • The PR does not introduce breaking changes
  • If applicable, the changes made in the PR have proper test coverage
  • For public API changes to cmdlets:
    • a cmdlet design review was approved for the changes in this repository (Microsoft internal only)
    • the markdown help files have been regenerated using the commands listed here

@adxsdkps
Copy link
Collaborator

Can one of the admins verify this patch?

@sambitratha
Copy link
Contributor Author

Not able to identify the static Analysis error. Can you please help? Thanks

@markcowl
Copy link
Member

It shows up in the artifacts of the job, the issue is here:


D:\a\1\s\artifacts\Debug\Az.RecoveryServices\Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.Backup.dll | Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.UndeleteAzureRmRecoveryServicesBackupItem | Undelete-AzRecoveryServicesBackupItem | 1 | 8300 | Undelete-AzRecoveryServicesBackupItem   uses the verb 'Undelete', which is not on the list of approved verbs for   PowerShell commands. Use the cmdlet 'Get-Verb' to see the full list of   approved verbs and consider renaming the cmdlet. | Consider renaming the cmdlet to use an   approved verb for PowerShell.
-- | -- | -- | -- | -- | -- | --



Looks like you are adding a new cmdlet that is using an unapproved verb. Have you had a cmdlet review?

@pvrk
Copy link
Member

pvrk commented Sep 12, 2019

@markcowl : I have reached out earlier via email for a cmdlet review. Please let me know when can we meet to review this.

@markcowl
Copy link
Member

@pvrk Please submit a cmdlet review here: https://github.com/azure/azure-powershell-cmdlet-review-pr/issues We will schedule a meeting if it is necessary for the change

@markcowl markcowl assigned sambitratha and unassigned erich-wang Sep 13, 2019
Copy link
Contributor

@siddharth7 siddharth7 left a comment

Choose a reason for hiding this comment

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

apart from minor fixes, LGTM

@siddharth7 siddharth7 changed the title SoftDelete Feature Added [RecoveryServices.Backup] Added SoftDelete Feature for IaaSVM Sep 13, 2019
@sambitratha sambitratha force-pushed the users/sarath/softdelete branch from cce385e to 9a4a373 Compare September 13, 2019 11:18
siddharth7
siddharth7 previously approved these changes Sep 25, 2019
@msJinLei msJinLei self-assigned this Sep 26, 2019
@@ -117,6 +117,11 @@ public RestAzureNS.AzureOperationResponse DisableProtectionWithDeleteData()
resourceGroupName: vaultResourceGroupName);
}

public RestAzureNS.AzureOperationResponse<ProtectedItemResource> UndeleteProtection()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can it be set as a default implementation so that no duplicate codes in the derived classes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

these are provider classes which implement interface methods. So it is not possible to implement a default interface method implementation

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.

I may be missing somethign about the implementation, but it looks like your code would throw a NotImplementedException to the user for most of your backup providers. You need to prevent this.

providerManager.GetProviderInstance(Item.WorkloadType,
Item.BackupManagementType);

var itemResponse = psBackupProvider.UndeleteProtection();
Copy link
Member

Choose a reason for hiding this comment

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

So, what is tp prevent this from calling one of the unimplemented methods for UndeleteProtection, given that you only have one class that implements this.

At least, you need to catch the NotImplementedException that would occur here for most of your providers and return a message letting the user know that this is not supported.. At best, you should have another indicator of whether the method is implemented (for example, having a separate interface for undelete, or making the method implenent a TryUndeleteMethod that returns false if Undelete is not possible, rather than throwing an uncaught exception)..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the coding style we are following as of now. There are other features as well which are only enabled for some specific provider. For example, RegisterContainer() method is only implemented for Workload Provider. If called for other providers, the same behavior is expected. i.e. to throw NotImplementedException

Copy link
Contributor

Choose a reason for hiding this comment

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

@markcowl The undelete feature for other workloads will arrive as and when they are supported by our service which is planned to come in the near future.

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 not an acceptable customer experience. You must make the change descried above in order to have this PR merged.

@sambitratha sambitratha force-pushed the users/sarath/softdelete branch from ba340b2 to 76a9e1a Compare October 7, 2019 07:38
@sambitratha
Copy link
Contributor Author

Build is failing only in linux environment. Not able to identify the error. Can anyone help? Thanks

@markcowl markcowl merged commit 21b6283 into Azure:master Oct 8, 2019
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.

8 participants