Skip to content

fix(cli): Scope issue list counts to the release: filter - #1512

Merged
BYK merged 2 commits into
mainfrom
cli-1528-issue-list-scoped-counts
Oct 16, 2026
Merged

BYK merged 2 commits into
mainfrom
cli-1528-issue-list-scoped-counts

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

Port of getsentry/cli#1528 into the toolkit monorepo.

sentry issue list --query 'release:"X"' returns the right issues, but the count/userCount it shows come from the issues-list endpoint's seen-stats, which respect statsPeriod but ignore filters like release:. Release-scoped triage over-reported, and --sort freq/--sort user ranked by those same period-wide totals.

When the query filters on a count-unscoped key (currently release:), issue list now refetches count()/count_unique(user) per issue from the events endpoint using issue:<SHORT-ID> plus the user's query, overwrites the displayed numbers, and re-ranks for freq/user sorts. Requests use bounded concurrency (ORG_FANOUT_CONCURRENCY). It's best-effort: queries without such a filter make no extra calls, and a failed refetch keeps the list-endpoint values so the listing never breaks. ExploreQueryOptions gains an optional project param so the events query can target a specific project.

Two hunks needed manual resolution against toolkit (list.ts import block, explore.ts params), and the files were reformatted with oxfmt. Generated skill reference docs from the original PR were dropped since they're regenerated here.

Refs getsentry/cli#1518

via byk.

--

View Junior Session [Sentry]

The issues-list endpoint's per-group seen-stats (count/userCount) honor
statsPeriod but ignore query filters like release:, so
`issue list --query 'release:"X"'` over-reported counts and
--sort freq/user ranked by period-wide totals.

When the query filters on a count-unscoped key, refetch count/userCount
per issue from the events endpoint (issue:<shortId> AND the user's query)
and re-rank for freq/user sorts. Best-effort: a failed refetch keeps the
list-endpoint values.

Ported from getsentry/cli#1528.
Refs getsentry/cli#1518

Co-Authored-By: Burak Yigit Kaya <burak.kaya@sentry.io>
@vercel

vercel Bot commented Oct 15, 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 15, 2026 7:41pm UTC

Request Review

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Oct 15, 2026
@sentry-junior
sentry-junior Bot requested a review from BYK October 15, 2026 19:34

@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 2 potential issues.

Fix All in Cursor

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

Reviewed by Cursor Bugbot for commit 8e570bd. Configure here.

Comment thread packages/cli/src/commands/issue/list.ts
Comment thread packages/cli/src/lib/search-query.ts
…ters

Run the scoped-count refetch when --sort freq/user drives ordering even if
--fields omits count/userCount, so ranking follows the filtered counts.
Also detect release: in regex filters (release://...//).
@BYK
BYK merged commit 5a7ec5a into main Oct 16, 2026
26 checks passed
@BYK
BYK deleted the cli-1528-issue-list-scoped-counts branch October 16, 2026 23:32
sentry-junior Bot added a commit that referenced this pull request Oct 17, 2026
#1512 landed on main with a call to the old generated parser's parse(),
which this branch removes. Use parseSearchNodes, which returns null for
queries that don't parse.

This branch was previously deployed

1 inactive deployment
Preview — 3790f292 Deployed Oct 15, 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