Skip to content

[ACR] Decouple reliance on Commands.Resources.Rest #5805

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 1 commit into from
Mar 27, 2018
Merged

[ACR] Decouple reliance on Commands.Resources.Rest #5805

merged 1 commit into from
Mar 27, 2018

Conversation

djyou
Copy link
Member

@djyou djyou commented Mar 24, 2018

Fixes #5775

Description

Checklist

Jinhuafei
Jinhuafei previously approved these changes Mar 26, 2018
Copy link
Contributor

@Jinhuafei Jinhuafei left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@cormacpayne cormacpayne left a comment

Choose a reason for hiding this comment

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

@djyou a few comments to take a look at

@@ -19,6 +19,7 @@
-->
## Current Release
* Fix issue with Default Resource Group in CloudShell
Copy link
Member

Choose a reason for hiding this comment

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

@djyou it looks like you need to pull in the latest changes from the preview branch since this line should be under the Version 1.0.3 header

@@ -12,7 +12,6 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
Copy link
Member

Choose a reason for hiding this comment

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

@djyou I think we should keep this using and add the ResourceGroupCompleter attribute to the ResourceGroupName parameter below.

@maddieclayton any idea why the using was added but the completer wasn't?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think we have implementation for resource group completer. As this is a cleanup PR I would prefer not making functional changes such as adding resource group completer. I meant to remove all unused using here and in other places.

Copy link
Contributor

Choose a reason for hiding this comment

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

@cormacpayne Looks like it was lost in a bad merge. @djyou This resourcegroupcompleter is available across all cmdlets, and lets users easily tab through resource groups in their current subscription. It was added here: 8f17953#diff-baa9c46b222beec8be060e1dd8694915, but somehow lost in the following PR in a merge. Can you please add it back to GetAzureContainerRegistryCredential, NewAzureContainerRegistry, and UpdateAzureContainerRegistryCredential?

using Microsoft.Azure.Management.ContainerRegistry.Models;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
Copy link
Member

Choose a reason for hiding this comment

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

@djyou same comment here about the ResourceGroupCompleter

{
_client = AzureSession.Instance.ClientFactory.CreateArmClient<ResourceManagementClient>(context, AzureEnvironment.Endpoint.ResourceManager);
Copy link
Member

Choose a reason for hiding this comment

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

@djyou we should remove all dependencies external to your service where we can, which would include this dependency on the Microsoft.Azure.Management.ResourceManager package. Is there any reason that you are using this package instead of the common ARM code we have in Commands.ResourceManager.Common?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

@djyou correct, your project shouldn't be dependent on anything but SDKs that your service manages and common code projects.

@djyou
Copy link
Member Author

djyou commented Mar 27, 2018

@cormacpayne Comments should have been addressed. @maddieclayton Added ResourceGroupCompleter for both old and new commands.

@cormacpayne
Copy link
Member

cormacpayne commented Mar 27, 2018

@cormacpayne cormacpayne merged commit 99b912c into Azure:preview Mar 27, 2018
MiYanni added a commit to MiYanni/azure-powershell that referenced this pull request Mar 27, 2018
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