Skip to content

[Storage] support StandardBlobtier and Rehydrate priority #9781

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 3 commits into from
Aug 16, 2019

Conversation

blueww
Copy link
Member

@blueww blueww commented Aug 7, 2019

Description

The design review passed on:

Checklist

Copy link
Member

@erich-wang erich-wang left a comment

Choose a reason for hiding this comment

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

@blueww , the review is ongoing, I'll change label to needs-revision after review is done.

{
if ((pageBlobTier != null)
&& (type != BlobType.PageBlob))
{
throw new ArgumentOutOfRangeException("BlobType, PageBlobTier", String.Format("PremiumPageBlobTier can only be set to Page Blob. The Current BlobType is: {0}", type));
}
if (((standardBlobTier != null || rehydratePriority != null))
Copy link
Member

Choose a reason for hiding this comment

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

nit, please remove duplicate ()

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@@ -170,6 +170,22 @@ public PremiumPageBlobTier PremiumPageBlobTier

private PremiumPageBlobTier? pageBlobTier = null;

[Parameter(HelpMessage = "Block Blob Tier, valid values are Hot/Cool/Archive. See detail in https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-storage-tiers", Mandatory = false)]
[ValidateSet("Hot", "Cool", "Archive", IgnoreCase = true)]
public StandardBlobTier StandardBlobTier
Copy link
Member

Choose a reason for hiding this comment

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

Suggest to use PSArgumentCompleter

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

Copy link
Member

Choose a reason for hiding this comment

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

Same comment

Copy link
Member Author

@blueww blueww Aug 12, 2019

Choose a reason for hiding this comment

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

The Type of this parameter should be StandardBlobTier.
As PSArgumentCompleter must work with String type parameter, I have changed it back.

Copy link
Member

Choose a reason for hiding this comment

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

The advice is to make this a string parameter, use a completer, and convert the value to the enum in your cmdlet code.

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 have make it a string, and then parse the value to StandardBlobTier.

private PremiumPageBlobTier? pageBlobTier = null;

[Parameter(HelpMessage = "Block Blob Tier, valid values are Hot/Cool/Archive. See detail in https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-storage-tiers", Mandatory = false)]
[ValidateSet("Hot", "Cool", "Archive", IgnoreCase = true)]
public StandardBlobTier StandardBlobTier
Copy link
Member

Choose a reason for hiding this comment

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

Suggest to use PSArgumentCompleter

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

Copy link
Member

Choose a reason for hiding this comment

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

If you use the completer, the type would be string, in this case.

Copy link
Member Author

@blueww blueww Aug 12, 2019

Choose a reason for hiding this comment

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

The Type of this parameter should be StandardBlobTier.
As PSArgumentCompleter must work with String type parameter, I have changed it back.

Copy link
Member

Choose a reason for hiding this comment

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

Same comment

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 have made it a string, and then parse the value to StandardBlobTier.

@erich-wang
Copy link
Member

Review

General

How about add test cases to cover new parameters?

@blueww
Copy link
Member Author

blueww commented Aug 9, 2019

@erich-wang
I have fixed all your comments and test cases added.
Please help to review again and add all comments.

<PackageReference Include="Microsoft.Azure.Storage.Blob" Version="10.0.3" />
<PackageReference Include="Microsoft.Azure.Storage.File" Version="10.0.3" />
<PackageReference Include="Microsoft.Azure.Storage.Queue" Version="10.0.3" />
<PackageReference Include="Microsoft.Azure.Storage.Blob" Version="11.0.0" />
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't this require changes to the Storage.DataMovement library?

Copy link
Member Author

@blueww blueww Aug 12, 2019

Choose a reason for hiding this comment

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

As we discussed before, since Az.Accounts reference a old DMlib, we will use a private signed DMlib with different name in PSH. And I have already updated the private signed DMlib to new build with this PR. (The last file in "Files Changed")

private PremiumPageBlobTier? pageBlobTier = null;

[Parameter(HelpMessage = "Block Blob Tier, valid values are Hot/Cool/Archive. See detail in https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-storage-tiers", Mandatory = false)]
[ValidateSet("Hot", "Cool", "Archive", IgnoreCase = true)]
public StandardBlobTier StandardBlobTier
Copy link
Member

Choose a reason for hiding this comment

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

If you use the completer, the type would be string, in this case.

@@ -170,6 +170,22 @@ public PremiumPageBlobTier PremiumPageBlobTier

private PremiumPageBlobTier? pageBlobTier = null;

[Parameter(HelpMessage = "Block Blob Tier, valid values are Hot/Cool/Archive. See detail in https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-storage-tiers", Mandatory = false)]
[ValidateSet("Hot", "Cool", "Archive", IgnoreCase = true)]
public StandardBlobTier StandardBlobTier
Copy link
Member

Choose a reason for hiding this comment

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

Same comment

@markcowl
Copy link
Member

@blueww
Copy link
Member Author

blueww commented Aug 13, 2019

@markcowl
I have changed the parameter to string as you recommanded.
Would you please help to check if any further comments?
And help to merged it if no other comments.

BTW, a new sign job with latest code change is: https://azuresdkci.westus2.cloudapp.azure.com/view/PowerShell/job/psnetsign-esrp/485/

Copy link
Member

@erich-wang erich-wang left a comment

Choose a reason for hiding this comment

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

@blueww , I added two additional comments, please take a look.

@erich-wang erich-wang assigned blueww and unassigned erich-wang Aug 13, 2019
@blueww
Copy link
Member Author

blueww commented Aug 14, 2019

@erich-wang
I have resolved your 2 new comments.
A new sign job with latest code change is:
https://azuresdkci.westus2.cloudapp.azure.com/view/PowerShell/job/psnetsign-esrp/486/

@erich-wang
Copy link
Member

/azp run azure-powershell - powershell-core

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

@blueww
Copy link
Member Author

blueww commented Aug 14, 2019

/azp run

@markcowl
Copy link
Member

@blueww will do some sign testing tomorrow, otherwise lgtm.

@markcowl
Copy link
Member

@blueww
Copy link
Member Author

blueww commented Aug 15, 2019

@markcowl @erich-wang
Thanks both!
Waiting for the PR to be merged...

@blueww
Copy link
Member Author

blueww commented Aug 15, 2019

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@blueww
Copy link
Member Author

blueww commented Aug 16, 2019

@markcowl @erich-wang
Let me know if anything else I need to do to make this PR merge.
Hope this can be merged soon.

@markcowl
Copy link
Member

/azp run azure-powershell - powershell-core

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

@markcowl markcowl merged commit 4674d4b into Azure:master Aug 16, 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.

4 participants