Skip to content
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

Make New-ModuleManifest consistent with Update-ModuleManifest #9104

Merged
merged 7 commits into from
Mar 13, 2019

Conversation

pougetat
Copy link

PR Summary

The purpose of this PR is to make New-ModuleManifest consistent with Update-ModuleManifest by adding Prerelease, RequireLicenseAcceptance, and ExternalModuleDependencies properties.

PR Context

#8585

PR Checklist

Copy link
Collaborator

@iSazonov iSazonov 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 for new properties.

@pougetat
Copy link
Author

@iSazonov I have updated the tests :).

/// <summary>
/// Specify that the module is prerelease.
/// </summary>
[Parameter(Mandatory = false)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need to set defaults.

Suggested change
[Parameter(Mandatory = false)]
[Parameter]

Below too.

/// Specify whether the module requires explicit user acceptance for install/update/save.
/// </summary>
[Parameter(Mandatory = false)]
public SwitchParameter RequireLicenseAcceptance { get; set; }
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd expect that default is true.
@SteveL-MSFT what do you think?

Copy link
Author

Choose a reason for hiding this comment

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

In anticipation I set the default to true. :)

test/powershell/engine/Module/NewModuleManifest.Tests.ps1 Outdated Show resolved Hide resolved
test/powershell/engine/Module/NewModuleManifest.Tests.ps1 Outdated Show resolved Hide resolved
@iSazonov iSazonov added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Mar 13, 2019
@@ -1197,6 +1217,9 @@ private void BuildPrivateDataInModuleManifest(StringBuilder result, StreamWriter
BuildModuleManifest(result, "ProjectUri", Modules.ProjectUri, ProjectUri != null, () => QuoteName(ProjectUri), streamWriter);
BuildModuleManifest(result, "IconUri", Modules.IconUri, IconUri != null, () => QuoteName(IconUri), streamWriter);
BuildModuleManifest(result, "ReleaseNotes", Modules.ReleaseNotes, !string.IsNullOrEmpty(ReleaseNotes), () => QuoteName(ReleaseNotes), streamWriter);
BuildModuleManifest(result, "Prerelease", Modules.Prerelease, !string.IsNullOrEmpty(Prerelease), () => QuoteName(Prerelease), streamWriter);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps we could use nameof() in BuildModuleManifest() like nameof(Prerelease).
It is question only.
/cc @daxian-dbw

Copy link
Member

Choose a reason for hiding this comment

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

That would be good :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

@pougetat Could you please make the change in all calls of BuildModuleManifest()?

Copy link
Author

@pougetat pougetat Mar 13, 2019

Choose a reason for hiding this comment

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

done. I do want to point out there are a few inconsistencies between variable names here and there. For example :

  • HelpInfoUri and Modules.HelpInfoURI
  • ClrVersion and Modules.CLRVersion

This could be fixed in another PR.

Copy link
Collaborator

@iSazonov iSazonov Mar 13, 2019

Choose a reason for hiding this comment

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

Feel free to pull new PR or open new tracking issue.

@anmenaga anmenaga merged commit a79ed1e into PowerShell:master Mar 13, 2019
@iSazonov
Copy link
Collaborator

iSazonov commented Mar 14, 2019

@pougetat Please create new issue in PowerShell-Docs repo and reference in the PR description. (Current link points to source issue that is wrong)

Thanks for you contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants