Skip to content

fix(release-delete): enrich error for releases with health data (CLI-14K)#749

Merged
BYK merged 2 commits intomainfrom
byk/fix-release-delete-health-data-error
Apr 14, 2026
Merged

fix(release-delete): enrich error for releases with health data (CLI-14K)#749
BYK merged 2 commits intomainfrom
byk/fix-release-delete-health-data-error

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Apr 14, 2026

Summary

  • Catch the 400 "health data" ApiError from the Sentry API when deleting a release and replace it with a clear, actionable message explaining that releases with active session/crash-free data are protected and must age out
  • Add test/commands/release/delete.test.ts with 8 tests covering happy path, dry-run, error enrichment, and passthrough for unrelated errors

Fixes CLI-14K

Before

Error: Failed to delete release '...': 400 Bad Request
  This release has health data and cannot be removed.

After

Error: Release '...' has health data and cannot be deleted
  Releases with active session or crash-free data are protected by Sentry
  and cannot be removed via the API. The health data must age out before
  the release can be deleted.
  Release: https://acme.sentry.io/releases/1.0.0/

Not in scope

  • No server-side force-delete option exists in the Sentry API
  • --force flag semantics unchanged (confirmation bypass only, consistent across all delete commands)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 14, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (cli) Add sentry cli defaults command for persistent settings by BYK in #721
  • (docs) Auto-generate driftable documentation sections by BYK in #739
  • (issue-list) Add search syntax docs, case-insensitive AND/OR, and JSON syntax reference by BYK in #738
  • (setup) Install agent skills for detected roots by betegon in #747
  • (trace) Consistent project filtering across trace commands (feat: support filtering spans by project within a trace #737) by BYK in #743
  • (trace-view) Expose span attributes in trace and span views by BYK in #742

Bug Fixes 🐛

Init

  • Treat no-op edits as passthrough instead of throwing by betegon in #731
  • Remove JSON minification that breaks edit-based codemods by betegon in #719

Resolve

  • Address review comments and add tests for fuzzy project recovery by BYK in #732
  • Fuzzy auto-recovery for project slug resolution by BYK in #728

Upgrade

  • Detect npm install method from node_modules path by BYK in #723
  • Add shell option on Windows for .cmd package managers by BYK in #722

Other

  • (ci) Add retry logic to ORAS/bsdiff downloads and upgrade ORAS by BYK in #741
  • (dashboard) Remove overly restrictive dataset-display cross-validation by BYK in #720
  • (errors) Improve ContextError wording for auto-detect failures by BYK in #726
  • (event-view) Add cross-org fallback when event not found by BYK in #744
  • (issue) Support share issue URLs by BYK in #718
  • (issue-list) Auto-correct AND and reject OR in --query to prevent 400 by BYK in #727
  • (release-delete) Enrich error for releases with health data (CLI-14K) by BYK in #749
  • (telemetry) Rename isClientApiError to isUserApiError and exclude 400 by BYK in #729
  • Bug fixes from Sentry error monitoring (CLI-FR, CLI-RN) + auth default by BYK in #740

Internal Changes 🔧

  • Regenerate skill files by github-actions[bot] in ca16b2ff

🤖 This preview updates automatically when you update the PR.

@BYK BYK marked this pull request as ready for review April 14, 2026 14:25
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0b57b60. Configure here.

Comment thread src/commands/release/delete.ts
BYK added 2 commits April 14, 2026 14:42
)

When the Sentry API returns 400 for releases with active session/crash-free
data, catch the error and provide an actionable message explaining the
limitation and linking to the release page, instead of surfacing the raw
ApiError.
@BYK BYK force-pushed the byk/fix-release-delete-health-data-error branch from 3fad649 to 51f7a20 Compare April 14, 2026 14:42
@github-actions
Copy link
Copy Markdown
Contributor

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-749/

Built to branch gh-pages at 2026-04-14 14:42 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown
Contributor

Codecov Results 📊

134 passed | Total: 134 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 1623 uncovered lines.
✅ Project coverage is 95.33%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    95.30%    95.33%    +0.03%
==========================================
  Files          234       234         —
  Lines        34675     34740       +65
  Branches         0         0         —
==========================================
+ Hits         33046     33117       +71
- Misses        1629      1623        -6
- Partials         0         0         —

Generated by Codecov Action

Comment thread src/commands/release/delete.ts
@BYK BYK merged commit 987550f into main Apr 14, 2026
26 checks passed
@BYK BYK deleted the byk/fix-release-delete-health-data-error branch April 14, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant