fix(event-view): auto-redirect issue short IDs in two-arg form (CLI-MP)#558
fix(event-view): auto-redirect issue short IDs in two-arg form (CLI-MP)#558
Conversation
When a user passes an issue short ID as the first of two positional args (e.g., `sentry event view JAVASCRIPT-NUXT-52 <event-id>`), the two-arg path in `parsePositionalArgs` treated it as a project slug, which always failed because issue short IDs are uppercase while project slugs are lowercase, and they include the issue number suffix. The one-arg path already handled this correctly via `looksLikeIssueShortId` detection, but the two-arg path only set a suggestion warning without changing the control flow. Fix: when `looksLikeIssueShortId(first)` is true in the two-arg path, set `issueShortId` and redirect to the issue's latest event (matching the one-arg behavior). The second argument is ignored with a warning. Fixes CLI-MP
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
Internal Changes 🔧Coverage
Other
🤖 This preview updates automatically when you update the PR. |
Codecov Results 📊✅ 126 passed | Total: 126 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 1277 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 95.32% 95.33% +0.01%
==========================================
Files 194 194 —
Lines 27300 27343 +43
Branches 0 0 —
==========================================
+ Hits 26023 26066 +43
- Misses 1277 1277 —
- Partials 0 0 —Generated by Codecov Action |
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.
The `suggestion` field was the only code path setting it (the two-arg issue-short-ID branch), which was replaced with the `issueShortId` redirect. No remaining return path in `parsePositionalArgs` or `parseSingleArg` sets `suggestion`, so the type field, destructuring, and conditional log were all unreachable dead code. Addresses Cursor BugBot review comment.
|
Addressed Cursor BugBot's review comment about the dead |

When a user passes an issue short ID as the first of two positional args
(e.g.,
sentry event view JAVASCRIPT-NUXT-52 <event-id>), the two-argpath in
parsePositionalArgstreated it as a project slug, which alwaysfailed because issue short IDs are uppercase while project slugs are
lowercase, and they include the issue number suffix.
The one-arg path already handled this correctly via
looksLikeIssueShortIddetection, but the two-arg path only set a suggestion warning without
changing the control flow.
Fix: when
looksLikeIssueShortId(first)is true in the two-arg path,set
issueShortIdand redirect to the issue's latest event (matchingthe one-arg behavior). The second argument is ignored with a warning.
Fixes CLI-MP