Skip to content

Integrating the new custom dataplane sdk for ADLS to the powershell cmdlets #4986

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 22 commits into from
Dec 16, 2017

Conversation

rahuldutta90
Copy link
Contributor

Description

We have introduced a new custom dataplane SDK for ADLS. This new SDK replaces the dataplane part of the previous SDK. This change is due to integration of the new SDK to the current powershell cmdlets.

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.

…eprecated ConcurrentFileCount parameter and introduced Concurrency in Import-AzureRmDataLakeStore and Export-AzureDataLakeStoreItem 3) Updated help markdown files
…) Marked obsolete for parameters that we are going to deprecate 3) Undo the introduction of parameter IfFileExists for New-Item 4) Introduce Mock unittest for playback
@markcowl
Copy link
Member

@rahuldutta90 Please pull the latest from the branch, there are merge conflicts

@rahuldutta90
Copy link
Contributor Author

rahuldutta90 commented Nov 15, 2017

@markcowl Did a latest pull from the main repo and resolved the conflicts.

@maddieclayton
Copy link
Contributor

@rahuldutta90 You are currently failing the build because of Signature issues - PowerShell generally disapproves of the use of plural parameter names (FileExpiryOptions). If this has been expressly approved in review (I do not think I was in attendance for this review), just add the error (found in the build under view/src/Package/SignatureIssues.csv with error code 1) to the SignatureIssue.csv file here

@rahuldutta90
Copy link
Contributor Author

rahuldutta90 commented Nov 21, 2017

@maddieclayton I have fixed parameter name FileExpiryOptions. Thanks.

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.

@rahuldutta90 a few comments to take a look at

<Reference Include="Microsoft.Azure.Management.DataLake.Store, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.DataLake.Store.2.3.0-preview\lib\net452\Microsoft.Azure.Management.DataLake.Store.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
Copy link
Member

Choose a reason for hiding this comment

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

@rahuldutta90 what is this package being used for?

Copy link
Contributor Author

@rahuldutta90 rahuldutta90 Nov 22, 2017

Choose a reason for hiding this comment

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

This 3rd party package is used for logging. Without this it wont run.

Copy link
Member

Choose a reason for hiding this comment

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

Has this been through IP review?

Copy link
Member

Choose a reason for hiding this comment

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

@rahuldutta90 ping on this comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cormacpayne NLog is OSS registered package used for logging.

@@ -116,7 +126,15 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="MSSharedLibKey.snk" />
<None Include="packages.config" />
<Content Include="NLog.config">
Copy link
Member

Choose a reason for hiding this comment

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

@rahuldutta90 what are NLog.config and NLog.xsd being used for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not mandatory. It is used to configure NLog. I had a dependency on NLog.config which was not needed. For future release I have removed this dependency. Here I have manually removed these files, updated the csproj and packages.config

@@ -81,29 +76,25 @@ public class ExportAzureDataLakeStoreItem : DataLakeStoreFileSystemCmdletBase
ParameterSetName = DiagnosticParameterSetName)]
public SwitchParameter Resume { get; set; }

[Obsolete]
Copy link
Member

Choose a reason for hiding this comment

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

@rahuldutta90 for all Obsolete attributes, please make sure you include a message that says what parameter you are deprecating in an upcoming breaking change release and what cmdlet it is in.

Copy link
Contributor Author

@rahuldutta90 rahuldutta90 Nov 22, 2017

Choose a reason for hiding this comment

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

Fixed. Also fixed this for ImportAzureRmDataLakeStoreItem and RemoveAzureDataLakeStoreItem.

@@ -113,14 +104,21 @@ public int ConcurrentFileCount
ParameterSetName = DiagnosticParameterSetName)]
public SwitchParameter Force { get; set; }

