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

BREAKING: WSManListener: Convert to a Class Resource #106

Open
wants to merge 135 commits into
base: main
Choose a base branch
from

Conversation

dan-hughes
Copy link
Contributor

@dan-hughes dan-hughes commented Sep 18, 2024

Pull Request (PR) description

Convert WSManListener to a class resource
Rename parameter DN to BaseDN

This Pull Request (PR) fixes the following issues

Contributes to #98
Fixes #89

Task list

  • Added an entry to the change log under the Unreleased section of the
    file CHANGELOG.md. Entry should say what was changed and how that
    affects users (if applicable), and reference the issue being resolved
    (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 Community Testing Guidelines.
  • Integration tests added/updated (where possible). See DSC Community Testing Guidelines.
  • New/changed code adheres to DSC Community Style Guidelines.

This change is Reviewable

Copy link

codecov bot commented Sep 27, 2024

Codecov Report

Attention: Patch coverage is 99.23077% with 1 line in your changes missing coverage. Please review.

Project coverage is 99%. Comparing base (6f4163d) to head (3d7e440).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
source/Private/Find-Certificate.ps1 97% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@         Coverage Diff          @@
##           main   #106    +/-   ##
====================================
+ Coverage    88%    99%   +11%     
====================================
  Files         3      7     +4     
  Lines       310    200   -110     
====================================
- Hits        274    199    -75     
+ Misses       36      1    -35     
Files with missing lines Coverage Δ
source/Classes/020.WSManListener.ps1 100% <100%> (ø)
.../DSCResources/DSC_WSManConfig/DSC_WSManConfig.psm1 100% <ø> (ø)
...DSC_WSManServiceConfig/DSC_WSManServiceConfig.psm1 100% <ø> (ø)
source/Private/Get-DefaultPort.ps1 100% <100%> (ø)
source/Private/Get-Listener.ps1 100% <100%> (ø)
source/prefix.ps1 100% <100%> (ø)
source/Private/Find-Certificate.ps1 97% <97%> (ø)

@johlju
Copy link
Member

johlju commented Jan 29, 2025

I will try to get on this next, as soon as I can. But there is a lot at regular work this week.

@dan-hughes
Copy link
Contributor Author

That's fine. There is actually something I wanted to discuss/propose around DscResource.Base to enable the use of Enums for optional properties.
I'll create a discussion in the correct repo.

@dan-hughes dan-hughes force-pushed the feat/wsman-listener-class branch from e25c270 to efca431 Compare February 2, 2025 20:47
@dan-hughes
Copy link
Contributor Author

@johlju this is ready for review again. Uses new base class functionality and preview DocGenerator which has the class enhancements.

Copy link
Member

@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.

Reviewed 28 of 35 files at r6, 7 of 7 files at r7, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dan-hughes and @PlagueHO)


source/Classes/020.WSManListener.ps1 line 249 at r3 (raw file):

Previously, dan-hughes (Daniel Hughes) wrote…

I don't believe so, if the port is not supplied, then it is populated with Get-DefaultPort in Get().GetCurrentState().

I don't think that Port should be set in GetCurrentState, then we will enforce the port even if it was not passes by the user? 🤔 GetCurrentState is not meant to set the instance properties, just return current state. It is also more difficult to understand that Get() affects Set().

If the default port must be used I think it should be set in the Set-function prior to creating the listener. 🤔


source/Private/Find-Certificate.ps1 line 24 at r3 (raw file):

Previously, dan-hughes (Daniel Hughes) wrote…

I'll create issues in the three repos for these.

Great!

Copy link
Contributor Author

@dan-hughes dan-hughes 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 @johlju and @PlagueHO)


source/Classes/020.WSManListener.ps1 line 249 at r3 (raw file):

Previously, johlju (Johan Ljunggren) wrote…

I don't think that Port should be set in GetCurrentState, then we will enforce the port even if it was not passes by the user? 🤔 GetCurrentState is not meant to set the instance properties, just return current state. It is also more difficult to understand that Get() affects Set().

If the default port must be used I think it should be set in the Set-function prior to creating the listener. 🤔

This will include Address too. It can be moved into NewInstance(), which is where it is used.

Copy link
Member

@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: all files reviewed, 2 unresolved discussions (waiting on @dan-hughes and @PlagueHO)


source/Classes/020.WSManListener.ps1 line 249 at r3 (raw file):

Previously, dan-hughes (Daniel Hughes) wrote…

This will include Address too. It can be moved into NewInstance(), which is where it is used.

Yes, same with Address, missed that. NewInsatnce() sounds good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for code fix A review left open comments, and the pull request is waiting for changes to be pushed by the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WSManListener parameter DN should be BaseDN
3 participants