-
Notifications
You must be signed in to change notification settings - Fork 81
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 CHANGE: PowerPlan: Add IsActive read-only property #193
BREAKING CHANGE: PowerPlan: Add IsActive read-only property #193
Conversation
…is not used as any parameters for the 3 dsc powershell functions (test, get, set).
…ve Read-Only Property.
Hey @johlju , Are you able to review this. I believe i did everything correct in regards to implementing a read-only property. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor tweaks. Thank you for submitting this @TraGicCode !!!
Reviewed 4 of 4 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @TraGicCode)
CHANGELOG.md, line 11 at r1 (raw file):
- Added .VSCode settings for applying DSC PSSA rules - fixes [Issue #189](/~https://github.com/PowerShell/ComputerManagementDsc/issues/189). - PowerPlan: - Added IsActive Read-Only Property. Fixes [Issue #171](/~https://github.com/PowerShell/ComputerManagementDsc/issues/171)
Can you change . to - for consistency and in a full stop?
Hey @PlagueHO, I want to remove the verbose messaging in the get target resource that says whether or not the power plan is active or not since it’s a bit redundant since now get target resource returns that information. Do you have any issues with this? |
I’m not at a computer now but I forgot this might still be helpful if the test and set methods are calling this function and you want to know what’s happening during a dsc run. In the context of the get function it’s redundant. |
CHANGELOG.md, line 11 at r1 (raw file): Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
I think this is Done. You might need to point to a line as an example if i didn't get this correct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 3 of 4 files reviewed, 1 unresolved discussion (waiting on @PlagueHO)
CHANGELOG.md, line 11 at r1 (raw file):
Previously, TraGicCode (Michael Fyffe) wrote…
I think this is Done. You might need to point to a line as an example if i didn't get this correct.
Done.
Codecov Report
@@ Coverage Diff @@
## dev #193 +/- ##
==================================
- Coverage 90% 90% -1%
==================================
Files 7 7
Lines 739 735 -4
==================================
- Hits 671 667 -4
Misses 68 68 |
Two reason to keep it. First, there is a PSSA rule that will fail if there is no Write-Verbose in the Get-function. Also, the verbose message is for debug purpose when running the configuration with verbose messages, to show what the resource are returning, or running the Get-DscConfiguration where only the Get-function is called. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 4 files at r1, 1 of 1 files at r2.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @PlagueHO and @TraGicCode)
Modules/ComputerManagementDsc/DSCResources/MSFT_PowerPlan/MSFT_PowerPlan.psm1, line 84 at r2 (raw file):
Name = $Name
This does no longer return $null if the plan is not active. I think we should mention that change in the CHANGELOG.md? If users have logic is depending on this returning $null, that logic will fail. So would be good to mentioned that?
@PlagueHO @TraGicCode as per my review comment, should we consider this as a breaking change? I'm leaning towards not. |
I'm leaning towards it being a breaking change based on the comment you made shown below
While the contract has not changed the behavior has which can break/cause issues when people upgrade. |
…re returned as a name set to null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 3 of 4 files reviewed, 2 unresolved discussions (waiting on @johlju and @PlagueHO)
Modules/ComputerManagementDsc/DSCResources/MSFT_PowerPlan/MSFT_PowerPlan.psm1, line 84 at r2 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Name = $Name
This does no longer return $null if the plan is not active. I think we should mention that change in the CHANGELOG.md? If users have logic is depending on this returning $null, that logic will fail. So would be good to mentioned that?
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TraGicCode, @johlju - Unfortunately I think this might have because Puppet and Chef users both use the Get-TargetResource
function directly and this change does break the contract I believe because of how $Name is now used.
Reviewed 1 of 1 files at r3.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @johlju and @TraGicCode)
CHANGELOG.md, line 12 at r3 (raw file):
- PowerPlan: - Added IsActive Read-Only Property - Fixes [Issue #171](/~https://github.com/PowerShell/ComputerManagementDsc/issues/171). - InActive power plans are no longer returned with their Name set to null. Now, the name is always returned and the Read-Only property
Can you reduce the length of this line to below the max line length and also remove the double space after the full stop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 3 of 4 files reviewed, 2 unresolved discussions (waiting on @PlagueHO and @johlju)
CHANGELOG.md, line 12 at r3 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
Can you reduce the length of this line to below the max line length and also remove the double space after the full stop?
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving my review comments - although @PlagueHO has review comments still not resolved.
Reviewed 1 of 1 files at r4.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @PlagueHO)
CHANGELOG.md, line 12 at r3 (raw file):
Previously, TraGicCode (Michael Fyffe) wrote…
Done.
The tests still fail on this row. https://ci.appveyor.com/project/PowerShell/computermanagementdsc/builds/19332642?fullLog=true#L3813
Thanks @johlju as always! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @TraGicCode - there are still some test failures in the linelength https://ci.appveyor.com/project/PowerShell/computermanagementdsc/builds/19332642?fullLog=true#L3815
Reviewable status:
complete! all files reviewed, all discussions resolved
CHANGELOG.md, line 12 at r3 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
The tests still fail on this row. https://ci.appveyor.com/project/PowerShell/computermanagementdsc/builds/19332642?fullLog=true#L3813
This line is still too long I think because the tests are failing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Reviewable status: 3 of 4 files reviewed, all discussions resolved (waiting on @johlju)
CHANGELOG.md, line 12 at r3 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
This line is still too long I think because the tests are failing.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once @johlju completes his review I'll merge. Thanks again @TraGicCode
Reviewed 1 of 1 files at r5.
Reviewable status:complete! all files reviewed, all discussions resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r5.
Reviewable status:complete! all files reviewed, all discussions resolved
Doh! With all this talk about BREAKING CHANGE we actually forgot to mark this as BREAKING CHANGE in the changelog. I'll quickly submit a PR. |
@PlagueHO Yeah, we totally missed that 😃 Approved the other PR, it's ready for merge. |
Thanks @johlju - Yeah, I've been a bit distracted with work stuff the last couple of weeks so trying to just keep up with as many PR's as possible in what ever spare time I have. But just not getting much done right now 😢 Might have some spare time this weekend though. |
@PlagueHO I haven’t much time now either. Gonna try to get something done this weekend too. @TraGicCode thank you! Also thank you for your contributions. |
Pull Request (PR) description
Added Read-Only property call IsActive.
This Pull Request (PR) fixes the following issues
Fixes #171
Task list
Entry should say what was changed, and how that affects users (if applicable).
and comment-based help.
This change is