Repository navigation
fix(cli): support multiple fully-qualified log paths in log view - #1463
sentry[bot] wants to merge 2 commits into
Conversation
Replace org/project slugs copied from production telemetry with the generic placeholders used by the rest of the suite.
There was a problem hiding this comment.
Looks good to me at d3376d73. I pushed one test-only change.
Evidence: I sampled the 10 most recent CLI-1XC events, from releases 0.29.1 through 0.38.0. Every one has the same shape. The first org/project/<log-id> argument was used whole as the target, and the second fully-qualified path then failed hex validation with a ResolutionError. parsePositionalArgs on main still does exactly this (args.slice(1) with the first argument as the target). So the bug is real and still present.
The fix: splitting the first argument only happens when it has two or more slashes and ends in a 32-char hex ID. The existing single-arg, swapped-arg, and short-ID paths are unchanged, and mixed projects now get a clear ValidationError instead of an invalid-ID error. The org/proj org/proj/<id> prefix strip isn't in the captured events, but it's the same mistake with the target given separately, and it costs little.
My change (d3376d73): the first new test used the org/project slugs from the production event. I replaced them with the my-org/frontend placeholders used elsewhere in the suite.
Tests: all 75 tests in view.test.ts, view.func.test.ts, and view.property.test.ts pass. With main's view.ts, all 4 new tests fail. Oxlint and oxfmt are clean on both files.
When a user or AI coding agent invoked
sentry log view <org>/<project>/<id1> <org>/<project>/<id2>,parsePositionalArgstreated the entire first argument as the target (targetArg = "<org>/<project>/<id1>") and forwarded the second argument unstripped to ID validation, where it failed hex validation and triggered aResolutionError.Changes
splitFullLogPathto detect<org>/<project>/<32-hex-id>arguments incommands/log/view.ts.ValidationErrorwhen multiple full paths reference different project targets.<target>/prefixes when the target is explicitly provided followed by prefixed log IDs (sentry log view org/proj org/proj/<id>).Fixes CLI-1XC
@sentry <feedback>: Autofix iterates on these changes@sentry stop iterating: Autofix stops iterating on this runThis PR was automatically generated by Sentry. You can adjust this setting at any time.