Commit 695e21b
authored
## 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)
1 parent 7db4f7c commit 695e21b
2 files changed
Lines changed: 75 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
107 | 151 | | |
108 | 152 | | |
109 | 153 | | |
| |||
175 | 219 | | |
176 | 220 | | |
177 | 221 | | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
| 222 | + | |
196 | 223 | | |
197 | 224 | | |
198 | 225 | | |
| |||
486 | 513 | | |
487 | 514 | | |
488 | 515 | | |
489 | | - | |
490 | | - | |
| 516 | + | |
| 517 | + | |
491 | 518 | | |
492 | 519 | | |
493 | 520 | | |
494 | 521 | | |
495 | 522 | | |
496 | | - | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
497 | 528 | | |
498 | 529 | | |
499 | 530 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
84 | 107 | | |
85 | 108 | | |
86 | 109 | | |
| |||
0 commit comments