dsccommunity / ActiveDirectoryDsc

This module contains DSC resources for deployment and configuration of Active Directory Domain Services.
MIT License
345 stars 142 forks source link

ADGroup: Updating means to retrieve group members #617

Closed jeremyciak closed 4 years ago

jeremyciak commented 4 years ago

Pull Request (PR) description

This Pull Request is intended to offer a viable mechanism for the Get-TargetResource aspect of the ADGroup resource when dealing with group members through a one-way trust.

This Pull Request (PR) fixes the following issues

Task list


This change is Reviewable

jeremyciak commented 4 years ago

616

codecov[bot] commented 4 years ago

Codecov Report

Merging #617 into master will increase coverage by 0%. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #617   +/-   ##
=====================================
  Coverage      98%    98%           
=====================================
  Files          24     24           
  Lines        3110   3154   +44     
=====================================
+ Hits         3049   3093   +44     
  Misses         61     61           
X-Guardian commented 4 years ago

@jeremyciak, please continue the discussion on the issue thread, before you make any further additions to this PR.

jeremyciak commented 4 years ago

@X-Guardian, I apologize! I had a reply ready to comment on the issue thread and never actually hit the button to send it through. I have added that comment now.

X-Guardian commented 4 years ago

@jeremyciak, can you edit the PR description and add some detail and link to the issue.

jeremyciak commented 4 years ago

@X-Guardian I have added a description and link to the issue in the initial PR comment.

X-Guardian commented 4 years ago

Hi @jeremyciak, don't know if you have used Reviewable before, but if you haven't, press the Reviewable button in the PR description to see all the review comments in the context of the code. You can then respond to each one individually there.

X-Guardian commented 4 years ago

source/DSCResources/MSFT_ADGroup/MSFT_ADGroup.psm1, line 237 at r6 (raw file):

Previously, jeremyciak wrote…
I haven't yet made any code changes to represent this request. I will do so once I get feedback on my comment. One question I have is at least if I am moving to `New-InvalidOperationException` away from `Write-Error` then should my syntax update be to change this: ```powershell Write-Error -Exception $_.Exception ``` ... to this: ```powershell New-InvalidOperationException -ErrorRecord $_ ```

It just needs a generic message, something like 'Error retrieving membership for group. (ADG0014)'.

X-Guardian commented 4 years ago

This is getting pretty close @jeremyciak. I've tested your module updates in my lab and it is looking good. Just the last few review comments to cover.

For future info, when you have forked a GitHub repo, for each PR, create yourself a new branch on your fork for making any changes in, rather than using master. This makes it easier for reviewers to add your repo is a remote reference and check out the updated branch.

jeremyciak commented 4 years ago

Woohoo! Successful code coverage!

@X-Guardian, thank you so much for all of your time and effort spent guiding and educating me in all of this. I have learned a ton and I feel like a much more worthy contributor now.

X-Guardian commented 4 years ago

Regarding updating the ActiveDirectoryDsc.Common docs, you just need install the platyps module, change your path to the source\Modules\ActiveDirectoryDsc.Common folder and then run the Build-Readme.ps1 script. If you get any errors, let me know what they are.

X-Guardian commented 4 years ago

@jeremyciak, can you try Build-Readme.ps1 with PowerShell 5.x rather than 7?

X-Guardian commented 4 years ago

OK @jeremyciak, looking good. My one-way trust tests work and I've just successfully run the ADGroup integration tests, so just the ActiveDirectoryDsc.Common docs update and we should be good to go!

jeremyciak commented 4 years ago

@X-Guardian, I just got the docs to successfully create and those changes are in the pipeline now. Seems like if you import the platyPS module first and then let the build mechanism do its thing then the powershell-yaml module does not have issue on Powershell 5.1. Probably something that warrants investigation at some point!

briantist commented 4 years ago

I'ms o happy to see this fixed! https://github.com/dsccommunity/ActiveDirectoryDsc/issues/235