feat(incident): add set-status command for status transitions#15
Merged
Conversation
Status transitions (active/stable/resolved) now live in a dedicated `puppy incident set-status <id> <status>` command rather than being buried in the general-purpose update command. - Add `set_incident_status` CLI command that PATCHes the `state` custom field directly via the raw incidents API - Remove `--status` from `incident update` (was silently ignored by the SDK layer anyway; the raw-field approach is the correct path) - Fix stale UsageError message in `update` that still referenced `--status` - Remove `status` param from `dd_incidents_update` MCP tool - Add `dd_incidents_set_status` MCP tool that wraps the new CLI command - Add TestSetStatusIncident test class (table, json, invalid-status cases) - Fix test_update_incident which was invoking `--status` on update Closes #6 (dd_incidents_list default filter was fixed in a prior commit; this commit completes the status-separation work that issue prompted)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
puppy incident set-status <id> <status>as a dedicated command for active/stable/resolved transitions, replacing the--statusflag that was silently broken onincident update(the SDK layer never forwarded it to the correct raw-field endpoint)--statusfromincident updateand thedd_incidents_updateMCP tool so callers can no longer hit the dead code pathdd_incidents_set_statusMCP tool that wraps the new command, keeping the AI agent surface consistentCloses
Closes #6 — the
dd_incidents_listdefault filter was fixed in a prior commit (sort defaulted oldest-first, no status filter); this PR completes the status-handling work the issue prompted and closes it out.Test plan
uv run pytest tests/commands/test_incident.py -v— 42 tests pass including 3 newTestSetStatusIncidentcasesuv run puppy incident set-status --helpshowsactive,stable,resolvedchoicesuv run puppy incident set-status <real-id> stableupdates status in Datadog UIuv run puppy incident update <id>with no--statusarg still works; passing--statusnow errors with "no such option"End-user impact
Incident status transitions now work correctly via both the CLI and the MCP tool. Previously, calling
dd_incidents_updatewithstatus='resolved'silently did nothing — the update went through but the status field was never changed. Agents and operators can now reliably move incidents through their lifecycle (active → stable → resolved) without manually patching the Datadog API.