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

SqlDatabaseUser: New DSC resource #1391

Merged
merged 42 commits into from
Jul 17, 2019
Merged

SqlDatabaseUser: New DSC resource #1391

merged 42 commits into from
Jul 17, 2019

Conversation

pshamus
Copy link
Contributor

@pshamus pshamus commented Jul 12, 2019

Pull Request (PR) description

This Pull Request (PR) fixes the following issues

Task list

  • Added an entry under the Unreleased section of the change log in the CHANGELOG.md.
    Entry should say what was changed, and how that affects users (if applicable).
  • Resource documentation added/updated in README.md.
  • Resource parameter descriptions added/updated in README.md, schema.mof
    and comment-based help.
  • Comment-based help added/updated.
  • Localization strings added/updated in all localization files as appropriate.
  • Examples appropriately added/updated.
  • Unit tests added/updated. See DSC Resource Testing Guidelines.
  • Integration tests added/updated (where possible). See DSC Resource Testing Guidelines.
  • New/changed code adheres to DSC Resource Style Guidelines and Best Practices.

This change is Reviewable

@codecov-io
Copy link

codecov-io commented Jul 12, 2019

Codecov Report

Merging #1391 into dev will increase coverage by <1%.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##            dev   #1391    +/-   ##
=====================================
+ Coverage    98%     98%   +<1%     
=====================================
  Files        36      37     +1     
  Lines      5359    5523   +164     
=====================================
+ Hits       5253    5417   +164     
  Misses      106     106

@johlju johlju added the waiting for code fix A review left open comments, and the pull request is waiting for changes to be pushed by the author. label Jul 13, 2019
@johlju
Copy link
Member

johlju commented Jul 13, 2019

Thank you for this @pshamus! I will make sure this gets over the finish line.

Copy link
Member

@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 18 of 29 files at r2.
Reviewable status: 18 of 29 files reviewed, all discussions resolved

@johlju
Copy link
Member

johlju commented Jul 14, 2019

I will fix integration tests tomorrow, then this is ready to be reviewed.

Copy link
Member

@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.

Reviewable status: 18 of 29 files reviewed, 1 unresolved discussion (waiting on @pshamus)


README.md, line 839 at r2 (raw file):

Specifies if it is allowed to re-create

Reads wrong, maybe '...resource is allowed to...'

Copy link
Contributor Author

@pshamus pshamus left a comment

Choose a reason for hiding this comment

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

Nice work! This is much more advanced than my original resource.

Reviewable status: 17 of 38 files reviewed, 2 unresolved discussions (waiting on @johlju)


README.md, line 839 at r2 (raw file):

Previously, johlju (Johan Ljunggren) wrote…
Specifies if it is allowed to re-create

Reads wrong, maybe '...resource is allowed to...'

Yeah, that sounds better.


README.md, line 818 at r3 (raw file):

* **`[String]` InstanceName** _(Key)_: Specifies the SQL instance in which
  the database exist.
* **`[String]` DatabaseName** _(Key)_: Specifies the name of the database in

I'm curious why you chose to use DatabaseName instead of Database as the property name. I used Database to try and be consistent with other resources, like the SqlDatabaseRole I updated.

Copy link
Member

@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.

Reviewable status: 17 of 38 files reviewed, 1 unresolved discussion (waiting on @johlju and @pshamus)


README.md, line 818 at r3 (raw file):

Previously, pshamus (Paul Shamus) wrote…

I'm curious why you chose to use DatabaseName instead of Database as the property name. I used Database to try and be consistent with other resources, like the SqlDatabaseRole I updated.

I had two thoughts around that, first that the other properties in the same resource ends with *Name, so to be consequent with them. Also since it is the name (a string) we should provide in that property, not a database object or something else. Using 'DatabaseName' made it more clear by just reading the name of the property that is should be the name of the database.

We should really ha e a naming standard and fixing that throughout. 🙂

@johlju
Copy link
Member

johlju commented Jul 15, 2019

@pshamus Thank you! Yeah, I looked into what one could add for type of users to a database and realized that we would need to do a breaking change to add more user types, so I thought I just make sure it worked out of the box or at least making it less chance that the keys needed to be changed. 😁 Your code helped a lot, and made it a lot easier fixing this! So thank you! 😃

Copy link
Contributor Author

@pshamus pshamus left a comment

Choose a reason for hiding this comment

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

Well nicely done! I had a simple use case and didn't need the extra work but this is excellent.

Reviewable status: 17 of 38 files reviewed, 1 unresolved discussion (waiting on @johlju and @pshamus)


README.md, line 818 at r3 (raw file):

Previously, johlju (Johan Ljunggren) wrote…

I had two thoughts around that, first that the other properties in the same resource ends with *Name, so to be consequent with them. Also since it is the name (a string) we should provide in that property, not a database object or something else. Using 'DatabaseName' made it more clear by just reading the name of the property that is should be the name of the database.

We should really ha e a naming standard and fixing that throughout. 🙂

Makes sense. I originally used DatabaseName for SqlDatabaseRole but switched it because I was following the convention of other resources. Carry on!

Copy link
Member

@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 7 of 29 files at r2, 5 of 11 files at r3, 2 of 3 files at r4, 4 of 8 files at r5.
Reviewable status: 34 of 39 files reviewed, all discussions resolved

@johlju johlju added needs review The pull request needs a code review. and removed waiting for code fix A review left open comments, and the pull request is waiting for changes to be pushed by the author. labels Jul 16, 2019
Copy link
Member

@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 1 of 29 files at r2, 4 of 8 files at r5.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@johlju johlju merged commit bb95eb8 into dsccommunity:dev Jul 17, 2019
@johlju johlju removed the needs review The pull request needs a code review. label Jul 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment