Skip to content

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

Merged
merged 29 commits into from
Jun 12, 2018

Conversation

dragonfly91
Copy link

@dragonfly91 dragonfly91 commented May 29, 2018

Description

Added -Vault parameter to RecoveryServices.Backup cmdlets

Checklist

@maddieclayton
Copy link
Contributor

@dragonfly91 please fill out a cmdlet design review here: https://github.com/Azure/azure-powershell-cmdlet-review-pr

@dragonfly91
Copy link
Author

@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
Copy link
Contributor

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.

Copy link
Author

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)
Copy link
Contributor

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.

Copy link
Author

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
Copy link
Contributor

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.

Copy link
Author

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">
Copy link
Contributor

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?

Copy link
Author

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.

Copy link
Member

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.

Copy link
Member

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)

Copy link
Author

@dragonfly91 dragonfly91 Jun 8, 2018

Choose a reason for hiding this comment

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

@cormacpayne

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:

  1. Educated in the initial talks about merge
  2. Flagged in the PR Design Review
  3. 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.

Copy link
Member

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">
Copy link
Contributor

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?

Copy link
Author

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.

@MiYanni
Copy link
Contributor

MiYanni commented Jun 6, 2018

@dragonfly91 You have merge conflicts that need to be resolved.

@dragonfly91
Copy link
Author

Fixed the merge conflicts. Please continue review!

@maddieclayton
Copy link
Contributor

@dragonfly91
Copy link
Author

@maddieclayton Thank you for getting this in!

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.

6 participants