Repository navigation
ref(cli): Parse target positionals in Stricli's argument scanner - #1655
Merged
Merged
Conversation
Target positionals no longer parse lazily inside `func`. Stricli runs the parse in its argument scanner, so an invalid target fails like any other argument: "Failed to parse ..." and exit code 252, the same as flags. Only resolution stays deferred, on the first `target.resolved` read. The parse is now free of side effects: the server of a pasted Sentry URL is applied when the target resolves, after the auth guard and rc URL check, so a host-scope failure still exits 13. `parseOrgProjectInput` is the pure half of `parseOrgProjectArg`. Destructive commands check their targets in `buildCommand` before `func` runs, so an auto-detected target is refused whether the command reads `parsed` or `resolved`. The exit code docs now describe argument errors (252) and no longer list bad flag values under 21. Refs #1564 Co-Authored-By: BYK <burak.kaya@sentry.io>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This was referenced Oct 25, 2026
BYK
approved these changes
Oct 25, 2026
Arguments Stricli cannot parse exit 252 without reaching reportCliError, so they went unseen. `exceptionWhileParsingArguments` now reports each one as an `invalid_argument` info message, grouped into one issue like `unknown_command`, with the scanner error class, the parser's error class, and the redacted message the user saw. Refs #1564 Co-Authored-By: BYK <burak.kaya@sentry.io>
BYK
approved these changes
Oct 25, 2026
This branch was previously 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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Refs #1564. Replaces #1651.
Per the review on #1651, this drops the special handling that kept a
CliError's exit code when an argument fails to parse. Target positionals no longer parse lazily insidefunc. Stricli parses them in its argument scanner, so an invalid target now fails like a bad flag:Failed to parse "<input>" for <placeholder>: …and exit code 252. Only resolution is still deferred, to the firsttarget.resolvedread.target.parsed,target.resolvedandtarget.rawbehave as before for commands, and no command changes beyond a comment.Changes:
positional-parse.ts:lazyPositional/LazyPositionalbecomeboundPositional/BoundPositional. The parse runs when Stricli calls the parser.resolvedstays memoized and runs insidefunc, after the auth guard.parseOrgProjectInputis the pure half ofparseOrgProjectArg: it returns a pasted Sentry URL's server instead of applying it. The target resolver applies that server, so a URL for a server you have no account on still fails withHostScopeError(exit 13) after the auth guard.parseOrgProjectArgitself is unchanged for its other callers.buildCommandchecks the targets of destructive commands after the auth guard and rc URL check, beforefuncruns. Before, the check only ran insidetarget.resolved, so a destructive command that read onlytarget.parsedwould skip it.exit-codes.mdgains a 252 row and an "Argument errors" section, and code 21 no longer claims bad flag values. The agent guidance and the generated skill get a 252 row, and the CLIAGENTS.mdand the lint rule message describe the new flow.Tests:
test/lib/positional-parse.test.tscovers: an invalid target exits withInvalidArgument; a destructive command refuses auto-detect even when it only readsparsed; awaiting a target does not resolve it; and a pasted URL's server is applied on resolve, not on parse.test/lib/scanner-flags.integration.test.tsruns the real app:issue list --period bogusandtrace list @latestboth exit withInvalidArgument.lintandtypecheckpass. Fulltest:unit: 11336 passed, 6 failed. The 6 are chmod-based permission tests that also fail on cleanmainin this sandbox, which runs as a user that bypasses chmod.via BYK.
--
View Junior Session in Sentry