Skip to content

ref(cli): Parse list command targets in their positional - #1711

Open
sentry-junior[bot] wants to merge 1 commit into
mainfrom
byk/cli-list-target-positional
Open

sentry-junior[bot] wants to merge 1 commit into
mainfrom
byk/cli-list-target-positional

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Refs #1564. This brings list commands onto bound target positionals, the design agreed in the #1564 status comment.

List commands used to declare their target with an identity parser and then call parseOrgProjectArg or parseListTarget inside func. Now listTargetPositional() in list-command.ts builds the positional on a new listTarget parser in target-positional.ts:

  • The parse runs in Stricli's scanner and has no side effects. It reads [<org>/][<project>], plus name globs and comma-separated projects for the commands that accept them.
  • await target.resolved applies a pasted Sentry URL's server, after the auth guard, and returns { parsed, filter }. func passes those to dispatchOrgScopedList, which still resolves each target mode the same way as before.
  • parseListTarget is replaced by parseListTargetInput, which has no side effects. Like parseOrgProjectInput, it returns the URL's server instead of applying it.
  • Shell completion is unchanged: org-scoped lists still complete org slugs only.
  • The require-target-resolution lint rule now also covers ListCommandTarget.

Migrated commands

  • Through buildOrgListCommand: team list, repo list, monitor list, integration list.
  • issue list (comma-separated projects).
  • project list (name globs and comma-separated projects).
  • release list, dsn list, alert issues list.

issue list still rejects issue-1-style targets inside func. It now checks target.raw, so the error and exit code are the same as before.

Behavior change: a malformed list target, such as sentry team list @latest, now fails in the argument scanner with exit code 252. Before, it failed inside func with a validation error.

via BYK.

--

View Junior Session in Sentry

List commands declared their target with an identity parser and called
parseOrgProjectArg or parseListTarget inside func. They now use a
listTarget bound positional: the scanner parses [<org>/][<project>]
(and name globs, comma-separated projects where the command takes
them) without side effects, and target.resolved applies a pasted
Sentry URL's server, after the auth guard, before func hands
{ parsed, filter } to dispatchOrgScopedList.

parseListTarget becomes the pure parseListTargetInput, which returns
the URL's server instead of applying it.

Refs #1564

Co-Authored-By: BYK <burak.kaya@sentry.io>
@vercel

vercel Bot commented Oct 29, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Oct 29, 2026 12:25am UTC

Request Review

This branch was previously deployed

1 inactive deployment
Preview — 10dfba88 Deployed Oct 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants