-
Notifications
You must be signed in to change notification settings - Fork 225
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: Updated xSQLServerConfiguration to support clustered instances (Fixes #144) #143
BREAKING CHANGE: Updated xSQLServerConfiguration to support clustered instances (Fixes #144) #143
Conversation
Hi @nabrond, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
TTYL, MSBOT; |
Reviewed 3 of 5 files at r1, 1 of 1 files at r2. DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 7 at r2 (raw file):
function should be all lowercase DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 12 at r2 (raw file):
Could you move these comments up above the function in help comment form DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 20 at r2 (raw file):
Single quotes here DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 108 at r2 (raw file):
single quotes DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 134 at r2 (raw file):
single quotes Tests/Unit/MSFT_xSQLServerConfiguration.Tests.ps1, line 60 at r2 (raw file):
single quotes Tests/Unit/MSFT_xSQLServerConfiguration.Tests.ps1, line 64 at r2 (raw file):
single quotes for all of these 'It' statements as well. Tests/Unit/MSFT_xSQLServerConfiguration.Tests.ps1, line 132 at r2 (raw file):
single quotes Comments from Reviewable |
@johlju - If you get a chance would you mind looking over this PR for functionality? |
@mbreakey3 absolutely I will do that |
Awesome work! I don't have a cluster in my lab at home, so have to verify the cluster bits tomorrow at work. Reviewed 2 of 5 files at r1, 2 of 2 files at r3. DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 35 at r3 (raw file):
Please change all DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 48 at r3 (raw file):
This parameter could be remove from the Get-method since it does not do anything. In the returned hash table you could just return $null. Less to test in the tests too. DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 61 at r3 (raw file):
Please use New-TerminatingError here (helper function) DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 64 at r3 (raw file):
You can return the hashtable directly instead of assigning it to a variable and returning the variable. DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 128 at r3 (raw file):
Please use New-TerminatingError here (helper function). That will make the string message to be reused from the Get-method also. And allow localization in the future. DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 134 at r3 (raw file):
Could we instead check if the running value See remarks: DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 145 at r3 (raw file):
Could we change the test to something like "Configuration option has been updated. Manual restart of SQL Server is required for the change to take effect!" Bonus points 😄 : Create a new helper function like DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 193 at r3 (raw file):
Could you use splatting on these parameters instead? DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 225 at r3 (raw file):
Could you change this to DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 228 at r3 (raw file):
Could you change this to DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 232 at r3 (raw file):
Could we make this a parameter in the set-method instead of using a hard-coded value? DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 236 at r3 (raw file):
Could we make this a parameter in the set-method instead of using a hard-coded value? Same parameter as above would work. DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 241 at r3 (raw file):
Could we get the service using the service name instead´of the display name? DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 242 at r3 (raw file):
Should we not start this only when StartType is `Automatic´?
DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 249 at r3 (raw file):
If Tests/Unit/MSFT_xSQLServerConfiguration.Tests.ps1, line 28 at r3 (raw file):
Change to $false Tests/Unit/MSFT_xSQLServerConfiguration.Tests.ps1, line 38 at r3 (raw file):
If you change this to Tests/Unit/MSFT_xSQLServerConfiguration.Tests.ps1, line 60 at r3 (raw file):
And change the context to 'The system is not in the desired state' Tests/Unit/MSFT_xSQLServerConfiguration.Tests.ps1, line 64 at r3 (raw file):
Can you change all It-blocks messages to start with 'Should...'
Tests/Unit/MSFT_xSQLServerConfiguration.Tests.ps1, line 85 at r3 (raw file):
This one should be in the same context as above It-blocks Tests/Unit/MSFT_xSQLServerConfiguration.Tests.ps1, line 89 at r3 (raw file):
This one should be in the same context as above It-blocks Tests/Unit/MSFT_xSQLServerConfiguration.Tests.ps1, line 91 at r3 (raw file):
You don't call Set-method. And you should Assert that the mocks for setting the value and restart service is not called here. Tests/Unit/MSFT_xSQLServerConfiguration.Tests.ps1, line 94 at r3 (raw file):
Remove this comment if it should not be used. Tests/Unit/MSFT_xSQLServerConfiguration.Tests.ps1, line 98 at r3 (raw file):
You should have a test to test when OptionName is missing and throws. Comments from Reviewable |
Sorry it took a day extra for me to review the cluster bits in this code. To much work at work so didn't have time until now. :) I will review the tests once all these changes are done. Review status: all files reviewed at latest revision, 29 unresolved discussions. DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 57 at r3 (raw file):
Please change DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 124 at r3 (raw file):
Please change DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 225 at r3 (raw file):
These two
DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 228 at r3 (raw file):
Same problems exist for the SQL Server Agent WMI query as for the SQL Server WMI query. DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.schema.mof, line 4 at r3 (raw file):
Add to the description of the Could you also please align these descriptions between the Schema, README.md and the comment based help in the private functions, so they all are the same descriptions. Comments from Reviewable |
Review status: 1 of 6 files reviewed at latest revision, 29 unresolved discussions. DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 35 at r3 (raw file):
|
Thanks for the feedback @johlju. Fixing these things and writing the tests exposed other issues that had be fixed along the way. I think at this point, all your comments have been answered. Review status: 1 of 6 files reviewed at latest revision, 29 unresolved discussions. Comments from Reviewable |
Review status: 1 of 6 files reviewed at latest revision, 29 unresolved discussions. DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 225 at r3 (raw file):
|
Reviewed 5 of 5 files at r4. DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 48 at r3 (raw file):
|
Reviewed 1 of 5 files at r1, 5 of 5 files at r4. DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 48 at r3 (raw file):
|
Review status: all files reviewed at latest revision, 29 unresolved discussions. DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 48 at r3 (raw file):
|
Reviewed 1 of 1 files at r5. Comments from Reviewable |
Review status: all files reviewed at latest revision, 29 unresolved discussions. DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 48 at r3 (raw file):
|
Will verify the cluster code tomorrow (I will try to get an opportunity). Reviewed 1 of 5 files at r1, 4 of 5 files at r4, 1 of 1 files at r5. DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 35 at r3 (raw file):
|
Review status: 2 of 7 files reviewed at latest revision, 14 unresolved discussions. DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 242 at r3 (raw file):
|
Reviewed 4 of 5 files at r6. README.md, line 354 at r6 (raw file):
Could you add for which resource a test was added? See example under 2.0.0.0 below DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 140 at r5 (raw file):
|
@nabrond Thanks for adding the function |
Review status: 6 of 7 files reviewed at latest revision, 11 unresolved discussions. README.md, line 354 at r6 (raw file):
|
Verified the cluster code. Seems perfect. Nice job! Still haven't reviewed the tests, will do as soon as possible. Reviewed 3 of 3 files at r7. DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 263 at r6 (raw file):
|
Review status: 6 of 7 files reviewed at latest revision, 1 unresolved discussion. DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 48 at r3 (raw file):
|
Reviewed 2 of 5 files at r6, 3 of 3 files at r7. xSQLServerHelper.psm1, line 151 at r7 (raw file):
You can take out this line since Mandatory = $false is the default DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 5 at r7 (raw file):
This should use 'Join-Path' instead of '' Also, Verbose:$false can be removed DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 112 at r7 (raw file):
remove this line: [Parameter(Mandatory = $false)] since it's the default value DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 178 at r7 (raw file):
Any parameter that's not being used in Test-TargetResource, should have a comment here: 'Not used in this function' DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 248 at r7 (raw file):
[String] DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 277 at r7 (raw file):
Can you add a more descriptive Verbose message so that the user knows this is a new Service that is being brought online rather than the one that was just brought offline? Comments from Reviewable |
@mbreakey3 could you do a review loop thru the test in this PR also? Reviewed 1 of 5 files at r6. DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 48 at r3 (raw file):
|
…ers; Corrected comments for unused parameters; Updated verbose messages for clustered service restarts; Support for not restarting offline SQL Agents for clusters.
…ividual property tests; Added missing tests; Overhauled testing for Restart-SqlService function.
Merge conflict has been resolved. Review status: 3 of 7 files reviewed at latest revision, 23 unresolved discussions. Comments from Reviewable |
Reviewed 1 of 2 files at r8, 3 of 3 files at r9. DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 5 at r7 (raw file):
|
DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 5 at r7 (raw file):
|
Review status: 5 of 7 files reviewed at latest revision, 20 unresolved discussions. DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 35 at r9 (raw file):
|
Reviewed 1 of 2 files at r10. DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 5 at r7 (raw file):
|
DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 5 at r7 (raw file):
|
…able for currentPath.
Review status: 5 of 8 files reviewed at latest revision, 16 unresolved discussions. DSCResources/MSFT_xSQLServerConfiguration/MSFT_xSQLServerConfiguration.psm1, line 5 at r7 (raw file):
|
Reviewed 1 of 1 files at r11. Comments from Reviewable |
Reviewed 1 of 2 files at r8, 1 of 3 files at r9, 1 of 2 files at r10, 1 of 1 files at r11. Tests/Unit/MSFT_xSQLServerConfiguration.Tests.ps1, line 120 at r7 (raw file):
|
Review status: 6 of 7 files reviewed at latest revision, 13 unresolved discussions. Tests/Unit/MSFT_xSQLServerConfiguration.Tests.ps1, line 120 at r7 (raw file):
|
Reviewed 1 of 1 files at r12. Comments from Reviewable |
@mbreakey3 Can you take a glance at this and merge when you feel it looks okay? |
Reviewed 1 of 1 files at r12. Comments from Reviewable |
The xSQLServerConfiguration resource only supported changing configuration values for the local computer, not for clustered instances. This PR makes the following changes:
This change is