Add OnCall types and Service.GetOnCalls for incident routing#619
Merged
Conversation
andrewstillv15
approved these changes
May 12, 2026
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
Surfaces the currently on-call person(s) for a service via the Go SDK. Required so the OpsLevel MCP server can answer incident-response questions like "who's on-call for the payments service right now?". Pairs with the backend PR that exposed
Service.onCallspublicly on the GraphQL schema (linked below).Part 2 of OpsLevel GitLab issue 14711 (gap 1 — users tool tags/teams — was #614).
Changes
on_call.go(new)OnCall—{ExternalEmail, Id, Name, User *UserId}. Matches the deployed GraphQLOnCalltype.OnCallConnection— standard connection withEdges,Nodes,PageInfo,TotalCount.OnCallEdge—{Cursor, Node *OnCall}.service.goService:OnCalls *OnCallConnectionwithgraphql:"-"— intentionally excluded from auto-fetch inListServicesto avoid N+1 (the backend has an open follow-up on theuserresolver insideOnCallType, flagged during the schema PR review).Service.GetOnCalls(client, variables) (*OnCallConnection, error). Standard per-service fetcher with pagination follow-through, mirroringService.GetTagsstyle.service_test.goTestGetServiceOnCalls— mock query + response with two on-call nodes (one mapping to an OpsLevel user, one with onlyexternalEmail), asserts field population andnil-handling forUser.TestGetServiceOnCallsInvalidServiceId— asserts the empty-id guard error.Design decisions