-
Notifications
You must be signed in to change notification settings - Fork 141
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
ADGroup: Refactor Module, Unit and Integration Tests #631
Conversation
Codecov Report
@@ Coverage Diff @@
## main #631 +/- ##
=====================================
Coverage ? 98%
=====================================
Files ? 25
Lines ? 3408
Branches ? 0
=====================================
Hits ? 3340
Misses ? 68
Partials ? 0 |
any further progress with this? |
It is on my todo list to review. |
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 5 files at r2, 1 of 1 files at r3.
Reviewable status: 4 of 11 files reviewed, all discussions resolved (waiting on @johlju)
source/DSCResources/MSFT_ADGroup/MSFT_ADGroup.psm1, line 103 at r3 (raw file):
# This FullyQualifiedErrorId is indicative of a failure to retrieve members with Get-ADGroupMember # for a one-way trust
We should use comment-block on comments that are more than one row. Throughout the code.
<#
This FullyQualifiedErrorId is indicative of a failure to retrieve members with Get-ADGroupMember
for a one-way trust
#>
source/DSCResources/MSFT_ADGroup/MSFT_ADGroup.psm1, line 366 at r3 (raw file):
[HashTable] $parameters = $PSBoundParameters
This does not really create a new hashtable? 🤔 [HashTable] $parameters = @{} + $PSBoundParameters
would. 🤔
@X-Guardian I started the review but I is such a big change that I have not time to review it properly. You may merge this if you feel it is ready, and fix any problems after that. If someone else have time to review the code fell free to do so. |
Pull Request (PR) description
This PR refactors the module, unit and integration tests of the
ADGroup
resource as follows:Get-TargetResource
.Try/Catch
blocks fromGet-TargetResource
.Test-TargetResource
to useCompare-ResourcePropertyState
common function.Set-TargetResource
to useCompare-ResourcePropertyState
common function.Compare-Object
to only add/remove changed members.Set-ADCommonGroupMember
function so parameters are not changed.Credential
parameter description.This Pull Request (PR) fixes the following issues
Task list
file CHANGELOG.md. Entry should say what was changed and how that
affects users (if applicable), and reference the issue being resolved
(if applicable).
and comment-based help.
This change is