Skip to content

fix(event): detect org/ISSUE-SHORT-ID in event view single-arg path (CLI-9K)#529

Merged
BYK merged 2 commits intomainfrom
fix/event-view-org-slash-shortid
Mar 23, 2026
Merged

fix(event): detect org/ISSUE-SHORT-ID in event view single-arg path (CLI-9K)#529
BYK merged 2 commits intomainfrom
fix/event-view-org-slash-shortid

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Mar 23, 2026

Summary

Extends the issue short ID detection in event view to handle the org/ISSUE-SHORT-ID pattern (e.g., figma/FULLSCREEN-2RN).

Bug (CLI-9K — 13 events, 11 users)

When passing figma/FULLSCREEN-2RN to sentry event view, parseSlashSeparatedArg sees exactly one slash and interprets it as org=figma / project=FULLSCREEN-2RN with no event ID → throws ContextError: Event ID is required.

PR #524 added auto-redirect for bare issue short IDs like BRUNCHIE-APP-29, but the org/SHORT-ID pattern wasn't 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:

  1. If the arg has exactly one slash and the part after it matches looksLikeIssueShortId(), return it as an issue short ID auto-redirect (same as the bare case)
  2. Otherwise, proceed with normal parseSlashSeparatedArg flow

This refactor also reduces parsePositionalArgs complexity 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)

…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).
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 23, 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).


Bug Fixes 🐛

Event

  • Detect org/ISSUE-SHORT-ID in event view single-arg path (CLI-9K) by BYK in #529
  • Auto-redirect issue short IDs in event view (CLI-JR) by BYK in #524

Other

  • (api) Strip api/0/ prefix and exclude NodeSystemError integration (CLI-K1) by BYK in #523
  • (dashboard) Add missing datasets to agent guidance by betegon in #522
  • Handle invalid URLs gracefully in response cache (CLI-GC) by BYK in #528
  • Avoid double-prefixing in buildCommandHint for slashed args (CLI-8C) by BYK in #527
  • Handle full short IDs and numeric IDs in multi-slash issue args (CLI-KC, CLI-B6) by BYK in #526
  • Auto-recovery for wrong entity types across commands (CLI-G6, CLI-K6, CLI-JR) by BYK in #525

Internal Changes 🔧

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

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 23, 2026

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 1076 uncovered lines.
✅ Project coverage is 95.81%. Comparing base (base) to head (head).

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

Copy link
Copy Markdown

@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.

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
@BYK BYK merged commit 695e21b into main Mar 23, 2026
22 checks passed
@BYK BYK deleted the fix/event-view-org-slash-shortid branch March 23, 2026 14:13
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