-
Notifications
You must be signed in to change notification settings - Fork 82
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
Opt-in to validate localization, and Removed 'SupportsShouldProcess' - Fixes #217 #216
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #216 +/- ##
====================================
+ Coverage 85% 86% +<1%
====================================
Files 11 10 -1
Lines 1242 1229 -13
====================================
- Hits 1064 1059 -5
+ Misses 178 170 -8 |
CLosing and reopening to kick off the updated localization common test. |
This should be able to come out of draft now that the PR to DSCResources.Test was merged. |
fa1feb3
to
e7c6a36
Compare
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: 0 of 12 files reviewed, all discussions resolved (waiting on @PlagueHO)
Modules/ComputerManagementDsc.ResourceHelper/ComputerManagementDsc.ResourceHelper.psm1, line 51 at r1 (raw file):
Quoted 8 lines of code…
<# Import localization strings. This must be called after the function declaration of Get-LocalizedData to be able to use localized strings in the helper functions of this module. #> $script:localizedData = Get-LocalizedData ` -ResourceName 'ComputerManagementDsc.ResourceHelper' ` -ResourcePath $PSScriptRoot
The change to this file is not necessary. But having the en-US folder a string resource file with no keys is necessary for the new common test to pass.
If you like I can remove this change since there are no localized messages in this file.
Depending on the issue PowerShell/DscResource.Template#21 there might be another solution.
Let me know what you like me to do here. Just keep an string resource file with no keys?
@PlagueHO I'm fixing stuff for this PR to increase coverage |
@PlagueHO Not sure where the last 4 misses come from. |
It ready for review again! Let me knoe if I need to squash more coverage :p |
8d81fb5
to
10ec1d6
Compare
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.
Sorry for taking so long on this @johlju - I completely missed it. I maintain an e-mail folder that contains all the GitHub e-mails from PRs I'm trying to get onto, but this wasn't in there). Sorry about that - the good thing is it was on the back log of changes I'd be intending to make as soon as I had time - and you completed it already! 😁
Reviewed 5 of 12 files at r1, 10 of 13 files at r2, 2 of 2 files at r3.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @johlju)
CHANGELOG.md, line 32 at r3 (raw file):
- Minor code cleanup against style guideline. - Remove code from `New-InvalidOperationException` because it was a code path that could never could be used due to that the parameter
due to that the -> due to the
CHANGELOG.md, line 33 at r3 (raw file):
- Remove code from `New-InvalidOperationException` because it was a code path that could never could be used due to that the parameter validation prevented the helper function being called that way.
prevented -> preventing
Modules/ComputerManagementDsc.Common/ComputerManagementDsc.Common.psm1, line 4 at r3 (raw file):
.SYNOPSIS Retrieves the localized string data based on the machine's culture. Falls back to en-US strings if the machine's culture is not supported.
Should be a blank line after each section here.
Modules/ComputerManagementDsc.Common/ComputerManagementDsc.Common.psm1, line 64 at r3 (raw file):
<# .SYNOPSIS Tests if the current machine is a Nano server.
Can you indent this line?
Modules/ComputerManagementDsc.ResourceHelper/ComputerManagementDsc.ResourceHelper.psm1, line 51 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
<# Import localization strings. This must be called after the function declaration of Get-LocalizedData to be able to use localized strings in the helper functions of this module. #> $script:localizedData = Get-LocalizedData ` -ResourceName 'ComputerManagementDsc.ResourceHelper' ` -ResourcePath $PSScriptRoot
The change to this file is not necessary. But having the en-US folder a string resource file with no keys is necessary for the new common test to pass.
If you like I can remove this change since there are no localized messages in this file.Depending on the issue PowerShell/DscResource.Template#21 there might be another solution.
Let me know what you like me to do here. Just keep an string resource file with no keys?
Lets keep the string resource file with no keys.
Tests/Unit/ComputerManagementDsc.Common.Tests.ps1, line 1107 at r3 (raw file):
Describe 'DscResource.LocalizationHelper\New-InvalidOperationException' { Context 'When calling with Message parameter only' {
Indent seems to be wrong here.
Modules/ComputerManagementDsc.Common/en-US/ComputerManagementDsc.Common.strings.psd1, line 16 at r3 (raw file):
TestDscParameterResultMessage = Test-DscParameter result is '{0}'. CurrentTimeZoneMessage = Current time zone is set to '{0}' GettingTimeZoneMessage = Getting current time zone using {0}.
Can you put '' around {0} for consistency and readability?
…rings in resources.
- Removed `SupportsShouldProcess` as it cannot be used with DSC.
- Combined all ComputerManagementDsc.ResourceHelper module functions into ComputerManagementDsc.Common module
6b3d7db
to
1c1dd4e
Compare
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.
Ready for review again.
Reviewable status: 12 of 17 files reviewed, 6 unresolved discussions (waiting on @PlagueHO)
CHANGELOG.md, line 32 at r3 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
due to that the -> due to the
Done.
CHANGELOG.md, line 33 at r3 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
prevented -> preventing
Done.
Modules/ComputerManagementDsc.Common/ComputerManagementDsc.Common.psm1, line 4 at r3 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
Should be a blank line after each section here.
Done.
Modules/ComputerManagementDsc.Common/ComputerManagementDsc.Common.psm1, line 64 at r3 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
Can you indent this line?
Done.
Tests/Unit/ComputerManagementDsc.Common.Tests.ps1, line 1107 at r3 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
Indent seems to be wrong here.
Done. The entire block was duplicate to the one two blocks up.
Modules/ComputerManagementDsc.Common/en-US/ComputerManagementDsc.Common.strings.psd1, line 16 at r3 (raw file):
Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
Can you put '' around {0} for consistency and readability?
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.
Awesome job @johlju!!!!
Reviewed 6 of 6 files at r4.
Reviewable status: complete! all files reviewed, all discussions resolved
Pull Request (PR) description
in resources - Fixes Issue #217.
SupportsShouldProcess
as it cannot be used with DSC - FixesIssue #219.
ComputerManagementDsc.Common module - Fixes Issue #218.
New-InvalidOperationException
because it was acode path that could never could be used due to that the parameter
validation prevented the helper function being called that way.
Get-LocalizationData
to latest version fromDSCResource.Template.
Test-IsNanoServer
thatprevented it to work. Though the helper function is not used, so this
issue was not caught until now when unit tests was added.
This Pull Request (PR) fixes the following issues
Task list
Entry should say what was changed, and how that affects users (if applicable).
and comment-based help.
This change is