Skip to content

Commit a61518b

Browse files
committed
fix(rootly): address PR review feedback - PATCH method, totalCount, environmentIds
- Changed update_incident HTTP method from PUT to PATCH per Rootly API spec - Fixed totalCount in all 9 list tools to use data.meta?.total_count from API response - Added missing updateEnvironmentIds subBlock and params mapping for update_incident
1 parent b4d6335 commit a61518b

File tree

11 files changed

+20
-10
lines changed

11 files changed

+20
-10
lines changed

apps/sim/blocks/blocks/rootly.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,14 @@ export const RootlyBlock: BlockConfig<RootlyResponse> = {
232232
condition: { field: 'operation', value: 'rootly_update_incident' },
233233
mode: 'advanced',
234234
},
235+
{
236+
id: 'updateEnvironmentIds',
237+
title: 'Environment IDs',
238+
type: 'short-input',
239+
placeholder: 'Comma-separated environment IDs',
240+
condition: { field: 'operation', value: 'rootly_update_incident' },
241+
mode: 'advanced',
242+
},
235243
{
236244
id: 'updateGroupIds',
237245
title: 'Team IDs',
@@ -612,6 +620,7 @@ export const RootlyBlock: BlockConfig<RootlyResponse> = {
612620
mitigationMessage: params.mitigationMessage,
613621
resolutionMessage: params.resolutionMessage,
614622
serviceIds: params.updateServiceIds,
623+
environmentIds: params.updateEnvironmentIds,
615624
groupIds: params.updateGroupIds,
616625
}
617626

@@ -742,6 +751,7 @@ export const RootlyBlock: BlockConfig<RootlyResponse> = {
742751
mitigationMessage: { type: 'string', description: 'Mitigation message' },
743752
resolutionMessage: { type: 'string', description: 'Resolution message' },
744753
updateServiceIds: { type: 'string', description: 'Updated service IDs' },
754+
updateEnvironmentIds: { type: 'string', description: 'Updated environment IDs' },
745755
updateGroupIds: { type: 'string', description: 'Updated team IDs' },
746756
listIncidentsStatus: { type: 'string', description: 'Filter by status' },
747757
listIncidentsSearch: { type: 'string', description: 'Search incidents' },

apps/sim/tools/rootly/list_alerts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export const rootlyListAlertsTool: ToolConfig<RootlyListAlertsParams, RootlyList
109109
success: true,
110110
output: {
111111
alerts,
112-
totalCount: alerts.length,
112+
totalCount: data.meta?.total_count ?? alerts.length,
113113
},
114114
}
115115
},

apps/sim/tools/rootly/list_environments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export const rootlyListEnvironmentsTool: ToolConfig<
8484
success: true,
8585
output: {
8686
environments,
87-
totalCount: environments.length,
87+
totalCount: data.meta?.total_count ?? environments.length,
8888
},
8989
}
9090
},

apps/sim/tools/rootly/list_functionalities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export const rootlyListFunctionalitiesTool: ToolConfig<
8484
success: true,
8585
output: {
8686
functionalities,
87-
totalCount: functionalities.length,
87+
totalCount: data.meta?.total_count ?? functionalities.length,
8888
},
8989
}
9090
},

apps/sim/tools/rootly/list_incident_types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export const rootlyListIncidentTypesTool: ToolConfig<
8484
success: true,
8585
output: {
8686
incidentTypes,
87-
totalCount: incidentTypes.length,
87+
totalCount: data.meta?.total_count ?? incidentTypes.length,
8888
},
8989
}
9090
},

apps/sim/tools/rootly/list_incidents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export const rootlyListIncidentsTool: ToolConfig<
138138
success: true,
139139
output: {
140140
incidents,
141-
totalCount: incidents.length,
141+
totalCount: data.meta?.total_count ?? incidents.length,
142142
},
143143
}
144144
},

apps/sim/tools/rootly/list_retrospectives.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export const rootlyListRetrospectivesTool: ToolConfig<
9393
success: true,
9494
output: {
9595
retrospectives,
96-
totalCount: retrospectives.length,
96+
totalCount: data.meta?.total_count ?? retrospectives.length,
9797
},
9898
}
9999
},

apps/sim/tools/rootly/list_services.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export const rootlyListServicesTool: ToolConfig<
8181
success: true,
8282
output: {
8383
services,
84-
totalCount: services.length,
84+
totalCount: data.meta?.total_count ?? services.length,
8585
},
8686
}
8787
},

apps/sim/tools/rootly/list_severities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const rootlyListSeveritiesTool: ToolConfig<
7676
success: true,
7777
output: {
7878
severities,
79-
totalCount: severities.length,
79+
totalCount: data.meta?.total_count ?? severities.length,
8080
},
8181
}
8282
},

apps/sim/tools/rootly/list_teams.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export const rootlyListTeamsTool: ToolConfig<RootlyListTeamsParams, RootlyListTe
7878
success: true,
7979
output: {
8080
teams,
81-
totalCount: teams.length,
81+
totalCount: data.meta?.total_count ?? teams.length,
8282
},
8383
}
8484
},

0 commit comments

Comments
 (0)