SqlLogin: add language parameter#2447
Conversation
WalkthroughAdds a new Language property to the SqlLogin DSC resource: schema updated, implementation updated to accept/return/validate Language in Get/Set/Test-TargetResource, localization string added, and unit tests extended to cover Language propagation. Changes
Sequence Diagram(s)mermaid mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. No actionable comments were generated in the recent review. 🎉 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In `@CHANGELOG.md`:
- Around line 25-26: Update the CHANGELOG entry for SqlLogin to follow
formatting rules: make the resource name italic (use _SqlLogin_), bold the
parameter name (use **Language**), ensure the description line is wrapped to
under 80 characters, and if there is an associated issue append the standard
issue link format (e.g., [issue
`#NNNN`](https://github.com/<owner>/<repo>/issues/<issue_number>)) at the end of
the entry; locate the current entry referencing SqlLogin and Language to apply
these changes.
In `@source/DSCResources/DSC_SqlLogin/DSC_SqlLogin.psm1`:
- Around line 485-491: The Test-TargetResource function's comment-based help is
missing a .PARAMETER entry for the new Language parameter; update the help block
for Test-TargetResource to add a .PARAMETER Language section that briefly
describes the Language parameter's purpose (e.g., the login's default language),
its type (String), and any accepted values or default behavior so documentation
includes all parameters.
In `@tests/Unit/DSC_SqlLogin.Tests.ps1`:
- Around line 768-799: The test asserts that New-SQLServerLogin receives a
Login.Language value, but Set-TargetResource applies Language via
Update-SQLServerLogin after creation; update the tests to assert
Update-SQLServerLogin is invoked with $Login.Language -eq 'Français' (instead of
New-SQLServerLogin) for the two language-creation contexts, or alternatively
change Set-TargetResource implementation to set Language before calling
New-SQLServerLogin; reference the Set-TargetResource call path and replace the
Should -Invoke check that targets New-SQLServerLogin with an equivalent Should
-Invoke check targeting Update-SQLServerLogin (and keep the Connect-SQL
invocation assertion).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2447 +/- ##
=====================================
Coverage 94% 94%
=====================================
Files 227 227
Lines 10788 10801 +13
=====================================
+ Hits 10159 10172 +13
Misses 629 629
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@source/DSCResources/DSC_SqlLogin/DSC_SqlLogin.psm1`:
- Around line 559-563: Add the missing localized key WrongLanguage to the
resource strings file used by DSC_SqlLogin (the en-US .strings.psd1 for
DSC_SqlLogin): create an entry named WrongLanguage with a format string that
mirrors existing keys (e.g., "The login '{0}' has the language '{1}', but
expected it to have the language '{2}'.") so the call to
$script:localizedData.WrongLanguage in DSC_SqlLogin.psm1 resolves correctly;
follow the same key/value syntax and placement as other keys like
WrongDefaultDatabase.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@source/DSCResources/DSC_SqlLogin/en-US/DSC_SqlLogin.strings.psd1`:
- Line 22: Rename the localization key WrongLanguage to use underscores (e.g.,
Wrong_Language) in DSC_SqlLogin.strings.psd1 and update every reference to that
key throughout the codebase (resource accessors, tests, callers, and any
Get-LocalizedString/LoadString usages) to the new key name so localization
lookup continues to work; ensure the placeholder order/format
('{0}','{1}','{2}') remains unchanged when updating references.
johlju
left a comment
There was a problem hiding this comment.
@johlju reviewed 5 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @cai-n).
|
Great work on this! |
Pull Request (PR) description
Add the parameter
Languageto SqlLogin to allow setting the default language used by the login.This Pull Request (PR) fixes the following issues
None
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