Skip to content

feat(incident): add set-status command for status transitions#15

Merged
Kydoimos97 merged 1 commit into
mainfrom
fix/incident-status-separate-tool
Jun 8, 2026
Merged

feat(incident): add set-status command for status transitions#15
Kydoimos97 merged 1 commit into
mainfrom
fix/incident-status-separate-tool

Conversation

@Kydoimos97

Copy link
Copy Markdown

Summary

  • Adds puppy incident set-status <id> <status> as a dedicated command for active/stable/resolved transitions, replacing the --status flag that was silently broken on incident update (the SDK layer never forwarded it to the correct raw-field endpoint)
  • Removes --status from incident update and the dd_incidents_update MCP tool so callers can no longer hit the dead code path
  • Adds dd_incidents_set_status MCP tool that wraps the new command, keeping the AI agent surface consistent

Closes

Closes #6 — the dd_incidents_list default 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 new TestSetStatusIncident cases
  • uv run puppy incident set-status --help shows active, stable, resolved choices
  • uv run puppy incident set-status <real-id> stable updates status in Datadog UI
  • uv run puppy incident update <id> with no --status arg still works; passing --status now 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_update with status='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.

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)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Kydoimos97 Kydoimos97 merged commit 6541666 into main Jun 8, 2026
10 of 11 checks passed
@Kydoimos97 Kydoimos97 deleted the fix/incident-status-separate-tool branch June 8, 2026 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dd_incidents_list MCP tool returns only old resolved incidents, not active/stable ones

2 participants