-
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
BREAKING CHANGE: SqlDatabasePermission: Refactored resource (class-based resource) #1769
Conversation
I would be happy to get initial review on this while I get the integration tests finished. |
Codecov Report
@@ Coverage Diff @@
## main #1769 +/- ##
=====================================
- Coverage 87% 86% -2%
=====================================
Files 38 37 -1
Lines 6349 6261 -88
=====================================
- Hits 5575 5422 -153
- Misses 774 839 +65
|
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 24 of 55 files at r1, 42 of 43 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 7 unresolved discussions
source/Private/ConvertTo-Reason.ps1
line 34 at r4 (raw file):
[Parameter(Mandatory = $true)] [System.String] $ResourceName
Missing the parameter in comment-based help, and example is wromg.
Code quote:
$ResourceName
source/Private/Get-ClassName.ps1
line 24 at r4 (raw file):
[Parameter()] [System.Management.Automation.SwitchParameter] $Recurse
Missing the parameter in comment-based help, and missing an example.
Code quote:
$Recurse
source/Private/Get-DscProperty.ps1
line 27 at r4 (raw file):
[Parameter()] [System.String[]] $Name,
Missing the parameter in comment-based help, and missing an example.
Code quote:
$Name,
source/Private/Get-LocalizedDataRecursive.ps1
line 22 at r4 (raw file):
Returns a string array with at least one item. #> function Get-LocalizedDataRecursive
Missing an example.
Code quote:
Get-LocalizedDataRecursive
source/Private/Test-ResourceHasProperty.ps1
line 22 at r4 (raw file):
[Boolean] #> function Test-ResourceHasProperty
Missing an example
Code quote:
Test-ResourceHasProperty
source/Private/Test-ResourcePropertyIsAssigned.ps1
line 17 at r4 (raw file):
[Boolean] #> function Test-ResourcePropertyIsAssigned
Missing an example.
Code quote:
Test-ResourcePropertyIsAssigned
source/Public/Set-SqlDscDatabasePermission.ps1
line 94 at r4 (raw file):
[Parameter()] [System.Management.Automation.SwitchParameter] $Force
Missing the parameter in comment-based help
Code quote:
$Force
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: 46 of 67 files reviewed, 1 unresolved discussion (waiting on @johlju)
source/Private/Get-ClassName.ps1
line 24 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Missing the parameter in comment-based help, and missing an example.
Done
source/Private/Get-DscProperty.ps1
line 27 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Missing the parameter in comment-based help, and missing an example.
Done
source/Private/Get-LocalizedDataRecursive.ps1
line 22 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Missing an example.
Done
source/Public/Set-SqlDscDatabasePermission.ps1
line 94 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Missing the parameter in comment-based help
Done
source/Private/Test-ResourceHasProperty.ps1
line 22 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Missing an example
Done
source/Private/Test-ResourcePropertyIsAssigned.ps1
line 17 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Missing an example.
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.
Reviewable status: 46 of 67 files reviewed, all discussions resolved (waiting on @johlju)
source/Private/ConvertTo-Reason.ps1
line 34 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Missing the parameter in comment-based help, and example is wromg.
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 21 of 21 files at r5, 1 of 1 files at r6, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @johlju)
Pull Request (PR) description
prefix.ps1
which content is placed first in the built module(.psm1). This file imports dependent modules, and imports localized strings
used by private and public commands.
DatabasePermission
- complex type for the DSC resource SqlDatabasePermission.Ensure
- Enum to be used for the propertyEnsure
in class-basedresources.
Reason
- Used by methodGet()
to return the reason a property is notin desired state.
ResourceBase
- class that can be inherited by class-based resource andprovides functionality meant simplify the creating of class-based resource.
help for more information):
ConvertFrom-CompareResult
ConvertTo-Reason
Get-ClassName
Get-DscProperty
Get-LocalizedDataRecursive
Test-ResourceHasProperty
Test-ResourcePropertyIsAssigned
help for more information):
Connect-SqlDscDatabaseEngine
ConvertFrom-SqlDscDatabasePermission
ConvertTo-SqlDscDatabasePermission
Get-SqlDscDatabasePermission
Set-SqlDscDatabasePermission
Test-SqlDscIsDatabasePrincipal
.vscode/analyzersettings.psd1
.resources.
that makes class-based resource using inheritance to not work.
run on the source files (there is a new issue that is tracking so this
rule is only run on the built module).
that uses breakpoints to calculate coverage. Newer functionality sometimes
throw an exception when used in conjunction with class-based resources.¨
to the type
DatabasePermissionInfo
when used with the typeDatabasePermissionSet
.The stubs suggested that the property
PermissionType
(of typeDatabasePermissionSet
)in
DatabasePermissionInfo
should have been a arrayDatabasePermissionSet[]
.This conflicted with real SMO as it does not pass an array, but instead
a single
DatabasePermissionSet
. The stubs was modified to mimic thereal SMO. At the same time some old mock code in the SMO stubs was removed
as it was no longer in use.
SetupCredential
of the functionConnect-SQL
was renamedto
Credential
and the parameter nameSetupCredential
was made aparameter alias.
ParameterState
andPermissions
has been replaced by parametersPermission
,PermissionToInclude
, andPermissionToExclude
. Thesepermissions parameters are now an instance of the type
DatabasePermission
.The type
DatabasePermission
contains two properties;State
andPermission
.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).
This change is