-
Notifications
You must be signed in to change notification settings - Fork 4k
Added -Vault parameter to RecoveryServices.Backup cmdlets #6327
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
@dragonfly91 please fill out a cmdlet design review here: https://github.com/Azure/azure-powershell-cmdlet-review-pr |
@maddieclayton Created this review request here: https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/79. Please check! |
$vault = Get-AzureRmRecoveryServicesVault -ResourceGroupName "sqlpaasrg" -Name "sqlpaasrn"; | ||
|
||
# 2. Set the vault context |
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 you have one test where you set the context with Set-AzureRmRecoveryServicesVaultContext? I assume we want this to continue to work, so we should have at least one test for 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.
Done.
/// </summary> | ||
/// <param name="jobId">ID of the job to be fetched</param> | ||
/// <returns></returns> | ||
public CmdletModel.JobBase GetJobObject(string jobId, ARSVault vault = 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.
Do the corresponding "GetJobObject/HandleCreatedJob" calls in RecoveryServicesBackupCmdletBase still work with the changes to the adapter? If not, please remove them.
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, they still work.
Accept pipeline input: True (ByValue) | ||
Accept wildcard characters: False | ||
``` | ||
|
||
### CommonParameters |
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.
Please revert the changes to the three files below 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.
Done.
@@ -88,6 +88,10 @@ | |||
<Project>{b758fec1-35c1-4f93-a954-66dd33f6e0ec}</Project> | |||
<Name>Commands.RecoveryServices.Backup.ServiceClientAdapter</Name> | |||
</ProjectReference> | |||
<ProjectReference Include="..\Commands.RecoveryServices\Commands.RecoveryServices.csproj"> |
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 do you need to add this reference?
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 project contains the definition of ARSVault which is being referenced by the methods in the provider files.
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.
@dragonfly91 until all of the RecoveryServices modules are consolidated into one, we should avoid introducing any coupling between the types -- this prevents us from getting into scenarios where users can only use certain Backup functionality when paired with RecoveryServices cmdlets. Once the modules are consolidated, we can have a common models projects that all of the projects share and can use interchangeably without worrying about having additional modules installed and run beforehand.
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.
@dragonfly91 as a workaround, we could have the user provide the vault resource id, which you can parse using the ResourceIdentifier
class, to get the vault name and resource group, which appear to be the only two properties you are using from the vault object (let me know if that's not the case)
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.
When we had this discussion last time regarding merge, this point about how to address module dependency was never mentioned explicitly by the ADX team, I believe. Removing dependency on the Set-AzureRmRecoveryServicesVaultContext cmdlet is one of the biggest pain points for the customers and providing the Vault object is the most comfortable way for them. @pvrk can you comment on the workaround suggested by @cormacpayne ?
Also, this PR has been open for the last 9 days. This comment, given on the 9th day, essentially calls for a complete code revamp; all the files will have to be modified.
I understand your commitment to make things easy for the customer. But, I feel that there is no way to anticipate the PR review process. This apparent issue in our design could have been:
- Educated in the initial talks about merge
- Flagged in the PR Design Review
- Flagged in the first few days of PR Code Review.
My concern: why didn't this comment come up in any of the above steps? We have now worked on potential throw away code and also risk missing the release.
Hope you understand our pain point and we need you to address this clearly.
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.
@cormacpayne : So the idea is to use vault ID as a workaround and switch it back to object when the code merger is done? Even though if the idea is to use vault ID throughout, it came at the very last minute at a very high cost (we need to modify all the files) and I concur with @dragonfly91 here. We need such inputs as early as possible.
@@ -109,6 +110,10 @@ | |||
<Project>{b758fec1-35c1-4f93-a954-66dd33f6e0ec}</Project> | |||
<Name>Commands.RecoveryServices.Backup.ServiceClientAdapter</Name> | |||
</ProjectReference> | |||
<ProjectReference Include="..\Commands.RecoveryServices\Commands.RecoveryServices.csproj"> |
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 do you need to add this reference?
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 project contains the definition of ARSVault which is being referenced by the methods in this project.
@dragonfly91 You have merge conflicts that need to be resolved. |
Fixed the merge conflicts. Please continue review! |
@maddieclayton Thank you for getting this in! |
Description
Added -Vault parameter to RecoveryServices.Backup cmdlets
Checklist
CONTRIBUTING.md
platyPS
module