Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Port Style Upgrades in DscResources Folder from xPSDesiredStateConfiguration #162

Merged
merged 8 commits into from
Jun 7, 2019

Conversation

mhendric
Copy link
Contributor

@mhendric mhendric commented Jun 3, 2019

Pull Request (PR) description

Ports most of the style upgrades from xPSDesiredStateConfiguration that have been made in files in the DscResources folder. Among other things, this will help to ensure that the two modules are as in sync as possible, which will in turn help with porting changes and features between modules.

This Pull Request (PR) fixes the following issues

None

Task list

  • Added an entry under the Unreleased section of the change log in the README.md.
    Entry should say what was changed, and how that affects users (if applicable).
  • Resource documentation added/updated in README.md.
  • Resource parameter descriptions added/updated in README.md, schema.mof
    and comment-based help.
  • Comment-based help added/updated.
  • Localization strings added/updated in all localization files as appropriate.
  • Examples appropriately added/updated.
  • Unit tests added/updated. See DSC Resource Testing Guidelines.
  • Integration tests added/updated (where possible). See DSC Resource Testing Guidelines.
  • New/changed code adheres to DSC Resource Style Guidelines and Best Practices.

This change is Reviewable

@codecov-io
Copy link

codecov-io commented Jun 3, 2019

Codecov Report

Merging #162 into dev will not change coverage.
The diff coverage is 80%.

Impacted file tree graph

@@         Coverage Diff         @@
##            dev   #162   +/-   ##
===================================
  Coverage    83%    83%           
===================================
  Files        19     19           
  Lines      2760   2760           
  Branches      4      4           
===================================
  Hits       2303   2303           
  Misses      453    453           
  Partials      4      4

@mhendric mhendric added the needs review The pull request needs a code review. label Jun 4, 2019
@mhendric mhendric force-pushed the PortStyleUpgrades branch 2 times, most recently from d2d6213 to 3fc4b2b Compare June 4, 2019 15:08
@mhendric
Copy link
Contributor Author

mhendric commented Jun 4, 2019

Reaching out to the community for help reviewing this one. Would someone be able to help with this?Tagging frequent helpers for awareness: @PlagueHO , @johlju , @tmeckel, and @X-Guardian

@mhendric mhendric force-pushed the PortStyleUpgrades branch from 3fc4b2b to 587bfe5 Compare June 5, 2019 14:38
@PlagueHO
Copy link
Contributor

PlagueHO commented Jun 6, 2019

I'm on it! Haven't had much time lately.

Copy link
Contributor

@PlagueHO PlagueHO left a comment

Choose a reason for hiding this comment

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

Wow! Epic @mhendric - just one minor thing.

Reviewed 23 of 23 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @mhendric)


DscResources/ServiceSet/ServiceSet.schema.psm1, line 54 at r1 (raw file):

    param
    (
        [Parameter(Mandatory = $true, HelpMessage="An array of the names of the services to configure.")]

Are these HelpMessage parameters required? And throughout all composite resources.


DscResources/ServiceSet/ServiceSet.schema.psm1, line 79 at r1 (raw file):

        $State,

        [Parameter(HelpMessage="he credential of the user account each service in the set should start under. Cannot be specified at the same time as BuiltInAccount. The user specified by this credential will automatically be granted the Log on as a Service right. The user account specified by this property must have access to the service executable paths in order to start the services.")]

Message is incorrect. Needs a T

Copy link
Contributor Author

@mhendric mhendric left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @mhendric and @PlagueHO)


DscResources/ServiceSet/ServiceSet.schema.psm1, line 54 at r1 (raw file):

Previously, PlagueHO (Daniel Scott-Raynsford) wrote…

Are these HelpMessage parameters required? And throughout all composite resources.

So, these HelpMessage attributes don't actually exist in xPSDesiredStateConfiguration; they are only in PSDscResources. IMO, these don't add much value, and could be removed. Sounds like you agree. That would help in getting these modules closer to being aligned too. I'll get these all cleaned up.

Copy link
Contributor Author

@mhendric mhendric left a comment

Choose a reason for hiding this comment

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

Thanks for the review @PlagueHO . Changes have been made. Can you review again?

Reviewable status: 18 of 23 files reviewed, 2 unresolved discussions (waiting on @PlagueHO)


