Commit d171428
authored
fix(event): correctly parse project/event-id in view command (#1263)
This PR fixes an issue where `sentry event view <project>/<event-id>`
would fail with a `ContextError: Event ID is required.`
The root cause was that `parseSingleArg` in `src/commands/event/view.ts`
was incorrectly delegating single-slash arguments like
`project/event-id` to `parseSlashSeparatedArg`. The
`parseSlashSeparatedArg` function, when encountering a single slash,
assumes the format is `org/project` and that an event ID is missing,
leading it to throw the `ContextError`.
The fix adds a specific check within `parseSingleArg` for the
`project/event-id` pattern (where the part after the slash is a valid
hex event ID) before the delegation to `parseSlashSeparatedArg`. This
ensures that such arguments are correctly parsed and handled, preventing
the erroneous `ContextError`.
Fixes
[CLI-CG](https://sentry.sentry.io/issues/7322504022/?seerDrawer=true)
<sub>Comment `@sentry <feedback>` on this PR to have Autofix iterate on
the changes.</sub>
Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>1 parent 0341d1e commit d171428
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
231 | 242 | | |
232 | 243 | | |
233 | 244 | | |
| |||
0 commit comments