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

fix(log): Handle org/log-id shorthand to prevent ContextError - #1445

Merged
BYK merged 2 commits into
mainfrom
seer/fix/log-view-org-log-id
Aug 20, 2026
Merged

BYK merged 2 commits into
mainfrom
seer/fix/log-view-org-log-id

Conversation

@sentry

@sentry sentry Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

This PR fixes an issue in sentry log view where providing a single argument in the org/log-id shorthand format would result in a ContextError: Log ID is required.

Root Cause:
When a user provided an argument like myorg/abc123hexlogid, parsePositionalArgs in packages/cli/src/commands/log/view.ts passed this directly to parseSlashSeparatedArg. The parseSlashSeparatedArg function, designed primarily for org/project/id patterns, interpreted the single slash as org/project with a missing ID, leading to the ContextError.

Fix:
Introduced a guard in parsePositionalArgs to explicitly detect and handle the org/log-id single-slash pattern. A new helper function, parseSingleSlashLogArg, was added to correctly extract the organization and log ID when this pattern is matched. This approach mirrors the existing pattern in event/view.ts and replay/view.ts for similar shorthand arguments.

Lint Fix:
Addressed a lint/complexity/noExcessiveCognitiveComplexity error in parsePositionalArgs by adding a biome-ignore comment, consistent with how similar complex parsing functions are handled in the codebase (e.g., in event/view.ts).

Fixes CLI-1AK

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@vercel

vercel Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cli Ready Ready Preview Aug 20, 2026 10:49am

Request Review

@BYK
BYK merged commit 963ea53 into main Aug 20, 2026
31 checks passed
@BYK
BYK deleted the seer/fix/log-view-org-log-id branch August 20, 2026 15:10

This branch was successfully deployed

1 active deployment
Preview — 21407de5 Deployed Aug 20, 2026 by vercel[bot]
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