Skip to content
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: SqlPermission: Refactored resource (class-based resource) #1778

Merged
merged 13 commits into from
Jul 31, 2022

Conversation

johlju
Copy link
Member

@johlju johlju commented Jul 30, 2022

Pull Request (PR) description

  • SqlServerDsc
    • The following classes were added to the module:
      • ServerPermission - complex type for the DSC resource SqlPermission.
    • The following public functions were added to the module (see comment-based
      help for more information):
      • Test-SqlDscIsLogin
      • ConvertFrom-SqlDscServerPermission
      • ConvertTo-SqlDscServerPermission
      • Get-SqlDscServerPermission
      • Set-SqlDscServerPermission
    • SMO stubs (used in the unit tests)
      • Was updated to remove a bug related to the type ServerPermissionInfo
        when used with the type ServerPermissionSet. The stubs suggested that
        the property PermissionType (of type ServerPermissionSet)
        in ServerPermissionInfo should have been a array ServerPermissionSet[].
        This conflicted with real SMO as it does not pass an array, but instead
        a single ServerPermissionSet. The stubs was modified to mimic the
        real SMO. At the same time some old mock code in the SMO stubs was removed
        as it was no longer in use.
  • SqlPermission
    • BREAKING CHANGE: The resource has been refactored. The parameters
      Permissions has been replaced by parameters Permission,
      PermissionToInclude, and PermissionToExclude. These permissions
      parameters are now an instance of the type ServerPermission.
      The type ServerPermission contains two properties; State and
      Permission. This closes the issue issue #1761,
      it also fixes the issues issue #1773,
      issue #1704,
      and issue #752.
    • The resource was refactored into a class-based resource.
  • SqlDatabasePermission
    • Fixed comment-based help and cleaned up comments.
    • Fix localized string that referenced 'user' instead of 'principal',
      and correct localized string ID for each string.
  • Set-SqlDscDatabasePermission
    • Minor code cleanup.

This Pull Request (PR) fixes the following issues

Task list

  • Added an entry to the change log under the Unreleased section of the
    file CHANGELOG.md. Entry should say what was changed and how that
    affects users (if applicable), and reference the issue being resolved
    (if applicable).
  • Resource documentation updated in the resource's README.md.
  • Resource parameter descriptions updated in schema.mof.
  • Comment-based help updated, including parameter descriptions.
  • Localization strings updated.
  • Examples updated.
  • Unit tests updated. See DSC Community Testing Guidelines.
  • Integration tests updated (where possible). See DSC Community Testing Guidelines.
  • Code changes adheres to DSC Community Style Guidelines.

This change is Reviewable

@johlju johlju added the needs review The pull request needs a code review. label Jul 30, 2022
@codecov
Copy link

codecov bot commented Jul 30, 2022

Codecov Report

Merging #1778 (852f245) into main (c560fa0) will decrease coverage by 0%.
The diff coverage is n/a.

Impacted file tree graph

@@         Coverage Diff          @@
##           main   #1778   +/-   ##
====================================
- Coverage    86%     86%   -1%     
====================================
  Files        37      36    -1     
  Lines      6261    6185   -76     
====================================
- Hits       5422    5349   -73     
+ Misses      839     836    -3     
Flag Coverage Δ
unit 86% <ø> (-1%) ⬇️

Copy link
Member Author

@johlju johlju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 33 of 38 files at r1, 7 of 7 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @johlju)

Copy link
Member Author

@johlju johlju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 3 of 3 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @johlju)

@johlju johlju merged commit 1fe1dce into dsccommunity:main Jul 31, 2022
@johlju johlju deleted the fix/issue-1773 branch July 31, 2022 09:36
@johlju johlju removed the needs review The pull request needs a code review. label Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment