Skip to content
This repository was archived by the owner on Oct 23, 2026. It is now read-only.

fix(event): correctly parse project/event-id in view command - #1263

Merged
BYK merged 1 commit into
mainfrom
seer/fix/cli-cg-event-view-parsing
Jul 24, 2026
Merged

BYK merged 1 commit into
mainfrom
seer/fix/cli-cg-event-view-parsing

Conversation

@sentry

@sentry sentry Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

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

Comment @sentry <feedback> on this PR to have Autofix iterate on the changes.

@github-actions

github-actions Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-24 22:37 UTC

@github-actions

Copy link
Copy Markdown
Contributor

Codecov Results 📊

❌ Patch coverage is 50.00%. Project has 5476 uncovered lines.
✅ Project coverage is 81.67%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
src/commands/event/view.ts 50.00% ⚠️ 1 Missing and 1 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    81.67%    81.67%        —%
==========================================
  Files          425       425         —
  Lines        29868     29870        +2
  Branches     19398     19402        +4
==========================================
+ Hits         24393     24394        +1
- Misses        5475      5476        +1
- Partials      2033      2034        +1

Generated by Codecov Action

@BYK
BYK merged commit d171428 into main Jul 24, 2026
32 checks passed
@BYK
BYK deleted the seer/fix/cli-cg-event-view-parsing branch July 24, 2026 22:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant