Skip to content

fix: enrich short ID 404 with org context and suggestions (CLI-A1)#494

Merged
BYK merged 1 commit intomainfrom
fix/cli-a1-short-id-404
Mar 20, 2026
Merged

fix: enrich short ID 404 with org context and suggestions (CLI-A1)#494
BYK merged 1 commit intomainfrom
fix/cli-a1-short-id-404

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Mar 20, 2026

Problem

When resolving an issue by short ID (e.g., sentry issue view CLI-BM) fails with 404, the error shows:

ApiError: Failed to resolve short ID: 404 Not Found

This doesn't tell the user what short ID was searched, which organization was searched, or what to do next. Affects 27 users (CLI-A1).

Fix

Enhanced the 404 error in getIssueByShortId to include context and suggestions:

Short ID 'CLI-BM' not found in organization 'sentry'.
  The issue may have been deleted or merged
  Verify the short ID and org: sentry issue view sentry/CLI-BM
  List issues in this org: sentry issue list sentry/

Design Decisions

  • Keeps ApiError type: The enhanced error still has status=404, so tryGetIssueByShortId (used for parallel fan-out across orgs) continues to work unchanged — it catches ApiError by status code
  • Inline detail: Suggestions are formatted as the ApiError detail field, which ApiError.format() renders on indented lines below the main message
  • Context-aware: Includes the actual short ID and org slug so users can verify both

When resolving an issue by short ID fails with 404, the generic
'Failed to resolve short ID: 404 Not Found' doesn't tell the user
what went wrong. This affects 27 users (CLI-A1).

Improved the error in getIssueByShortId to include:
- The short ID that was searched for
- The organization it was searched in
- Suggestions about deletion/merging, verifying the ID, and listing issues

The enhanced ApiError still has status=404, so tryGetIssueByShortId
(used for parallel fan-out across orgs) continues to work unchanged.
@github-actions
Copy link
Copy Markdown
Contributor

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 ✨

  • (telemetry) Track TTY vs non-TTY invocations via metric by betegon in #482
  • Dynamic cache-backed shell completions with fuzzy matching by BYK in #465

Bug Fixes 🐛

  • (project) Fallback to org listing when bare slug matches an organization by betegon in #475
  • Enrich short ID 404 with org context and suggestions (CLI-A1) by BYK in #494
  • Suggest similar projects when project not found in org (CLI-C0) by BYK in #493
  • Event 404 hint should suggest different project, not repeat failing command by BYK in #492
  • Enrich event 404 errors with retention and format suggestions (CLI-6F) by BYK in #491
  • Add actionable suggestions for 400 Bad Request on issue list (CLI-BM, CLI-7B) by BYK in #489
  • Detect issue short IDs passed to issue list (CLI-C3) by BYK in #488
  • Add Glob.match() polyfill + improve auto-detect diagnostics (CLI-7T) by BYK in #487
  • Add org-slug pre-check to dispatchOrgScopedList (CLI-9A) by BYK in #485

Internal Changes 🔧

  • (issue) Skip getProject round-trip in project-search resolution by betegon in #473
  • (resolve) Carry project data through resolution to eliminate redundant getProject calls by BYK in #486
  • HTTP latency optimizations — diagnostics, cache warming, concurrency limits by BYK in #490
  • Switch from @sentry/bun to @sentry/node-core/light (~170ms startup savings) by BYK in #474
  • Regenerate skill files by github-actions[bot] in b7b240ec

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

Codecov Results 📊

126 passed | Total: 126 | 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 1056 uncovered lines.
✅ Project coverage is 95.72%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
issues.ts 99.26% ⚠️ 1 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    95.72%    95.72%        —%
==========================================
  Files          180       180         —
  Lines        24654     24669       +15
  Branches         0         0         —
==========================================
+ Hits         23598     23613       +15
- Misses        1056      1056         —
- Partials         0         0         —

Generated by Codecov Action

@BYK BYK merged commit 3bcd5de into main Mar 20, 2026
22 checks passed
@BYK BYK deleted the fix/cli-a1-short-id-404 branch March 20, 2026 01:13
@getsentry getsentry deleted a comment from linear-code bot Mar 20, 2026
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