-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[RecoveryServices.Backup] Added SoftDelete Feature for IaaSVM #10007
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
Conversation
Can one of the admins verify this patch? |
Not able to identify the static Analysis error. Can you please help? Thanks |
It shows up in the artifacts of the job, the issue is here:
Looks like you are adding a new cmdlet that is using an unapproved verb. Have you had a cmdlet review? |
@markcowl : I have reached out earlier via email for a cmdlet review. Please let me know when can we meet to review this. |
@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 |
src/RecoveryServices/RecoveryServices.Backup.Models/AzureModels/AzureItem.cs
Show resolved
Hide resolved
...ryServices/RecoveryServices.Backup/Cmdlets/Item/UndeleteAzureRmRecoveryServicesBackupItem.cs
Outdated
Show resolved
Hide resolved
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.
apart from minor fixes, LGTM
cce385e
to
9a4a373
Compare
src/RecoveryServices/RecoveryServices.Backup.Models/AzureModels/AzureItem.cs
Outdated
Show resolved
Hide resolved
@@ -117,6 +117,11 @@ public RestAzureNS.AzureOperationResponse DisableProtectionWithDeleteData() | |||
resourceGroupName: vaultResourceGroupName); | |||
} | |||
|
|||
public RestAzureNS.AzureOperationResponse<ProtectedItemResource> UndeleteProtection() |
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.
Can it be set as a default implementation so that no duplicate codes in the derived classes?
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 are provider classes which implement interface methods. So it is not possible to implement a default interface method implementation
src/RecoveryServices/RecoveryServices.Backup.Providers/Providers/IaasVmPsBackupProvider.cs
Show resolved
Hide resolved
src/RecoveryServices/RecoveryServices.Backup.Providers/Providers/IaasVmPsBackupProvider.cs
Outdated
Show resolved
Hide resolved
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 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(); |
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.
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)..
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 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
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 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.
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 is not an acceptable customer experience. You must make the change descried above in order to have this PR merged.
ba340b2
to
76a9e1a
Compare
Build is failing only in linux environment. Not able to identify the error. Can anyone help? Thanks |
Description
Cmdlet Review : https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/378
Checklist
CONTRIBUTING.md
ChangeLog.md
file(s) has been updated:ChangeLog.md
file can be found atsrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
## Upcoming Release
header -- no new version header should be added