Skip to content

[Azure.Storage] Support defaultserviceversion #5219

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
Jan 19, 2018

Conversation

blueww
Copy link
Member

@blueww blueww commented Jan 4, 2018

Description

This PR will support set/get Default service version in Powershell cmdlet.
The design is reviewed in https://github.com/Azure/azure-powershell-pr/wiki/Storage-Blob-Service-Default-Service-Version.


This checklist is used to make sure that common guidelines for a pull request are followed. You can find a more complete discussion of PowerShell cmdlet best practices here.

General Guidelines

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.
  • The pull request does not introduce breaking changes (unless a major version change occurs in the assembly and module).

Testing Guidelines

  • Pull request includes test coverage for the included changes.
  • PowerShell scripts used in tests should do any necessary setup as part of the test or suite setup, and should not use hard-coded values for locations or existing resources.

Cmdlet Signature Guidelines

  • New cmdlets that make changes or have side effects should implement ShouldProcess and have SupportShouldProcess=true specified in the cmdlet attribute. You can find more information on ShouldProcess here.
  • Cmdlet specifies OutputType attribute if any output is produced - if the cmdlet produces no output, it should implement a PassThru parameter.

Cmdlet Parameter Guidelines

  • Parameter types should not expose types from the management library - complex parameter types should be defined in the module.
  • Complex parameter types are discouraged - a parameter type should be simple types as often as possible. If complex types are used, they should be shallow and easily creatable from a constructor or another cmdlet.
  • Cmdlet parameter sets should be mutually exclusive - each parameter set must have at least one mandatory parameter not in other parameter sets.

Copy link
Contributor

@maddieclayton maddieclayton left a comment

Choose a reason for hiding this comment

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

Please add tests and I'll take a look.

@@ -115,7 +115,9 @@ CmdletsToExport = 'Get-AzureStorageTable', 'New-AzureStorageTableSASToken',
'Set-AzureStorageContainerStoredAccessPolicy',
Copy link
Contributor

Choose a reason for hiding this comment

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

Please update the changelog with these changes.

Copy link
Member Author

Choose a reason for hiding this comment

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

change log is added

@@ -115,7 +115,9 @@ CmdletsToExport = 'Get-AzureStorageTable', 'New-AzureStorageTableSASToken',
'Set-AzureStorageContainerStoredAccessPolicy',
'Start-AzureStorageBlobCopy',
'Start-AzureStorageBlobIncrementalCopy',
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add tests for your new cmdlets.

Copy link
Member Author

Choose a reason for hiding this comment

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

As the Storage Client library request can't be record in Unit test framework, generally we don't add unit test in PowerShell solution for data plan cmdelts. We will add functional test for the new cmdelts in storage team regression test. Let me know if you would like to review the CR for the our team regression test.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd love to review the regression tests before this change goes into our repo.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi Maddie,

Following is the CR link for the test cases. I have sent you another mail for the CR and attached the test log. You can see the powershell cmdelts tested and result validation of the test cases in the test log.

codeflow://open/?server=https%3A%2F%2Fmsazure.visualstudio.com%2F&review=One.664474&host=vso&alert=true

Copy link
Member Author

@blueww blueww Jan 10, 2018

Choose a reason for hiding this comment

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

@maddieclayton , @cormacpayne

I have added the Unit test for the service properties parse function as we discussed into the PR.
Please help to review.

@blueww
Copy link
Member Author

blueww commented Jan 9, 2018

@maddieclayton
Copy link
Contributor

@blueww Cormac will take a look at this PR now, as he did the cmdlet review.

@blueww
Copy link
Member Author

blueww commented Jan 15, 2018

@cormacpayne
The PR has been filed for several days, and the last fix is 6 days ago.
Since the Code complete is near, would you please help to take a look to reduce the risk?
Hope we can make it in ASAP.

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.

@blueww a few minor comments that need to be addressed


### Example 1: Get Azure Storage services property of the Blob service
```
C:\PS>Get-AzureStorageServiceProperty -ServiceType Blob
Copy link
Member

Choose a reason for hiding this comment

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

@blueww would you mind providing the output from this command as well so users have an idea of what will be returned?

Copy link
Member Author

Choose a reason for hiding this comment

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

The output is provided


### Example 1: Set Blob Service DefaultServiceVersion to 2017-04-17
```
C:\PS>Set-AzureStorageServiceProperty -ServiceType Blob -DefaultServiceVersion 2017-04-17
Copy link
Member

Choose a reason for hiding this comment

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

@blueww same comment about providing the corresponding output from running this command

Copy link
Member Author

Choose a reason for hiding this comment

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

As we talked in the meeting, since we don't have output by default (output serviceProperties when user add -passthru, since this serviceProperties is set to server not get from server), so it's OK not add the output here.

/// <summary>
/// Modify Azure Storage service properties
/// </summary>
[Cmdlet(VerbsCommon.Set, StorageNouns.StorageServiceProperty, SupportsShouldProcess = true), OutputType(typeof(PSSeriviceProperties))]
Copy link
Member

Choose a reason for hiding this comment

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

@blueww what do you think about changing the name of this cmdlet to Update-* instead of Set-*? It seems like when more parameters are added to this cmdlet, only the values of properties provided should be updated and the other values should remain the same.

The Update verb is usually reserved for PATCH commands, which is what I think you would want to do in the future with this cmdlet, and the Set verb is usually reserved for PUT commands. Let me know what you think.

Copy link
Member Author

Choose a reason for hiding this comment

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

Has updated the cmdelts name to Update-AzureStorageServiceProperty, help and changelog also updated.

@cormacpayne cormacpayne removed their assignment Jan 16, 2018
@blueww blueww force-pushed the defaultserviceversion branch from c821f27 to ee0abd3 Compare January 17, 2018 06:52
@blueww
Copy link
Member Author

blueww commented Jan 17, 2018

@blueww
Copy link
Member Author

blueww commented Jan 18, 2018

@cormacpayne
I have fixed all comments in the PR, and the PR has all check passed (include one demand test).
Would you please help to review and merge it ASAP, since it's very near to code complete.
Thanks!

@blueww
Copy link
Member Author

blueww commented Jan 19, 2018

@cormacpayne
Please help to review and merge the PR as tomorrow is code complete.
Thanks!

@cormacpayne cormacpayne merged commit 2f68a6b into Azure:preview Jan 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants