fix(event): detect org/ISSUE-SHORT-ID in event view single-arg path (CLI-9K)#529
Merged
fix(event): detect org/ISSUE-SHORT-ID in event view single-arg path (CLI-9K)#529
Conversation
…LI-9K) When users pass `figma/FULLSCREEN-2RN` to `sentry event view`, parseSlashSeparatedArg sees exactly one slash and throws ContextError ("Event ID is required") since it interprets `figma` as org and `FULLSCREEN-2RN` as a project slug with no event ID. PR #524 added short ID detection for bare args like `BRUNCHIE-APP-29`, but the `org/SHORT-ID` pattern was not covered because parseSlashSeparatedArg throws before the detection code runs. Fix: extract single-arg handling into `parseSingleArg()` which checks for the `org/ISSUE-SHORT-ID` pattern before calling parseSlashSeparatedArg. This also reduces parsePositionalArgs complexity from 16 to under the biome limit of 15. Fixes CLI-9K (13 events, 11 users).
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Bug Fixes 🐛Event
Other
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Contributor
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 1076 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 95.80% 95.81% +0.01%
==========================================
Files 185 185 —
Lines 25666 25679 +13
Branches 0 0 —
==========================================
+ Hits 24588 24603 +15
- Misses 1078 1076 -2
- 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.
Address Seer and Cursor Bugbot review: parseSingleArg returned
targetArg without trailing slash ("figma" instead of "figma/"),
causing parseOrgProjectArg to interpret it as a project search instead
of an org. resolveIssueShortcut also ignored the parsed org entirely
for the issueShortId branch.
Fix:
- Add trailing slash to targetArg ("figma/") to signal OrgAll mode
- Use the explicit org from parsed target in resolveIssueShortcut when
available, falling back to auto-detection only when no org was given
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Extends the issue short ID detection in
event viewto handle theorg/ISSUE-SHORT-IDpattern (e.g.,figma/FULLSCREEN-2RN).Bug (CLI-9K — 13 events, 11 users)
When passing
figma/FULLSCREEN-2RNtosentry event view,parseSlashSeparatedArgsees exactly one slash and interprets it asorg=figma/project=FULLSCREEN-2RNwith no event ID → throwsContextError: Event ID is required.PR #524 added auto-redirect for bare issue short IDs like
BRUNCHIE-APP-29, but theorg/SHORT-IDpattern wasn't covered becauseparseSlashSeparatedArgthrows before the detection code runs.Fix
Extract single-arg handling into
parseSingleArg()which checks for theorg/ISSUE-SHORT-IDpattern before callingparseSlashSeparatedArg:looksLikeIssueShortId(), return it as an issue short ID auto-redirect (same as the bare case)parseSlashSeparatedArgflowThis refactor also reduces
parsePositionalArgscomplexity from 16 to within the biome limit of 15.Tests added
figma/FULLSCREEN-2RN→{ eventId: "latest", targetArg: "figma", issueShortId: "FULLSCREEN-2RN" }sentry/CLI-G→{ eventId: "latest", targetArg: "sentry", issueShortId: "CLI-G" }my-org/my-project→ still throws ContextError (not a short ID)