-
Notifications
You must be signed in to change notification settings - Fork 227
Add SQL Agent Operator management commands #2154
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
Add SQL Agent Operator management commands #2154
Conversation
Co-authored-by: johlju <[email protected]>
Co-authored-by: johlju <[email protected]>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2154 +/- ##
=====================================
Coverage 94% 94%
=====================================
Files 132 145 +13
Lines 8740 9091 +351
=====================================
+ Hits 8284 8617 +333
- Misses 456 474 +18
🚀 New features to boost your workflow:
|
johlju
left a comment
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.
@copilot We should also add commands Enable-SqlDscAgentOperator and Disable-SqlDscAgentOperator that sets the Enabled propert on the Operator object.
…al parameters Co-authored-by: johlju <[email protected]>
Added both Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: johlju <[email protected]>
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the WalkthroughAdds a comprehensive Agent Operator command suite and configuration option commands, new private helpers and SMO test stubs, extensive unit and integration tests, localization entries, CI/test grouping changes, and style-guideline and small syntactic refinements; several cmdlets adopt ShouldProcess/ConfirmImpact, Force, and terminating-error semantics. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant User
participant Cmdlet
participant Helper as Get-AgentOperatorObject / Get-CommandParameter / ConvertTo-FormattedParameterDescription
participant SMO as SMO Server / JobServer / Operator
rect rgba(200,230,255,0.20)
User->>Cmdlet: Invoke (e.g. New-/Set-/Remove-/Enable-/Disable-)
Note right of Cmdlet: ParameterSet selection, Validate bound params
end
Cmdlet->>Cmdlet: Build ShouldProcess message
alt Force supplied
Cmdlet->>Cmdlet: Suppress confirmation (ConfirmPreference)
else ShouldProcess check
Cmdlet->>User: Prompt / WhatIf/Confirm
end
Cmdlet->>Helper: Resolve target / settable params
Helper->>SMO: Query JobServer.Operators or Configuration (optional Refresh)
SMO-->>Helper: Operator / ConfigProperty or null
Helper-->>Cmdlet: Return target info
alt Approved & target found
Cmdlet->>SMO: Call Create()/Alter()/Drop()/Change ConfigValue
SMO-->>Cmdlet: Success or throw
opt Exception
Cmdlet->>Cmdlet: ThrowTerminatingError(ErrorRecord with localized message/id/category/target)
end
else Target missing
Cmdlet->>Cmdlet: Write-Error or ThrowTerminatingError (per command)
end
Cmdlet-->>User: Return result (object/boolean/none) or error
Estimated code review effort🎯 5 (Critical) | ⏱️ ~180 minutes Rationale: Large, heterogeneous changes touching public API surface, new cmdlets with ShouldProcess/Force/terminating-error semantics, many new private helpers, expanded SMO stubs, extensive unit and integration tests, localization additions, and CI updates — requires careful API/behavioral, tests, and localization review. Possibly related PRs
Pre-merge checks (2 passed, 1 warning)❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Comment |
|
@copilot the instructions has changed since this last was worked on, make sure the code and tests follow all instructions. |
…idelines Co-authored-by: johlju <[email protected]>
Updated all Agent Operator source and test files to comply with current DSC community guidelines. Key changes include: Test Setup Fixes:
File Format Fixes:
Validation:
Commit 1113ccf |
johlju
left a comment
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.
@copilot add to PowerShell instructions in the File Rules section that "no line shall have trailing whitespace": https://github.com/dsccommunity/SqlServerDsc/blob/main/.github/instructions/dsc-community-style-guidelines-powershell.instructions.md#file-rules
…owerShell style guidelines Co-authored-by: johlju <[email protected]>
Added "No line shall have trailing whitespace" rule to the PowerShell style guidelines File Rules section. Commit fad08ed |
…AgentOperator integration tests
…s and related tests
…lDscConfigurationOption
…ption and update related tests
johlju
left a comment
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.
@johlju reviewed 2 of 10 files at r9, 7 of 39 files at r17, 7 of 34 files at r18, 2 of 16 files at r19, 6 of 15 files at r20, 7 of 15 files at r21, 4 of 11 files at r22, 1 of 1 files at r23, 1 of 5 files at r24, 2 of 5 files at r25, 30 of 30 files at r26, all commit messages.
Reviewable status: all files reviewed, 60 unresolved discussions (waiting on @copilot)
New-SqlDscAgentAlert: Use$PSCmdlet.ThrowTerminatingErrorfor terminating errors #2194New-SqlDscRole: Use$PSCmdlet.ThrowTerminatingErrorfor terminating errors #2197💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
This change is