[Parameter(ValueFromPipelineByPropertyName = true, Position = 8, Mandatory = false,
Copy link
Member

Choose a reason for hiding this comment

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

@rahuldutta90 please remove the Position from both of the parameter attributes you are adding here

Copy link
Contributor Author

@rahuldutta90 rahuldutta90 Nov 22, 2017

Choose a reason for hiding this comment

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

Fixed. Updated the markdown file also. Also did the same fix for ImportAzureDataLakeStoreItem since I introduced the same parameter there.

@@ -130,63 +128,55 @@ public LogLevel DiagnosticLogLevel

public override void ExecuteCmdlet()
{
if (ConcurrentFileCount != -1)
{
WriteWarning(Resources.IncorrectConcurrentFileCountWarning);
Copy link
Member

Choose a reason for hiding this comment

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

@rahuldutta90 rather than writing this warning, put these strings inside their corresponding Obsolete attribute

Copy link
Contributor Author

@rahuldutta90 rahuldutta90 Nov 22, 2017

Choose a reason for hiding this comment

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

Still not sure. Although updated the obsolete message, but I do not see the warning when I remove WriteWarning even though I have the message in obsolete.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cormacpayne Do you have any other comments regarding this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cormacpayne , I have maked obsolete. However, that alone does not show the message when running the cmdlet. So I am leaving the WriteWarning in as well.

[Alias("Set-AdlStoreItemExpiry")]
public class SetAzureRmDataLakeStoreItemExpiry : DataLakeStoreFileSystemCmdletBase
{
internal const string BaseParameterSetName = "Set expiry as Absolute or NeverExpire";
Copy link
Member

Choose a reason for hiding this comment

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

@rahuldutta90 make sure parameter set names are not space-separated strings

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. Updated the markdown file also.

[Parameter(ValueFromPipelineByPropertyName = true, Position = 3, ParameterSetName = RelativeExpiryParameterSetName, Mandatory = false,
HelpMessage = "The relative time in milliseconds with respect to now or creation time")]
[ValidateNotNullOrEmpty]
public long? RelativeTime { get; set; }
Copy link
Member

Choose a reason for hiding this comment

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

@rahuldutta90 nit: make sure there's an empty line between this parameter and ExecuteCmdlet()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.


public long? AccessTime { get; }
/// <summary>Gets the block size for the file.</summary>
public long? BlockSize { get; }
Copy link
Member

Choose a reason for hiding this comment

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

@rahuldutta90 nit: would you mind adding an empty line between each property?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

The credentials, account, tenant, and subscription used for communication with azure

```yaml
The credentials, account, tenant, and subscription used for communication with azure.```yaml
Copy link
Member

Choose a reason for hiding this comment

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

@rahuldutta90 this is a bug in the platyPS module - please make sure that you move the ```yaml string at the end of this line to a line by itself. You can see how this should be done by looking at any other parameter in this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. This one I missed.

@rahuldutta90
Copy link
Contributor Author

@cormacpayne I have responded to your reviews.

@cormacpayne
Copy link
Member

@azuresdkci test this please

@shawns1
Copy link

shawns1 commented Dec 1, 2017

@azuresdkci test this please

@markcowl markcowl self-assigned this Dec 4, 2017
@markcowl
Copy link
Member

markcowl commented Dec 4, 2017

Per email, will create a branch for this after the release candidate goes out to release as a preview.

@rahuldutta90
Copy link
Contributor Author

@markcowl Azure powershell 5.1.1 is released. Now what do we have to do to release this out of band? Do we have the separate branch?

@cormacpayne cormacpayne reopened this Dec 14, 2017
@cormacpayne cormacpayne changed the base branch from preview to adls-data-plane December 14, 2017 17:11
@maddieclayton
Copy link
Contributor

@azuresdkci Test this please

@markcowl
Copy link
Member

markcowl commented Dec 15, 2017

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.

@rahuldutta90 one comment to resolve. To prepare your module to be preview, you will need to do the following:

(1) You will need to update your version of PowerShellGet to 1.6.0, which you can do by running Install-Module -Name PowerShellGet -Repository PSGallery -Force

(2) Update the ModuleVersion in AzureRM.DataLakeStore.psd1 to 5.0.1

(3) Update the ReleaseNotes field in AzureRM.DataLakeStore.psd1 with the contents that you added to your ChangeLog.md file (the contents underneath the ## Current Release header)

(4) Update the Prelease field in AzureRM.DataLakeStore.psd1 to preview. You can do this by running Update-ModuleManifest -Path PATH_TO_PSD1 -Prelease "preview"

(5) Update the versions in AssemblyInfo.cs to 5.0.1

<package id="Microsoft.Azure.Management.DataLake.Store" version="2.3.0-preview" targetFramework="net452" />
<package id="NLog" version="4.4.12" targetFramework="net452" />
Copy link
Member

Choose a reason for hiding this comment

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

@rahuldutta90 since we've confirmed that these packages are OK to use, you will need to add them to the RequiredAssemblies field in the AzureRM.DataLakeStore.psd1 file.

@markcowl markcowl dismissed cormacpayne’s stale review December 16, 2017 01:33

Will update module versions out of band

@markcowl markcowl merged commit d003249 into Azure:adls-data-plane Dec 16, 2017
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.

7 participants