Skip to content

[IR-6584] feat(escalate): CLI: add escalate verb for incidents - #85

Merged
kwent merged 12 commits into
masterfrom
soil/ir-6584-304657
Nov 11, 2026
Merged

kwent merged 12 commits into
masterfrom
soil/ir-6584-304657

Conversation

@kwent

@kwent kwent commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Why

Responders can't page a team from the terminal today. This adds an escalate verb for incidents and extends alerts escalate so a team can be paged without leaving the CLI. Ref #54.

What changed

  • rootly incidents escalate <incident-id> --team=<slug-or-id> (new). Pages the team and links the page to the incident.
    • Accepts a UUID, slug, or sequential ID such as INC-123 (resolved with the existing api.NormalizeIncidentID).
    • Optional --escalation-policy=<id> pages that policy as well, and --note=<text> is sent to the responders.
    • The page is created as an alert with the team as a notification target, then attached to the incident. Alerts already linked to the incident are kept.
    • If paging succeeds but linking fails, the error names the created alert. Retry only the link with --link-alert=<alert-id>, which doesn't page again and doesn't need --team.
  • rootly alerts escalate <alert-id> --team=<slug-or-id> (extended). Pages the team on the existing alert. Without --team, the existing --escalation-policy / --level behaviour is unchanged. --team can't be combined with --level.
  • Errors: an empty or unknown team gives a clear error before anything is paged, and the API's error title is shown when the API rejects the request (for example, when alerting isn't enabled for the organization).
  • README and --help examples document both commands.

Usage

# Page a team for an incident
rootly incidents escalate INC-123 --team=platform

# Also page an escalation policy, with a note for the responders
rootly incidents escalate INC-123 --team=platform --escalation-policy=<uuid> --note="Database is down"

# Retry only the link if it failed after paging
rootly incidents escalate INC-123 --link-alert=<alert-id>

# Page a team on an existing alert
rootly alerts escalate <alert-id> --team=platform

How to test

go test ./internal/...
make coverage && make coverage-check

Unit tests cover both commands and the new client methods, including the error paths.

kwent and others added 5 commits November 4, 2026 21:26
… to an incident

Co-authored-by: soil-cloud[bot] <344511034+soil-cloud[bot]@users.noreply.github.com>
Co-authored-by: soil-cloud[bot] <344511034+soil-cloud[bot]@users.noreply.github.com>
Co-authored-by: soil-cloud[bot] <344511034+soil-cloud[bot]@users.noreply.github.com>
… prefix

Co-authored-by: soil-cloud[bot] <344511034+soil-cloud[bot]@users.noreply.github.com>
…nd alert_ids under attributes, keep linked alerts, no stale summary, --link-alert retry

Co-authored-by: soil-cloud[bot] <344511034+soil-cloud[bot]@users.noreply.github.com>
@kwent
kwent requested a review from a team November 4, 2026 21:39
@kwent kwent added the soil:override Opened by a Soil automation from Soil:override label Nov 4, 2026
@soil-cloud

soil-cloud Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Soil is watching this PR. It acts on CodeFlow's review of the latest commit, review comments and change requests, red CI (after checking master and re-running once for flakes) and merge conflicts: one commit per fix, with a reply in each thread it handles. It skips comments containing "(aside)".
The PR's owner can comment stop (or stop: <reason>) to have Soil close this PR.

  • Disable Soil's automatic review, CI and merge-conflict monitoring

@greptile-apps

greptile-apps Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The latest push appears safe to merge; it fixes the link request without introducing a new issue.

Summary

The latest push fixes the incident-alert link request and updates its test.

  • Responders can page a team for an incident and link the new alert.
  • Alert escalation can page a team on an existing alert.

Reviews (5) · Last reviewed commit: "Send data.type alerts when attaching ale..." · Reviewed by Greptile

Comment thread internal/api/client.go Resolved
Comment thread internal/cmd/incidents/escalate.go Resolved
kwent and others added 2 commits November 4, 2026 21:41
…oBody)

Co-authored-by: soil-cloud[bot] <344511034+soil-cloud[bot]@users.noreply.github.com>
Co-authored-by: soil-cloud[bot] <344511034+soil-cloud[bot]@users.noreply.github.com>
@soil-cloud

soil-cloud Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

@greptileai please review the latest push (be7c2dc). The --link-alert retry no longer needs --team. The concurrent-link finding is answered in its thread: the API only offers a replace-the-set endpoint, so the CLI can't make that atomic.

Co-authored-by: soil-cloud[bot] <344511034+soil-cloud[bot]@users.noreply.github.com>
@soil-cloud

soil-cloud Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Merged the latest master into this branch. The only upstream change was an addition to the README (incident association flags), with no overlap with the escalate changes, so no adaptation was needed. go vet and the tests pass, and coverage is 80.77%.

@greptileai please re-review the latest push.

@soil-cloud

soil-cloud Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Soil council

Soil's council reviewed this change across 6 commits (ee81b4f to 37f73ec): 5 findings. 5 fixed before posting (5 re-checked gone at a later commit), 0 rebutted, 0 the lane could not fix.

Fixed before posting (5)
  • internal/api/client.go:2698: Existing alert ID is sent at the wrong nesting level, fixed in ee81b4f, re-checked gone at ee81b4f
  • internal/api/client.go:2739: Incident attachment omits the required JSON:API envelope, fixed in ee81b4f, re-checked gone at ee81b4f
  • internal/cmd/incidents/escalate.go:70: A second incident escalation removes existing alert links, fixed in ee81b4f, re-checked gone at ee81b4f
  • internal/cmd/incidents/escalate.go:66: Retrying after a link failure pages the team again, fixed in ee81b4f, re-checked gone at ee81b4f
  • internal/cmd/alerts/escalate.go:86: Paging an alert overwrites a concurrent summary edit, fixed in ee81b4f, re-checked gone at ee81b4f

… lost

Co-authored-by: soil-cloud[bot] <344511034+soil-cloud[bot]@users.noreply.github.com>
@soil-cloud

soil-cloud Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

@greptileai please re-review the latest push (f85230b).

Comment thread internal/api/client.go Resolved
kwent and others added 2 commits November 5, 2026 01:40
…sults

Co-authored-by: soil-cloud[bot] <344511034+soil-cloud[bot]@users.noreply.github.com>
Co-authored-by: soil-cloud[bot] <344511034+soil-cloud[bot]@users.noreply.github.com>
@soil-cloud

soil-cloud Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

@greptileai please re-review the latest push (37f73ec).

@kwent
kwent merged commit 7580788 into master Nov 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:medium soil:override Opened by a Soil automation from Soil:override

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant