Skip to content

fix(cli): Flatten release list results for session-based sorts - #1543

Merged
betegon merged 1 commit into
mainfrom
fix/cli-release-list-session-sort-flatten
Oct 19, 2026
Merged

betegon merged 1 commit into
mainfrom
fix/cli-release-list-session-sort-flatten

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

sentry release list --sort sessions (also users, crash_free_sessions/cfs, crash_free_users/cfu) always fails with:

Error: Failed to list releases: 400 Bad Request
  sorting by crash statistics requires flattening (flatten=1)

Reproduced with the released 0.47.0 CLI against sentry.io.

Root cause: Sentry's organization releases endpoint only allows the session-based sorts (SESSION_SORTS in OrganizationReleasesEndpoint.get) when flatten=1 is set, and returns 400 otherwise. listReleasesPaginated forwarded sort but never sent flatten, so every sort the CLI offers except date was rejected.

Change: listReleasesPaginated sends flatten=1 when sort is sessions, users, crash_free_sessions, or crash_free_users. Date-sorted requests are unchanged. With flatten=1, Sentry returns one row per release/project pair, which is what these sorts rank by.

Validation:

  • New regression tests in test/lib/api/releases.test.ts check that each session sort sends flatten=1 and that date does not. They failed before the fix and pass after it.
  • Against sentry.io, the same releases request returns 400 without flatten=1 and 200 with it.
  • pnpm run tsc, pnpm run lint, and pnpm --filter sentry run lint pass. pnpm --filter sentry run test passes except for 6 permission-based tests (completions, telemetry, upgrade, code-scanner, file-changes), which fail the same way on unmodified main in the sandbox I used.

via Junior system actor scheduler.

--

View Junior Session [Sentry]

The releases endpoint rejects the sessions, users, and crash-free sorts with a 400 unless flatten=1 is set, so release list --sort sessions/users/cfs/cfu always failed. Send flatten=1 for those sorts.
@vercel

vercel Bot commented Oct 19, 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 19, 2026 12:26pm UTC

Request Review

@sentry-junior sentry-junior Bot added the CLI Sentry CLI and CLI documentation label Oct 19, 2026
@BYK
BYK marked this pull request as ready for review October 19, 2026 12:50
@github-actions github-actions Bot added the risk: low PR risk score: low label Oct 19, 2026
@betegon
betegon merged commit 8d3affe into main Oct 19, 2026
27 checks passed
@betegon
betegon deleted the fix/cli-release-list-session-sort-flatten branch October 19, 2026 14:28

This branch was previously deployed

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

Labels

CLI Sentry CLI and CLI documentation risk: low PR risk score: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants