This repository was archived by the owner on Oct 23, 2026. It is now read-only.
Repository navigation
fix(log): Handle org/log-id shorthand to prevent ContextError - #1445
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
BYK
approved these changes
Aug 20, 2026
5 tasks
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes an issue in
sentry log viewwhere providing a single argument in theorg/log-idshorthand format would result in aContextError: Log ID is required.Root Cause:
When a user provided an argument like
myorg/abc123hexlogid,parsePositionalArgsinpackages/cli/src/commands/log/view.tspassed this directly toparseSlashSeparatedArg. TheparseSlashSeparatedArgfunction, designed primarily fororg/project/idpatterns, interpreted the single slash asorg/projectwith a missing ID, leading to theContextError.Fix:
Introduced a guard in
parsePositionalArgsto explicitly detect and handle theorg/log-idsingle-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 inevent/view.tsandreplay/view.tsfor similar shorthand arguments.Lint Fix:
Addressed a
lint/complexity/noExcessiveCognitiveComplexityerror inparsePositionalArgsby adding abiome-ignorecomment, consistent with how similar complex parsing functions are handled in the codebase (e.g., inevent/view.ts).Fixes CLI-1AK
This PR was automatically generated by Sentry. You can adjust this setting at any time.