DscResources/ServiceSet/ServiceSet.schema.psm1, line 54 at r1 (raw file):

Previously, mhendric (Mike Hendrickson) wrote…

So, these HelpMessage attributes don't actually exist in xPSDesiredStateConfiguration; they are only in PSDscResources. IMO, these don't add much value, and could be removed. Sounds like you agree. That would help in getting these modules closer to being aligned too. I'll get these all cleaned up.

Done.


DscResources/ServiceSet/ServiceSet.schema.psm1, line 79 at r1 (raw file):

Previously, PlagueHO (Daniel Scott-Raynsford) wrote…

Message is incorrect. Needs a T

Fixed by removing HelpMessage altogether.

Copy link
Contributor

@PlagueHO PlagueHO left a comment

Choose a reason for hiding this comment

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

Reviewable status: 18 of 23 files reviewed, 2 unresolved discussions (waiting on @johlju and @PlagueHO)


DscResources/ServiceSet/ServiceSet.schema.psm1, line 54 at r1 (raw file):

Previously, mhendric (Mike Hendrickson) wrote…

Done.

Just going to check if @johlju can think of any reason why these HelpMessage attributes have been included on these composite resources? I've not ever used them like this but perhaps there was some reason Katie and/or Mariah added this? Do you know @johlju?

Copy link
Contributor

@johlju johlju left a comment

Choose a reason for hiding this comment

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

Reviewable status: 18 of 23 files reviewed, 2 unresolved discussions (waiting on @PlagueHO)


DscResources/ServiceSet/ServiceSet.schema.psm1, line 54 at r1 (raw file):

Previously, PlagueHO (Daniel Scott-Raynsford) wrote…

Just going to check if @johlju can think of any reason why these HelpMessage attributes have been included on these composite resources? I've not ever used them like this but perhaps there was some reason Katie and/or Mariah added this? Do you know @johlju?

See this https://social.technet.microsoft.com/Forums/en-US/35d95d50-4ebf-4d9d-93c1-2034e3566f5b/using-helpmessage-in-parameter-attributes?forum=winserverpowershell

If the user runs these manually, not calling the composite with that parameter, they can use !? when prompted for a mandatory parameter. But in reality I'm not sure this will be used.

Copy link
Contributor

@PlagueHO PlagueHO left a comment

Choose a reason for hiding this comment

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

Reviewable status: 18 of 23 files reviewed, 2 unresolved discussions (waiting on @johlju and @PlagueHO)


DscResources/ServiceSet/ServiceSet.schema.psm1, line 54 at r1 (raw file):

Previously, johlju (Johan Ljunggren) wrote…

See this https://social.technet.microsoft.com/Forums/en-US/35d95d50-4ebf-4d9d-93c1-2034e3566f5b/using-helpmessage-in-parameter-attributes?forum=winserverpowershell

If the user runs these manually, not calling the composite with that parameter, they can use !? when prompted for a mandatory parameter. But in reality I'm not sure this will be used.

Thanks @johlju - I can't see why anyone would use DSC in that way either. But there must have been some reason that it was added. I'd prefer to remove these as it just seems to be duplicate information that can only get out of sync.

Copy link
Contributor

@johlju johlju left a comment

Choose a reason for hiding this comment

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

Reviewable status: 18 of 23 files reviewed, 2 unresolved discussions (waiting on @PlagueHO)


DscResources/ServiceSet/ServiceSet.schema.psm1, line 54 at r1 (raw file):

Previously, PlagueHO (Daniel Scott-Raynsford) wrote…

Thanks @johlju - I can't see why anyone would use DSC in that way either. But there must have been some reason that it was added. I'd prefer to remove these as it just seems to be duplicate information that can only get out of sync.

I agree to remove these.

Copy link
Contributor

@PlagueHO PlagueHO left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 5 files at r2.
Reviewable status: 19 of 23 files reviewed, all discussions resolved (waiting on @PlagueHO)

@PlagueHO PlagueHO merged commit 545ad6d into PowerShell:dev Jun 7, 2019
@mhendric
Copy link
Contributor Author

mhendric commented Jun 7, 2019

Hey @PlagueHO and @johlju , it's a little late, but I just realized that the above decision pretty much kills #140 that @mgreenegit had submitted. I wonder if we should just move his suggested examples to the comment based help. Thoughts?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs review The pull request needs a code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants