Repository navigation
fix(integrations): make issue link retries safe - #124069
Conversation
eabcbb8 to
ec98e5b
Compare
ec98e5b to
2d5ebee
Compare
sfanahata
left a comment
There was a problem hiding this comment.
Does adding changed to the shared PlatformExternalIssueSerializerResponse expose that field in the generated schemas for all types of endpoints that use the response type, even though some of those endpoints do not return it? Do we want that, or is there a way to narrow only the relevant endpoints to show changed?
|
@sfanahata goo catch! fixed it so |
cvxluo
left a comment
There was a problem hiding this comment.
bots tell me that
otherwise looks good, don't see any blocking issues
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 840570f. Configure here.
Add catalog-only `link_issue` and `unlink_issue` so agents can associate existing external tickets or GitHub pull requests with a Sentry issue, then remove those references by URL. Both use the existing MCP API client; this does not depend on `@sentry/api` or change `update_issue`. Native integrations receive the full URL for backend parsing. Sentry Apps use their installed issue-link form and guarded callback, so retries return the existing association and a different App link must be explicitly unlinked first. Both tools require the `triage` skill with `event:write` and `org:read`, preserving organization, project, and region constraints. This requires the backend URL-linking changes and the retry contract from getsentry/sentry#124069. App support covers single-value select/text forms and requires the provider's exact canonical URL. Unlink uses the existing association-ID DELETE contract; it does not delete the external ticket or resolve the Sentry issue. Fixes #228 Related: #1257 tracks creating new external tickets, and #1095 covers richer integration metadata. Those capabilities are outside this PR; only #228 is resolved here. --------- Co-authored-by: GPT-5 Codex <[email protected]> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: betegon <[email protected]> Co-authored-by: Codex (GPT-6) <[email protected]>
Adds one changelog entry, `content/changelog/2026-10-sentry-mcp-2026-09-15-to-2026-09-30.md` (slug `sentry-mcp-2026-09-15-to-2026-09-30`, proposed date 2026-10-01). It covers changes that reached the hosted MCP server (mcp.sentry.dev) during this period. The entry is `published: true`, so it goes live only after a human merges this PR and the sync runs. ## What the article says - **Alerts and Metric Monitors**: 11 new or expanded catalog tools to create, edit, delete, and inspect Alerts and Metric Monitors. Writes need the **Manage Projects & Teams** skill and the new `alerts:write` OAuth scope, so existing connections must re-authorize. - **Issue linking**: `link_issue` and `unlink_issue` (Triage skill). - **Improvements**: suspect commit in `get_issue_details`; cursor pagination for `find_organizations`, `find_projects`, and `find_teams`. - **Fixes**: `search_events` query generation, 404s for legacy mixed-case slugs, Codex OAuth, `get_alert_options` with Sentry Apps, null bytes in `update_issue` reasons, and a mcp.sentry.dev crash without WebAssembly. - **stdio MCP server**: `@sentry/mcp-server` 0.40.0–0.42.0 is described separately (alert tools, single-tenant host fixes, Seer off by default on self-hosted). Those npm versions do not include issue linking, suspect commits, pagination, or the `search_events` fixes. **Excluded** (no verified direct user effect): CI and risk labeling, evals, trace sampling, SDK and dependency bumps, internal logging and telemetry, MCP Registry release automation, and release merges. ## Attribution notes Credits come from GitHub PR authors and GitHub-resolved commit coauthors. Bots and AI bylines (Codex, Claude, GPT) are excluded. - #1326 and #1345 were authored by `sentry[bot]` (Seer Autofix). They are linked without a human credit. - #1328 was authored by `sentry-junior[bot]`. David Cramer is credited as "with" because GitHub resolves him as a commit coauthor. - Miguel Betegón is credited as a coauthor where GitHub lists him on external PRs (#1027, #1339, #1319, #1346). ## Validation - `pnpm changelog:validate`: 11 files valid; `pnpm lint`, `pnpm exec tsc --noEmit`, and all 41 tests pass. - The article body and summary compile with the app's MDX options. Every contributor credit and frontmatter field is preserved. All 21 pull request links point directly to GitHub. - Verified the deployed preview in Chrome: benefits-first opening, simplified alert/monitor descriptions, prominent reauthorization note, separate fixes, and the stdio package section render correctly. Inline code remains free of decorative backticks. - Database sync was not run. The linked PR pages were not individually checked in the browser. - **Deployment evidence is limited to GitHub Actions** (the `Deploy to Cloudflare` workflow). It cannot rule out out-of-band Cloudflare deployments or rollbacks. - `link_issue` depends on getsentry/sentry#124069, which merged on 2026-09-25. Its deployment to sentry.io was not independently verified. ## Coverage (proposed, not published) ```yaml product: mcp source_repository: getsentry/sentry-mcp baseline_sha_exclusive: 55a62a2b7dfde35df6aa3e3e66542bbfd34362da endpoint_sha_inclusive: aef89da473e295f32d5991789dcbd8111aa8e85f coverage_utc: 2026-09-15T00:00:00Z..2026-09-30T15:04:45Z non_merge_commits: 36 baseline_deploy: https://github.com/getsentry/sentry-mcp/actions/runs/34853993110 endpoint_deploy: https://github.com/getsentry/sentry-mcp/actions/runs/36733973234 compare: getsentry/toolkit@55a62a2...aef89da ``` The baseline was the production revision at 2026-09-15 00:00 UTC (deployed 2026-09-14). The endpoint was the last production deploy. Both runs passed the canary and production deploy and smoke-test steps, and neither rolled back. Since 2026-09-29, `deploy.yml` has been disabled (`if: false`) during the CLI and docs import. The latest `main` (`d929248`) was skipped and is not deployed, so the imported CLI history is not in this range. <div><a href="https://cursor.com/agents/bc-317ba004-3917-4df5-9b13-58b7ac795e83?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a href="https://cursor.com/automations/ceb3f70f-b760-11f1-bb68-864e54d14197"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/view-automation-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/view-automation-light.png"><img alt="View Automation" width="141" height="28" src="https://cursor.com/assets/images/view-automation-dark.png"></picture></a> </div> --------- Co-authored-by: betegon <[email protected]>

