-
Notifications
You must be signed in to change notification settings - Fork 144
xActiveDirectory: Fix Script Analyzer Rule Failures #303
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
Conversation
- Script Analyzer fix - Message localization - Add missing verbose messages
- Message localization - Add missing verbose messages
- Message localization - Add missing verbose messages
- Message localization - Add missing verbose messages
- Script Analyzer fix - Message localization - Add missing verbose messages
Merge Dev
Codecov Report
@@ Coverage Diff @@
## dev #303 +/- ##
====================================
+ Coverage 90% 92% +2%
====================================
Files 20 20
Lines 2241 2299 +58
Branches 10 10
====================================
+ Hits 2029 2135 +106
+ Misses 202 154 -48
Partials 10 10 |
- Move message localization to external file - Suppress PSDSCUseVerboseMessageInDSCResource - Script Analyzer fix
- Fix Should Throw message
Hi @johlju, I can't improve the Can you add this to your list of PRs to review? Thanks. |
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.
Thank you for all this work! 😃 A few review comments.
Reviewed 9 of 15 files at r3, 9 of 9 files at r4, 1 of 1 files at r5.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @X-Guardian)
CHANGELOG.md, line 54 at r5 (raw file):
Quoted 5 lines of code…
- Changes to xActiveDirectory - Fix Script Analyzer rule failures - Opt-in to "Common Tests - Custom Script Analyzer Rules" - Opt-in to "Common Tests - Required Script Analyzer Rules" - Opt-in to "Common Tests - Flagged Script Analyzer Rules"
Let's move this entries to the Changes to xActiveDirectory
at the top.
DSCResources/MSFT_xADDomainTrust/MSFT_xADDomainTrust.psm1, line 101 at r5 (raw file):
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSDSCUseVerboseMessageInDSCResource", "")]
Instead of this, please add at least one Write-Verbose message in this function. I rather we add verbose messages than overriding this. If we want to pass the common test then please add at least one verbose message.
Throughout where this override exist. Sorry, I know it will be a bit of additional work, but it helps debugging in the future.
I'm okay by removing the overrides and opt-out from that particular common test if there are more places that has this override.
I rather see verbose logging is improved than overridden. 🙂
DSCResources/MSFT_xADDomainTrust/MSFT_xADDomainTrust.psm1, line 133 at r5 (raw file):
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSDSCUseVerboseMessageInDSCResource", "")]
See previous comment.
Awesome improvement on the coverage percentage! 😃 |
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 18 files reviewed, 3 unresolved discussions (waiting on @johlju)
CHANGELOG.md, line 54 at r5 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
- Changes to xActiveDirectory - Fix Script Analyzer rule failures - Opt-in to "Common Tests - Custom Script Analyzer Rules" - Opt-in to "Common Tests - Required Script Analyzer Rules" - Opt-in to "Common Tests - Flagged Script Analyzer Rules"
Let's move this entries to the
Changes to xActiveDirectory
at the top.
Done.
DSCResources/MSFT_xADDomainTrust/MSFT_xADDomainTrust.psm1, line 101 at r5 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSDSCUseVerboseMessageInDSCResource", "")]
Instead of this, please add at least one Write-Verbose message in this function. I rather we add verbose messages than overriding this. If we want to pass the common test then please add at least one verbose message.
Throughout where this override exist. Sorry, I know it will be a bit of additional work, but it helps debugging in the future.
I'm okay by removing the overrides and opt-out from that particular common test if there are more places that has this override.
I rather see verbose logging is improved than overridden. 🙂
Are you sure? There is plenty of verbose logging in the Confirm-ResourceProperties
helper function which is all that this function calls. Adding another verbose message here is then just noise. I can add a justification attribute saying 'Verbose messaging in helper function' if that would help.
DSCResources/MSFT_xADDomainTrust/MSFT_xADDomainTrust.psm1, line 133 at r5 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSDSCUseVerboseMessageInDSCResource", "")]
See previous comment.
Same response as previous comment.
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 18 of 19 files at r7.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @X-Guardian)
DSCResources/MSFT_xADDomainTrust/MSFT_xADDomainTrust.psm1, line 101 at r5 (raw file):
Previously, X-Guardian (Simon Heather) wrote…
Are you sure? There is plenty of verbose logging in the
Confirm-ResourceProperties
helper function which is all that this function calls. Adding another verbose message here is then just noise. I can add a justification attribute saying 'Verbose messaging in helper function' if that would help.
Ah okay! Did not realizes that. Yes, please add a comment to the override. Thanks for questioning my comment! 🙂
DSCResources/MSFT_xADDomainTrust/MSFT_xADDomainTrust.psm1, line 133 at r5 (raw file):
Previously, X-Guardian (Simon Heather) wrote…
Same response as previous comment.
Ah okay! Did not realizes that. Yes, please add a comment to the override. Thanks for questioning my comment! 🙂
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: 16 of 18 files reviewed, 2 unresolved discussions (waiting on @johlju)
DSCResources/MSFT_xADDomainTrust/MSFT_xADDomainTrust.psm1, line 101 at r5 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Ah okay! Did not realizes that. Yes, please add a comment to the override. Thanks for questioning my comment! 🙂
Done.
DSCResources/MSFT_xADDomainTrust/MSFT_xADDomainTrust.psm1, line 133 at r5 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Ah okay! Did not realizes that. Yes, please add a comment to the override. Thanks for questioning my comment! 🙂
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.
Reviewed 1 of 1 files at r8, 1 of 1 files at r9.
Reviewable status:complete! all files reviewed, all discussions resolved
Thank you for this @X-Guardian! 🙇 |
Pull Request (PR) description
This PR fixes all the current Script Analyzer rule failures that are occurring during the AppVeyor build and opts in to the following tests for future builds:
A summary of the changes that have been made are as follows:
New tests have also been added for the following resources:
This Pull Request (PR) fixes the following issues
None
Task list
Entry should say what was changed, and how that affects users (if applicable).
and comment-based help.
This change is