-
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
SqlAudit: New resources #1499
SqlAudit: New resources #1499
Conversation
great :-) so... thank you very much. |
@Fiander I have been there too, not knowing how to write tests, but it is not that difficult once you get the hang of it and you start to see the value with them. Now I write unit tests for everything in PowerShell. |
Labeling this pull request (PR) as abandoned since it has gone 14 days or more since the last update. An abandoned PR can be continued by another contributor. The abandoned label will be removed if work on this PR is taken up again. |
I'd definitely like to use these methods if this gains more traction. |
I thought I would had time to write the tests for these by now. Still on the todo but far down. If someone can write unit and integration tests for these resources we can merge them |
Labeling this pull request (PR) as abandoned since it has gone 14 days or more since the last update. An abandoned PR can be continued by another contributor. The abandoned label will be removed if work on this PR is taken up again. |
2a7d3f9
to
cca8cf9
Compare
After spending a long time converting this project to Pester 5 I'm finally able to continue with this. |
Codecov Report
@@ Coverage Diff @@
## main #1499 +/- ##
======================================
+ Coverage 86% 88% +1%
======================================
Files 36 69 +33
Lines 6185 7244 +1059
======================================
+ Hits 5349 6403 +1054
- Misses 836 841 +5
|
This PR is now ready for review if someone like to dig into it. SqlAudit was refactored entirely. I also moved out the SqlServerAuditSpecification to a separate PR. I looked at underlaying SMO classes and it looks like it should be possible to pass one or more For SqlAudit I would like to add a a couple of evaluations of the passed parameters before |
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 25 files at r1, 47 of 56 files at r2, 11 of 11 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion
source/en-US/SqlAudit.strings.psd1
line 17 at r3 (raw file):
EvaluateServerAudit = Evaluate the current audit '{0}' on the instance '{1}'. (SA0004) MaximumFileSizeValueInvalid = The maximum file size must be set to a value of 0 or a value between 2 and 2147483647. (SA0004) QueueDelayValueInvalid = The queue delay must be set to a value of 0 or a value between 1000 and 2147483647.
We should have identifiers on the localized strings.
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: 58 of 59 files reviewed, all discussions resolved (waiting on @johlju)
source/en-US/SqlAudit.strings.psd1
line 17 at r3 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
We should have identifiers on the localized strings.
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 r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @johlju)
Pull Request (PR) description
SqlResourceBase
- class that can be inherited by class-based resource andprovides default DSC properties and method for get a
[Server]
-object.help for more information):
Invoke-SqlDscQuery
Get-SqlDscAudit
New-SqlDscAudit
Set-SqlDscAudit
Remove-SqlDscAudit
Enable-SqlDscAudit
Disable-SqlDscAudit
Get-DscProperty
ExcludeName
to exclude property names from being returned.ConvertTo-Reason
$null
values on Windows PowerShell.replace backslash or slashes at the end of the string, e.g.
'/mypath/'
will become
'/mypath'
.ResourceBase
Ensure
correctly from derivedGetCurrentState()
. Butrequires that the
GetCurrentState()
only return key property if objectis present, and does not return key property if object is absent.
Optionally the resource's derived
GetCurrentState()
can handleEnsure
itself.
This PR continues the work that was made in the closed PR #1433. Big thanks to @Fiander for your initial work on this! 🙂
This Pull Request (PR) fixes the following issues
Fixes #1132
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