Skip to content

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

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/cli-cg-event-view-parsing
Open

fix(event): correctly parse project/event-id in view command#1263
sentry[bot] wants to merge 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 added the risk: high PR risk score: high label Jul 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-1263/

Built to branch gh-pages at 2026-07-17 11:11 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants