Skip to content

feat(search): Add issue progress sort#117707

Merged
roggenkemper merged 1 commit into
masterfrom
roggenkemper/feat/issue-progress-sort
Jun 15, 2026
Merged

feat(search): Add issue progress sort#117707
roggenkemper merged 1 commit into
masterfrom
roggenkemper/feat/issue-progress-sort

Conversation

@roggenkemper

@roggenkemper roggenkemper commented Jun 15, 2026

Copy link
Copy Markdown
Member

Adds a new progress issue sort that orders issues by how far they are through the fix cycle:

fix_applied > fix_proposed > diagnosed > triaged > identified

Within a progress tier, last_seen is the secondary key, so the most recently active issue ranks highest.

Why

Surfaces issues that are furthest along toward resolution at the top of the stream, so it's easy to see what's close to done and what just moved.

How

  • A signal resolver derives each group's progress rank from the same Activity records as the existing issue.progress filter (via get_group_progress_states), so the sort and filter stay consistent.
  • The score is rank + last_seen / 10**13 — rank is the integer primary key and the timestamp collapses into a sub-1 recency fraction that only breaks ties, keeping progress strictly primary without it bleeding across tiers.
  • On candidate overflow it falls back to the chunked Snuba last_seen path (degrading to a plain recency sort), so it stays bounded on large result sets.

Notes for reviewers

  • Secondary key is a stand-in. The intended secondary is issue.last_progressed_at, which does not exist yet, so last_seen substitutes for now. Swapping it in later is a one-line change to score_fn.
  • Performance: this is a Postgres Activity aggregation across candidate groups (same class as the issue.progress filter) — correct but not indexed for scale; the overflow fallback keeps it bounded.
  • Backend only, gated behind organizations:issue-stream-progress-sort. The frontend sort dropdown is intentionally not wired up yet, so the sort is currently reachable only via ?sort=progress with the flag on. Frontend follow-up to come in a separate PR.

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 15, 2026
Add a "progress" issue sort that orders issues by how far they are
through the fix cycle (fix_applied > fix_proposed > diagnosed > triaged
> identified), with last_seen as a secondary key so the most recently
active issue ranks highest within a tier.

It reuses the existing PostgresSortStrategy framework: a signal resolver
derives each group's rank from the same Activity records as the
issue.progress filter (via get_group_progress_states), and the score
encodes rank as the integer primary key plus a sub-1 recency fraction.
On candidate overflow it falls back to the chunked Snuba last_seen path.

The secondary key stands in for issue.last_progressed_at, which does not
exist yet; swapping it in later is a one-line change to the score_fn.

Gated behind organizations:issue-stream-progress-sort. Backend only; the
frontend sort dropdown is not wired up yet.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@roggenkemper roggenkemper force-pushed the roggenkemper/feat/issue-progress-sort branch from 0e7d77b to 0197ef6 Compare June 15, 2026 18:31
@roggenkemper roggenkemper marked this pull request as ready for review June 15, 2026 20:33
@roggenkemper roggenkemper requested review from a team as code owners June 15, 2026 20:33
@roggenkemper roggenkemper removed the request for review from a team June 15, 2026 20:33
@roggenkemper roggenkemper merged commit f496b1b into master Jun 15, 2026
84 checks passed
@roggenkemper roggenkemper deleted the roggenkemper/feat/issue-progress-sort branch June 15, 2026 21:52
roggenkemper added a commit that referenced this pull request Jun 16, 2026
Adds a **Progress** entry to the issue stream "Sort by" dropdown, gated
behind `organizations:issue-stream-progress-sort` — the same flag that
gates the backend sort. It mirrors how the **Recommended** sort is wired
(flag check, or shown when it's already the active sort).

Selecting it sends `sort=progress` to the issues API, which orders
issues by how far they are through the fix cycle (`fix_applied >
fix_proposed > diagnosed > triaged > identified`), with `last_seen` as
the secondary key.

## Dependencies

- Backend sort: #117707 (the API only honors
`sort=progress` once that lands).
- Flag: getsentry/sentry-options-automator#8262 (enables the flag for
internal testing).

Until the backend PR deploys, the dropdown option will be inert (the API
falls back to the default sort), which is fine — it's flag-gated and
FE/BE deploy separately anyway.

## Testing notes

No test added: this is a one-to-one mirror of the existing (untested)
`hasRecommendedSort` gating, and there's no colocated test harness for
this dropdown.

Refs #117707
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants