Skip to content

feat(rootly): expand Rootly integration from 14 to 27 tools#3902

Merged
waleedlatif1 merged 7 commits intostagingfrom
waleedlatif1/rootly-v2
Apr 2, 2026
Merged

feat(rootly): expand Rootly integration from 14 to 27 tools#3902
waleedlatif1 merged 7 commits intostagingfrom
waleedlatif1/rootly-v2

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

@waleedlatif1 waleedlatif1 commented Apr 2, 2026

Summary

  • Adds 13 new Rootly API tools: delete_incident, get_alert, update_alert, acknowledge_alert, resolve_alert, create_action_item, list_action_items, list_users, list_on_calls, list_schedules, list_escalation_policies, list_causes, list_playbooks
  • Full block definition with subBlocks, conditions, config.params mapping, inputs, and outputs for all 27 operations
  • All tools follow JSON:API spec with proper error handling, response transformation, and type definitions
  • Registry, index barrel exports, and integration docs all updated

New Tools

Tool Method Endpoint
Delete Incident DELETE /v1/incidents/{id}
Get Alert GET /v1/alerts/{id}
Update Alert PATCH /v1/alerts/{id}
Acknowledge Alert POST /v1/alerts/{id}/acknowledge
Resolve Alert POST /v1/alerts/{id}/resolve
Create Action Item POST /v1/incidents/{id}/action_items
List Action Items GET /v1/incidents/{id}/action_items
List Users GET /v1/users
List On-Calls GET /v1/oncalls
List Schedules GET /v1/schedules
List Escalation Policies GET /v1/escalation_policies
List Causes GET /v1/causes
List Playbooks GET /v1/playbooks

Test plan

  • Verify all 27 operations appear in the Rootly block dropdown
  • Test create/get/update/delete incident lifecycle
  • Test create/get/update/acknowledge/resolve alert lifecycle
  • Test action item CRUD on an incident
  • Test catalog list endpoints (users, on-calls, schedules, escalation policies, causes, playbooks)
  • Verify pagination works across all list endpoints
  • Verify advanced mode fields are hidden by default

Add 13 new tools: delete_incident, get_alert, update_alert,
acknowledge_alert, resolve_alert, create_action_item, list_action_items,
list_users, list_on_calls, list_schedules, list_escalation_policies,
list_causes, list_playbooks. Includes tool files, types, registry,
block definition with subBlocks/conditions/params, and docs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Apr 2, 2026 8:34pm

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 2, 2026

PR Summary

Medium Risk
Adds 13 new Rootly API operations (including destructive delete_incident) plus new request/response mappings, which increases surface area and potential for API/typing mismatches but is largely additive.

Overview
Expands the Rootly integration from 14 to 27 operations, adding new tools for incident deletion, alert lifecycle management (get/update/acknowledge/resolve), incident action items (create/list), and additional listing endpoints (users, on-calls, schedules, escalation policies, causes, playbooks).

Updates the Rootly block UI/config to expose these operations and map their inputs, registers the new tool implementations in the tool registry, and extends Rootly types and docs (including enriching alert outputs with shortId, startedAt, and endedAt).

Written by Cursor Bugbot for commit 28c37be. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 2, 2026

Greptile Summary

This PR expands the Rootly integration from 14 to 27 tools, adding 13 new API operations covering the full alert lifecycle (get/update/acknowledge/resolve), action item CRUD, and catalog list endpoints (users, on-calls, schedules, escalation policies, causes, playbooks). All new tools follow the established JSON:API patterns and the previously flagged issues (204 response on DELETE, bodyless POST, NaN from Number() coercion on user IDs, on-call relational field extraction, and non-TSDoc inline comments) have all been correctly addressed in subsequent commits.

Key changes:

  • 13 new ToolConfig files under apps/sim/tools/rootly/
  • Block definition extended with ~400 lines covering subBlocks, conditions, config.params mappings, inputs, and outputs for all 27 operations
  • types.ts extended with full TypeScript interfaces for every new tool
  • list_on_calls.ts correctly resolves user and schedule names from the JSON:API included array using relationships IDs

Minor findings:

  • list_on_calls.ts is the only list endpoint that does not expose pageSize/pageNumber pagination, which could be a limitation when an organization has many concurrent on-call entries
  • The findIncluded helper in list_on_calls.ts performs a linear scan of the included array on every item in the main data array (O(n²)); for large responses a pre-built lookup map would be more efficient

Confidence Score: 5/5

Safe to merge — all previously flagged P0/P1 issues have been resolved and no new blocking issues were found

All critical issues from prior review rounds are addressed: the 204-body crash in delete_incident, the bodyless POST in acknowledge_alert, the NaN coercion in create_action_item, and the JSON:API relationship mis-read in list_on_calls are all correctly fixed. The two remaining findings are minor P2 style/performance suggestions (missing pagination on list_on_calls, and an O(n²) included-lookup) that do not affect correctness.

apps/sim/tools/rootly/list_on_calls.ts — missing pagination params and O(n²) included lookup

Important Files Changed

Filename Overview
apps/sim/tools/rootly/list_on_calls.ts Correctly resolves relational fields (userName, scheduleName) from JSON:API included array; no pagination params exposed, and findIncluded runs O(n²) per item
apps/sim/tools/rootly/delete_incident.ts 204 No Content handling correctly fixed — skips response.json() on success and returns { success: true, message: ... }
apps/sim/tools/rootly/create_action_item.ts NaN guard correctly added for assignedToUserId using parseInt + Number.isNaN
apps/sim/tools/rootly/acknowledge_alert.ts Explicit body: () => ({ data: {} }) correctly added to avoid bodyless POST with Content-Type header
apps/sim/tools/rootly/resolve_alert.ts Body correctly conditional; sends { data: {} } when no optional params are provided
apps/sim/blocks/blocks/rootly.ts All 13 new operations wired up with subBlocks, conditions, config.params mappings, inputs, and outputs; non-TSDoc comments removed
apps/sim/tools/rootly/types.ts All new param/response interfaces properly defined; union type updated to include all new responses
apps/sim/tools/rootly/list_escalation_policies.ts Standard list pattern; reads groupIds/serviceIds from attributes (plausible for escalation policies)
apps/sim/tools/rootly/update_alert.ts PATCH body correctly built with only non-undefined attributes; consistent with existing update_incident pattern

Sequence Diagram

sequenceDiagram
    participant Block as RootlyBlock
    participant Executor as Executor
    participant API as Rootly API

    Note over Block,API: Alert Lifecycle
    Block->>Executor: rootly_create_alert { summary, source, ... }
    Executor->>API: POST /v1/alerts
    API-->>Executor: 201 { data: { id, attributes } }
    Executor-->>Block: { alert: { id, status: "triggered", ... } }

    Block->>Executor: rootly_acknowledge_alert { alertId }
    Executor->>API: POST /v1/alerts/{id}/acknowledge { data: {} }
    API-->>Executor: 200 { data: { attributes.status: "acknowledged" } }
    Executor-->>Block: { alert: { status: "acknowledged" } }

    Block->>Executor: rootly_resolve_alert { alertId, resolutionMessage }
    Executor->>API: POST /v1/alerts/{id}/resolve { data: { type, attributes } }
    API-->>Executor: 200 { data: { attributes.status: "resolved" } }
    Executor-->>Block: { alert: { status: "resolved" } }

    Note over Block,API: Incident Action Items
    Block->>Executor: rootly_create_action_item { incidentId, summary }
    Executor->>API: POST /v1/incidents/{id}/action_items
    API-->>Executor: 201 { data: { id, attributes } }
    Executor-->>Block: { actionItem: { id, status: "open" } }

    Note over Block,API: On-Call Resolution (with JSON:API includes)
    Block->>Executor: rootly_list_on_calls { scheduleIds }
    Executor->>API: GET /v1/oncalls?filter[schedule_ids]=...&include=user,schedule,escalation_policy
    API-->>Executor: 200 { data: [...], included: [users, schedules] }
    Executor-->>Block: { onCalls: [{ userId, userName, scheduleId, scheduleName }] }

    Note over Block,API: Incident Deletion
    Block->>Executor: rootly_delete_incident { incidentId }
    Executor->>API: DELETE /v1/incidents/{id}
    API-->>Executor: 204 No Content
    Executor-->>Block: { success: true, message: "Incident deleted successfully" }
Loading

Reviews (4): Last reviewed commit: "fix(rootly): extract on-call relationshi..." | Re-trigger Greptile

DELETE /v1/incidents/{id} returns 204 with empty body. Avoid calling
response.json() on success — return success/message instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…_alert

Remove all inline section comments from block definition per CLAUDE.md
guidelines. Add explicit empty JSON:API body to acknowledge_alert POST
to prevent potential 400 from servers expecting a body with Content-Type.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

… parse

resolve_alert now sends { data: {} } instead of undefined when no
optional params are provided, matching the acknowledge_alert fix.
create_action_item now validates assignedToUserId is numeric before
parseInt to avoid silent NaN coercion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

…s/included

On-call user, schedule, and escalation policy are exposed as JSON:API
relationships, not flat attributes. Now extracts IDs from
item.relationships and looks up names from the included array.
Adds ?include=user,schedule,escalation_policy to the request URL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@waleedlatif1 waleedlatif1 merged commit f9d73db into staging Apr 2, 2026
9 checks passed
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.

1 participant