Skip to content

feat(cli): add issue unlink command - #1376

Open
betegon wants to merge 1 commit into
mainfrom
bt/cli-issue-unlink
Open

betegon wants to merge 1 commit into
mainfrom
bt/cli-issue-unlink

Conversation

@betegon

@betegon betegon commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Adds sentry issue unlink <issue> <url> to remove an external tracker issue or GitHub pull request association without deleting either issue or changing the Sentry issue's status. Uses the CLI's standard confirmation flow, --yes, --dry-run, and JSON output; an already-absent link succeeds with changed: false.

Reuses the existing link discovery, URL matching, formatting, and cache invalidation. @sentry/api sends Sentry's stored association ID to the native or App DELETE endpoint, so unlinking does not need a working remote ticket or an App link form. Requires event:write and project access; older Sentry versions may still require event:admin. Keeps the CLI's standard retry and cache behavior.

Validated with 216 focused tests, CLI typecheck, root and CLI lint, generated docs/SDK, and 12 bundled CLI calls against local HTTP fixtures. No production deletion was performed.

The full CLI suite has 10,431 passing tests, 14 skipped, and the pre-existing musl installer test failure (release-registry/GitHub version lookup). This stops the recursive monorepo test run; the installer files are unchanged by this PR.

@betegon
betegon force-pushed the bt/cli-issue-link-unlink branch from 717a2fa to 6bca776 Compare October 2, 2026 17:22
@betegon
betegon force-pushed the bt/cli-issue-unlink branch from e4e94e4 to 3bb7b24 Compare October 2, 2026 17:54
@betegon
betegon force-pushed the bt/cli-issue-link-unlink branch from 8af0cc3 to 3321a95 Compare October 5, 2026 10:01
@betegon
betegon force-pushed the bt/cli-issue-unlink branch 3 times, most recently from b87b442 to 0c61a96 Compare October 5, 2026 13:23
betegon added a commit that referenced this pull request Oct 5, 2026
Adds `sentry issue link <issue> <url>` to associate an existing tracker
issue or GitHub pull request with a Sentry issue. Supports `--dry-run`,
JSON output, and selectors for installations that match the same URL.

All requests use
[`@sentry/api`](https://www.npmjs.com/package/@sentry/api). Native
integrations receive the full URL for server-side resolution; Linear and
other installed Sentry Apps use their link forms, including required
fields and the backend URL guard against replacing a different
association. HTTP 201/200 determines whether the link changed. GitHub
PRs are references and do not resolve the Sentry issue.

Linking requires `event:write` and project access; App discovery also
needs `org:read`. Both scopes are included in the default OAuth login.
Uses the CLI's existing retry and cache behavior.

This PR now contains **link only**. Unlink is in the separate stacked PR
#1376, which reuses the integration discovery and URL matching. Updated
to current `main`, including the independent final-attempt 401 fix in
#1370.

Validated with focused tests, typechecks, lint, generated docs/SDK, and
the bundled CLI against local HTTP fixtures. The full CLI suite passes
apart from the pre-existing macOS musl installer test failure; no
production deletion was performed.

---------

Co-authored-by: GPT-6 <noreply@openai.com>
Base automatically changed from bt/cli-issue-link-unlink to main October 5, 2026 19:47
Remove stored external issue associations through @sentry/api, reusing
link discovery and URL matching. Preserve standard deletion confirmation,
dry-run previews, and successful no-ops when an association is absent.

Co-Authored-By: GPT-6 <noreply@openai.com>
@betegon
betegon force-pushed the bt/cli-issue-unlink branch from 0c61a96 to 2d0e20f Compare October 5, 2026 19:52
@betegon
betegon marked this pull request as ready for review October 5, 2026 20:02
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Oct 5, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant