-
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
xSQLServerServiceAccount: New Resource Added #795
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #795 +/- ##
====================================
+ Coverage 96% 96% +<1%
====================================
Files 30 31 +1
Lines 3259 3310 +51
====================================
+ Hits 3142 3193 +51
Misses 117 117 |
@nabrond Awesome work! I will try to review the PR this weekend! |
I will review the tests tomorrow! Reviewed 4 of 8 files at r2, 3 of 4 files at r3. CHANGELOG.md, line 88 at r3 (raw file):
Could you please move this row to the previous row? '- Added new resource xSQLServerServiceAccount (issue #706)' README.md, line 155 at r3 (raw file):
Please move this row so it's listed in alphabetical order. README.md, line 1217 at r3 (raw file):
Please add requirements (see other resources). If you feel there are no requirements, then maybe we should write 'None.' here. README.md, line 1222 at r3 (raw file):
Should be 'SQLInstanceName' README.md, line 1223 at r3 (raw file):
Should be 'SQLInstanceName' And full stop '.' at the end of the sentence. README.md, line 1224 at r3 (raw file):
Got a double-quote here. README.md, line 1224 at r3 (raw file):
Should be 'IntegrationServices'. Throughout the PR. Looking at name of components here: README.md, line 1224 at r3 (raw file):
Should be 'AnalysisServices'. Throughout the PR. README.md, line 1224 at r3 (raw file):
Should be 'DatabaseEngine'. Throughout the PR. README.md, line 1224 at r3 (raw file):
Should be 'SQLServerAgent'. Throughout the PR. README.md, line 1225 at r3 (raw file):
Should be 'ReportingServices'. Throughout the PR. README.md, line 1225 at r3 (raw file):
Should be 'SQLServerBrowser'? Throughout the PR. README.md, line 1225 at r3 (raw file):
Should be 'NotificationServices'. Throughout the PR. README.md, line 1231 at r3 (raw file):
Please add something that will cause that 'Set-TargetResource' will run on each consecutive run. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 10 at r3 (raw file):
We can't use LoadWithPartialName anymore. That will cause problems where, in certain scenarios, the wrong assembly can be loaded (see issue #649). Please use Import-SQLPSModule if possible (in the *-TargetResource functions). Or at least use DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 11 at r3 (raw file):
We can't use LoadWithPartialName anymore. Please use Import-SQLPSModule if possible (in the *-TargetResource functions). See above comment. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 15 at r3 (raw file):
These lines should be indented one step. Throughout the comment-based help. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 18 at r3 (raw file):
And full stop '.' at the end of the sentence. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 25 at r3 (raw file):
And full stop '.' at the end of the sentence (I think)? DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 38 at r3 (raw file):
Could we use DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 39 at r3 (raw file):
Since this is mandatory, this should not be set. You most likely got a PSSA warning in the common tests as well. Throughout on all mandatory parameters that has default values. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 51 at r3 (raw file):
Could we use DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 72 at r3 (raw file):
Add
DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 95 at r3 (raw file):
And full stop '.' at the end of the sentence. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 102 at r3 (raw file):
And full stop '.' at the end of the sentence (I think)? DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 108 at r3 (raw file):
And full stop '.' at the end of the sentence. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 120 at r3 (raw file):
Couyld we use DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 140 at r3 (raw file):
Could we use Also, please add [Parameter()] to all non.mandatory parameters. Throughout. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 165 at r3 (raw file):
And full stop '.' at the end of the sentence. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 172 at r3 (raw file):
And full stop '.' at the end of the sentence (I think)? DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 178 at r3 (raw file):
And full stop '.' at the end of the sentence. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 184 at r3 (raw file):
Maybe add an example for the Get-TargetResource as well? No other resources are using examples for the *-TargetResource functions (i think), but since you added them, lets be consequent in all functions here :) DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 215 at r3 (raw file):
Line 215-239 seems duplicate to the Get-TargetResource function. Could this be added to a helper function in this resource module instead of duplicating code? DSCResources/MSFT_xSQLServerServiceAccount/en-US/MSFT_xSQLServerServiceAccount.strings.psd1, line 5 at r3 (raw file):
Could you make this a bit more descriptive - telling maybe that Test-TargetResource will always return $false (or something). DSCResources/MSFT_xSQLServerServiceAccount/en-US/MSFT_xSQLServerServiceAccount.strings.psd1, line 6 at r3 (raw file):
Maybe add the service name in this string as well? DSCResources/MSFT_xSQLServerServiceAccount/en-US/MSFT_xSQLServerServiceAccount.strings.psd1, line 8 at r3 (raw file):
Maybe add the service name in this string as well? Examples/Resources/xSQLServerServiceAccount/2-ConfigureServiceAccount-VirtualAccount.ps1, line 5 at r3 (raw file):
Please explain what the Force does as well. Comments from Reviewable |
The values for Review status: 2 of 8 files reviewed at latest revision, 38 unresolved discussions. CHANGELOG.md, line 88 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. README.md, line 155 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. README.md, line 1217 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. README.md, line 1222 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. README.md, line 1223 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. README.md, line 1224 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. README.md, line 1224 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
See comment from PR. README.md, line 1224 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
See comment from PR. README.md, line 1224 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
See comment from PR. README.md, line 1224 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
See comment from PR. README.md, line 1225 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
See comment from PR. README.md, line 1225 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
See comment from PR. README.md, line 1225 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
See comment from PR. README.md, line 1231 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Good catch. Forgot about that from the other discussion! Done. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 10 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 11 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 15 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 18 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 25 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
It seems weird to have a full stop on this line, but I added it anyway. Done. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 38 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 39 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 51 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 72 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 95 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 102 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 108 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 120 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 140 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 165 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 172 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 178 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 184 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 215 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Moved code to new function Get-ServiceObject. Done. DSCResources/MSFT_xSQLServerServiceAccount/en-US/MSFT_xSQLServerServiceAccount.strings.psd1, line 5 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. DSCResources/MSFT_xSQLServerServiceAccount/en-US/MSFT_xSQLServerServiceAccount.strings.psd1, line 6 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Service name is not available at this point, added SQL Server and SQL Instance Name to the message. Done. DSCResources/MSFT_xSQLServerServiceAccount/en-US/MSFT_xSQLServerServiceAccount.strings.psd1, line 8 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Examples/Resources/xSQLServerServiceAccount/2-ConfigureServiceAccount-VirtualAccount.ps1, line 5 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Comments from Reviewable |
Review status: 2 of 8 files reviewed at latest revision, 37 unresolved discussions. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 10 at r3 (raw file): Previously, nabrond (Brandon) wrote…
This change broke the Appveyor build for this push xSQLServer 6.0.1553. I am going to roll this back for now. Comments from Reviewable |
This is a tricky one. Seems that somene realized "the mistake" and added the correct name as the description on each property value (because it would be a major breaking change to fix the property values). 😄 I let you decide this one. Reviewed 1 of 6 files at r4. Comments from Reviewable |
Reviewed 3 of 6 files at r4. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 10 at r3 (raw file): Previously, nabrond (Brandon) wrote…
Ah. That will be fixed when I send in the PR for issue #649! I was hoping to get that done this weekend, but thin I won't have time. Gonna try to do that tomorrow. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 294 at r4 (raw file):
Remove blank line here. Comments from Reviewable |
Review status: 2 of 8 files reviewed at latest revision, 10 unresolved discussions, some commit checks failed. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 294 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Comments from Reviewable |
Review status: 2 of 8 files reviewed at latest revision, 9 unresolved discussions, some commit checks failed. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 10 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
When thinking about this. This has nothing to do with the issue #649. In the unit test you should mock Import-SQLPSModule and you should not get the problem you encountered. Comments from Reviewable |
Review status: 2 of 8 files reviewed at latest revision, 9 unresolved discussions. README.md, line 1224 at r3 (raw file): Previously, nabrond (Brandon) wrote…
Done. README.md, line 1224 at r3 (raw file): Previously, nabrond (Brandon) wrote…
Done. README.md, line 1224 at r3 (raw file): Previously, nabrond (Brandon) wrote…
Done. README.md, line 1224 at r3 (raw file): Previously, nabrond (Brandon) wrote…
Done. README.md, line 1225 at r3 (raw file): Previously, nabrond (Brandon) wrote…
Done. README.md, line 1225 at r3 (raw file): Previously, nabrond (Brandon) wrote…
Done. README.md, line 1225 at r3 (raw file): Previously, nabrond (Brandon) wrote…
Done. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 10 at r3 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Comments from Reviewable |
Review status: 2 of 8 files reviewed at latest revision, 9 unresolved discussions. DSCResources/MSFT_xSQLServerServiceAccount/MSFT_xSQLServerServiceAccount.psm1, line 11 at r3 (raw file): Previously, nabrond (Brandon) wrote…
I removed this code, added the Import-SQLPSModule call which should load the module and all required assemblies. Tests pass locally, but I am hitting an issue where Test-xDscResource is failing for this module. It seems to be trying to load the SQLPS or SqlServer module and ignoring the Mock. @johlju can you look at this and let me know what I am missing? Comments from Reviewable |
Let me merge the fix that runs the integration tests in order and see if that fixes the problem. |
@nabrond Please rebase and see if the recently merged PR fixes your issue. |
@nabrond Can't see the problem with Test-xDscResource that you mention. But can see it fails on that you are using a SQL type which you need to mock using SMO.cs. You can create another .cs file if it is more appropriate.
https://ci.appveyor.com/project/PowerShell/xsqlserver/build/6.0.1566.0#L4489 See example here: |
Seems the issue with Review status: 2 of 9 files reviewed at latest revision, 9 unresolved discussions. Comments from Reviewable |
It seems this PR don't see new changes in dev. I'm gonna close and reopen this PR to see if it gets resolved. |
@nabrond This PR behaves strangely, see changelog.md and appveyor.yml. It seems it stuck in an older version of the dev branch and wants to merge changes you haven't made. Tried to close and reopen this issue to resolve it, but that didn't help. I haven't seen this before. |
…d new helper function to properly map new values to ManagedServiceType enumeration. Updated README to reflect changes.
…tests to mock calls to this function.
…ts. Removed SMO typed OutputType specifications.
…dded new localized string for exception.
…lized strings per code review. Replaced assembly imports with Import-SQLPSModule. Using full type names for parameters. Added unit tests for new function.
…d new helper function to properly map new values to ManagedServiceType enumeration. Updated README to reflect changes.
…tests to mock calls to this function.
…ts. Removed SMO typed OutputType specifications.
…cordingly; Added fix and tests for local service accounts; Removed duplicate unit tests caused by rebase.
… per code review.
Review status: 7 of 9 files reviewed at latest revision, 9 unresolved discussions. Tests/Unit/MSFT_xSQLServerServiceAccount.Tests.ps1, line 25 at r9 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Tests/Unit/MSFT_xSQLServerServiceAccount.Tests.ps1, line 54 at r9 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Tests/Unit/MSFT_xSQLServerServiceAccount.Tests.ps1, line 66 at r9 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Originally did this to clear some PSSA warnings. Done. Tests/Unit/MSFT_xSQLServerServiceAccount.Tests.ps1, line 122 at r9 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Tests/Unit/MSFT_xSQLServerServiceAccount.Tests.ps1, line 137 at r9 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Tests/Unit/MSFT_xSQLServerServiceAccount.Tests.ps1, line 144 at r9 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Tests/Unit/MSFT_xSQLServerServiceAccount.Tests.ps1, line 229 at r9 (raw file): Previously, johlju (Johan Ljunggren) wrote…
|
Reviewed 1 of 1 files at r10, 1 of 1 files at r11. Comments from Reviewable |
@nabrond Awesome work on this one! |
Pull Request (PR) description
Added new resource
xSQLServerServiceAccount
with examples and localization information.This Pull Request (PR) fixes the following issues:
Fixes #706
Task list:
This change is