Repository navigation
ref(mcp): Move issue and event reads onto @sentry/api - #1713
Open
sentry-junior[bot] wants to merge 2 commits into
Open
sentry-junior[bot] wants to merge 2 commits into
sentry-junior[bot] wants to merge 2 commits into
Conversation
getEventForIssue, listEventsForIssue, and listEventAttachments now call @sentry/api operations through the existing sdkClient bridge, which keeps the MCP's auth, region routing, retries, ApiError mapping, and apiPath checks. getEventAttachment reuses listEventAttachments for its metadata lookup; the binary download stays on request(). @sentry/api sends collapse=adjacentEvents by default on getOrganizationIssueEvent (since 0.421.0), so the hand-added query parameter is gone. The pnpm catalog moves to 0.423.0. listEventsForIssue no longer sends sort. Sentry's issue events endpoint ignores it and always returns the newest events first. Co-Authored-By: BYK <burak.kaya@sentry.io>
listIssues, getIssue, getIssueTagValues, getIssueExternalLinks, listIssueIntegrations, and getAutofixState now call @sentry/api operations through the sdkClient bridge. The two link lists share a collectAllPages walker with the path-based listIssueLinkPages, which the Sentry App installation and component lists still use. listIssues keeps sending an empty query when none is given, because Sentry applies is:unresolved only when the parameter is missing. Issue writes stay on requestJSON: the bridge only forwards GETs until the MCP transport injection lands. Co-Authored-By: BYK <burak.kaya@sentry.io>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Task 8.2 of the
unify-sentry-api-layerchange (#1669): the MCP's issue and event reads inSentryApiServicenow call@sentry/apioperations instead of buildingrequestJSON(apiPath...)URLs by hand.The calls go through the existing
sdkClient()bridge, the same one the organization, team, and project lists use. The SDK only builds the path and query. The MCP still owns auth, host and region routing, retries, theApiErrormapping (HTTP status kept), and Zod parsing. The bridge also rejects any URL that doesn't match theapiPathresult, so path-traversal protection is unchanged. When 6.1 lands, that bridge is the one place to swap in the injected fetch. Tool output and snapshots don't change.Events
getEventForIssue→getOrganizationIssueEvent. Since 0.421.0,@sentry/apisendscollapse=adjacentEventsby default (feat(client): Skip adjacent-event lookups by default in getOrganizationIssueEvent sentry-api-schema#112, server side perf(issues): Add collapse=adjacentEvents to group event details sentry#129094), so the hand-added?collapse=adjacentEventsfrom perf(api): Skip adjacent-event lookups on event details #1705 is gone. The existing request test still checks the parameter forlatest,oldest,recommended, and a hex ID. The generatedevent_idtype lists only the three aliases, so a hex ID needs a narrow cast.listEventsForIssue→listOrganizationIssueEvents. It no longer sendssort. The generated operation has no such parameter, andGroupEventsEndpointignores it: results always come back-timestampfirst.search_issue_eventsstill uses its sort for the Discover link. Tests now check that link instead of the ignored query parameter.listEventAttachments→listProjectEventAttachments.getEventAttachmentreuses it for the metadata lookup.collapseto keep.getProjectEventdefaults it anyway as of 0.423.0 (feat(sdk): Default collapse=adjacentEvents on getProjectEvent sentry-api-schema#113).Issues
listIssues,getIssue,getIssueTagValues,getIssueExternalLinks,listIssueIntegrations, andgetAutofixStatenow use their operations.listIssuesstill sendsquery=when it's empty, because Sentry appliesis:unresolvedonly when the parameter is missing. A new test covers this. The two link lists share a smallcollectAllPageswalker withlistIssueLinkPages, which the Sentry App lists still use. The external-issues operation has noper_page, so that call relies on Sentry's default page size of 100, which is what it used to send.Still on
requestJSON/request()@sentry/apioperation: issue notes (createIssueComment,listIssueComments),getIssueActivity,getIssueUserReports,getEventCommitters.updateIssue,linkNativeExternalIssue,unlinkNativeExternalIssue,unlinkSentryAppExternalIssue,startAutofix.sdkClient()only forwards GETs. Letting it forward write bodies now would be replaced by the 6.1 transport anyway. The generated types also don't fit yet:updateOrganizationIssuemarks every body field required, anddeleteOrganizationIssueIntegrationtypesexternalIssueas a number.?download=1) and its redirect probe stay onrequest(), because they read binary data or the redirect URL rather than JSON.The pnpm catalog moves
@sentry/apifrom 0.420.0 to 0.423.0, the latest published version. #1712 makes the same bump, so either PR can land first. Regenerating the CLI'sapi-schema.jsonandidempotent-operations.jsonagainst 0.423.0 produced no changes.via BYK.
--
View Junior Session in Sentry