Retrying native issue linking currently repeats provider comments before rejecting the duplicate; App linking can also replace the group's existing association. This makes retries predictable and adds an opt-in guard for App callers that know the expected target.
200for an existing link and201for a new link, without adding fields to the response body. Repeated links skip provider comments and activity. PUT and DELETE use one lock helper keyed by organization, integration, and external issue key; activity and action-log publication stay inside that lock.expectedExternalIssueUrlquery parameter foraction=link. An exact existing match returns200without a callback; a newly created association returns201. A different association or callback URL returns409, and guarded persistence never replaces a concurrent association. Omitting the parameter preserves existing replacement behavior and HTTP200.204when the association is already absent. Installation-scoped App DELETE retains its existing authorization and404when the association is absent at the initial lookup. It acquires the same App lock in the cell service and rechecks the scoped association before publishing or deleting; if another request already removed the association after authorization, it returns204without publishing another action. Lock contention returns409.OpenAPI documents these responses, including the installation DELETE's legacy schema. Paths, scopes, and issue resolution state are unchanged. Remote callback effects cannot be rolled back after a conflicting response, and this does not promise exactly-once execution across crashes or lock expiry.
Uses the merged experimental App API schemas and URL-linking support for Jira, GitHub/GitHub Enterprise, GitLab, Bitbucket, and Azure DevOps. App form/URL resolution remains deferred.
Validation: targeted native endpoint/action-log, App action/delete, all-silo cell service, and API schema tests passed. Regression checks cover locks held during native activity/publication, installation DELETE contention without deletion or publication, and a concurrent disappearance after authorization returning
204while initial absence retains404. Lint, targeted mypy, OpenAPI generation, generated response-schema assertions, and all 187 API examples passed. Provider calls are mocked; live provider behavior and the full repository suite were not tested.