Skip to content

feat(arg-parsing): accept comma-separated project slugs - #1607

Open
betegon wants to merge 1 commit into
mainfrom
feat/comma-separated-project-slugs
Open

betegon wants to merge 1 commit into
mainfrom
feat/comma-separated-project-slugs

Conversation

@betegon

@betegon betegon commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Summary

sentry issue list acme/web,api currently requests the concatenated slug and 404s. This lets issue list and project list accept a comma-separated project selector after the org (<org>/a,b). Parsing is enabled per command via parseOrgProjectArg(target, { allowProjectList: true }); every other command keeps today's semantics, including comma-containing project names in project create.

issue list <org>/a,b resolves the selector in one call against the org project catalog (findProjectsInOrg), fails with a ResolutionError if any slug is unknown (the API would otherwise silently drop it), and then issues a single SDK request with the resolved IDs through the repeated project query parameter. Sorting, --limit, and cursor pagination stay server-side and share the org-all code path. The filter can never widen to the whole org: a project whose ID is not numeric falls back to its slug.

project list <org>/a,b fetches the catalog once and selects locally, reporting slugs that do not exist separately from slugs excluded by --platform. Catalog errors propagate like org-all instead of rendering as "no projects found".

A plain <org>/<project> target is unchanged in both commands (same handlers, hints, and cursor behaviour as main).

Implementation notes

  • listIssuesPaginated/listIssuesAllPages take projects?: ReadonlyArray<number | string> instead of a single projectId; existing callers pass [id].
  • findProjectsInOrg(org, slugs) in resolve-target.ts is the shared catalog lookup for both commands.
  • formatProjectTarget and explicitProjectSlugs in arg-parsing.ts keep titles, hints, and cursor context keys formatted identically.

Test plan

  • sentry issue list <org>/web,api --json resolves the catalog once and sends one SDK request with both project IDs
  • sentry issue list <org>/web,nope fails with a resolution error before querying issues
  • comma selectors trim empty entries, de-duplicate, reject display names, and validate each slug
  • <org>/a,b targets render the multi-project footer tip and -c next/prev hints with the full selector
  • sentry project list <org>/web,api uses one catalog request and preserves input order
  • project listing distinguishes missing projects from --platform filtering
  • single-project issue list / project list targets and comma-containing project create names behave as before

@vercel

vercel Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
cli Ready Ready Preview Sep 29, 2026 5:39am UTC
1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Sep 29, 2026 5:39am UTC

Request Review

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/cli/src/lib/arg-parsing.ts
Comment thread packages/cli/src/commands/project/list.ts Outdated

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/cli/src/lib/resolve-target.ts Outdated
Comment thread packages/cli/src/lib/resolve-target.ts Outdated
Comment thread packages/cli/src/commands/issue/list.ts Outdated

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/cli/src/commands/issue/list.ts Outdated
@betegon
betegon force-pushed the feat/comma-separated-project-slugs branch from 12a82a3 to 3160071 Compare September 28, 2026 17:16
@vercel
vercel Bot temporarily deployed to Preview – sentry-local September 28, 2026 17:16 Inactive

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/cli/src/commands/issue/list.ts Outdated
Comment thread packages/cli/src/commands/issue/list.ts Outdated
Comment thread packages/cli/src/commands/issue/list.ts Outdated
Comment thread packages/cli/src/commands/issue/list.ts Outdated
Comment thread packages/cli/src/commands/issue/list.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 27ad430. Configure here.

Comment thread packages/cli/src/commands/issue/list.ts Outdated
Allow same-org project subsets on issue and project list. Issue listing
passes all slugs through one SDK request; other commands preserve commas
as literal positional content.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread packages/cli/src/lib/api/issues.ts
Comment thread packages/cli/src/lib/arg-parsing.ts

This branch was successfully deployed

1 active and 1 inactive deployments
Preview – cli — bddfb89b Deployed Sep 29, 2026 by vercel[bot]
Preview – sentry-local — bddfb89b Deployed Sep 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.

1 participant