dsccommunity / SqlServerDsc

This module contains DSC resources for deployment and configuration of Microsoft SQL Server.
MIT License
360 stars 225 forks source link

SqlDatabaseObjectPermission: Fixing issue with INSERT permissions #2007

Closed markaugust closed 6 months ago

markaugust commented 6 months ago

Pull Request (PR) description

This Pull Request (PR) fixes the following issues

Adding a foreach loop when checking object permissions to avoid issues with INSERT permissions

Task list


This change is Reviewable

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94%. Comparing base (a5c29fe) to head (d926778).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/dsccommunity/SqlServerDsc/pull/2007/graphs/tree.svg?width=650&height=150&src=pr&token=2L5l2Zcoqd&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dsccommunity)](https://app.codecov.io/gh/dsccommunity/SqlServerDsc/pull/2007?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dsccommunity) ```diff @@ Coverage Diff @@ ## main #2007 +/- ## ==================================== Coverage 94% 94% ==================================== Files 94 94 Lines 7919 7920 +1 ==================================== + Hits 7489 7490 +1 Misses 430 430 ``` | [Flag](https://app.codecov.io/gh/dsccommunity/SqlServerDsc/pull/2007/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dsccommunity) | Coverage Δ | | |---|---|---| | [unit](https://app.codecov.io/gh/dsccommunity/SqlServerDsc/pull/2007/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dsccommunity) | `94% <100%> (+<1%)` | :arrow_up: | | [Files](https://app.codecov.io/gh/dsccommunity/SqlServerDsc/pull/2007?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dsccommunity) | Coverage Δ | | |---|---|---| | [...ectPermission/DSC\_SqlDatabaseObjectPermission.psm1](https://app.codecov.io/gh/dsccommunity/SqlServerDsc/pull/2007?src=pr&el=tree&filepath=source%2FDSCResources%2FDSC_SqlDatabaseObjectPermission%2FDSC_SqlDatabaseObjectPermission.psm1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dsccommunity#diff-c291cmNlL0RTQ1Jlc291cmNlcy9EU0NfU3FsRGF0YWJhc2VPYmplY3RQZXJtaXNzaW9uL0RTQ19TcWxEYXRhYmFzZU9iamVjdFBlcm1pc3Npb24ucHNtMQ==) | `100% <100%> (ø)` | |
markaugust commented 6 months ago

@johlju I'm not familiar enough with Mocks and Unit test to know exactly what needs to be done here. Looking at the code block, I made some changes to the unit test, but let me know if that's not what you were meaning.

johlju commented 6 months ago

I will review this PR as soon as I have time. Will look over the changes to the test you made. Good work!

johlju commented 6 months ago

Unit tests looks okay, it correctly fails without the proposed change. I push a change to the integration test to try to mimic the scenario in the issue.

johlju commented 6 months ago

@markaugust great work on this!

markaugust commented 6 months ago

Thank you @johlju . Out of curiosity, is there a timeline on when those fixes will get moved into a full release branch, rather than just in a preview branch?

johlju commented 6 months ago

Usually when we (community) feel there should be a new full release. I pushed a release tag now, so should release if pipeline don't fail 😊