feat(release): surface adoption and health metrics in list and view (#463)#680
feat(release): surface adoption and health metrics in list and view (#463)#680
Conversation
…463) Add health/adoption data to the existing release commands: - Pass `health=1` to the list endpoint so each release includes per-project adoption and crash-free metrics - Add ADOPTION and CRASH-FREE columns to `release list` table - Add `health`, `adoptionStages`, and `healthStatsPeriod` query options to `getRelease()` API function - Show per-project health breakdown table in `release view` (crash-free users/sessions, adoption %, 24h user/session counts) - Color-code crash-free rates (green ≥ 99%, yellow ≥ 95%, red < 95%) - Gracefully omit health section when no project has session data
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
|
Codecov Results 📊✅ 134 passed | Total: 134 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 84.74%. Project has 1513 uncovered lines. Files with missing lines (3)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 95.44% 95.38% -0.06%
==========================================
Files 224 225 +1
Lines 32538 32721 +183
Branches 0 0 —
==========================================
+ Hits 31052 31208 +156
- Misses 1486 1513 +27
- Partials 0 0 —Generated by Codecov Action |
Address Cursor Bugbot review — deduplicate the percentage and count formatting helpers into a shared module imported by both list and view.
Support sorting releases by: date (default), sessions, users, crash_free_sessions, crash_free_users. Switches from buildOrgListCommand to buildListCommand to support the custom flag (-s alias).
…ses and session sparklines - Extract compactFormatter, formatNumber, fmtPct, fmtCount, appendUnitSuffix, formatWithUnit, formatCompactWithUnit into src/lib/formatters/numbers.ts - Update dashboard.ts to import from shared module (no behavior change) - Delete src/commands/release/format.ts — replaced by shared module - Add sort aliases: stable_sessions/cfs → crash_free_sessions, stable_users/cfu → crash_free_users - Add SESSIONS sparkline column to release list table using health stats time-series data (same [timestamp, count] format as issue stats) - Drop COMMITS column from list to make room for sparkline
…e URLs Major enhancements to `release list` to match the Sentry releases page: API layer: - Add project (numeric ID[]), environment (string[]), statsPeriod, and status query params to listReleasesPaginated - Add listReleasesForProject helper that resolves slug → numeric ID - Add buildReleaseUrl to sentry-urls.ts (URI-encoded versions) New flags: - --environment/-e: filter by environment (e.g., production) - --period/-t: health stats period (default 90d, matching web UI) - --status: open (default) or archived Project scoping: - Wire listForProject in OrgListConfig so DSN auto-detection and explicit org/project targets scope releases to the detected project Rich styling (matching issue list patterns): - Bold version names linked to Sentry release page - 2-line VERSION cell: version + muted "age | deploy-env" subtitle - Colored adoption: green ≥50%, yellow ≥10% - Colored crash-free rate: green ≥99%, yellow ≥95%, red <95% - Colored crashes: red when >0, green when 0 - Muted session sparklines - Muted row separators between rows - Right-aligned numeric columns (ADOPTION, CRASH-FREE, CRASHES, NEW ISSUES)
Export fmtCrashFree from view.ts and import in list.ts instead of maintaining two identical implementations (addresses Bugbot review).
The default auto-detect handler only resolves org slugs and fetches ALL releases in the org, burying project-specific releases in noise. Override auto-detect to use resolveAllTargets which gets org+project+projectId from DSN detection, then pass numeric project IDs to the API for scoped results. This matches how issue list handles project-scoped auto-detect.
| value: (r) => (r.dateReleased ? "Finalized" : "Unreleased"), | ||
| header: "CRASH-FREE", | ||
| value: (r) => fmtCrashFree(getHealthData(r)?.crashFreeSessions), | ||
| align: "right", |
There was a problem hiding this comment.
Inconsistent missing-value styling in list table columns
Low Severity
The CRASH-FREE column uses fmtCrashFree which returns a plain "—" for missing values, while the ADOPTION and CRASHES columns in the same table use colorTag("muted", "—"). This causes mismatched styling within a single row — some dashes appear dimmed and others appear at full brightness. fmtCrashFree was designed for view.ts markdown tables where plain text is fine, but in the list table context it breaks the visual consistency established by the other columns.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 71591f1. Configure here.
Environment filtering:
- Support multiple -e flags: -e production -e development
- Support comma-separated: -e production,development
- Variadic flag via Stricli variadic: true
Smart production default:
- When no --environment is passed and a single project is auto-detected,
call listProjectEnvironments to check if "production" or "prod" exists
- Auto-select it as the default, matching the Sentry web UI behavior
- Show "Environment: production (use -e to change)" hint so it is clear
- One lightweight API call (project environments list), cached by region
API layer:
- Add listProjectEnvironments using @sentry/api listAProject_sEnvironments
- Returns Array<{ id, name, isHidden }> for visible environments
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 82e0bd2. Configure here.
| return colorTag("yellow", formatted); | ||
| } | ||
| return colorTag("red", formatted); | ||
| } |
There was a problem hiding this comment.
Missing muted styling for null crash-free values in list
Low Severity
In the per-project health table, fmtCrashFree returns a plain em-dash ("—") for null/undefined values. This creates a visual inconsistency, as adjacent columns (e.g., ADOPTION, USERS) render their missing data placeholders as a muted em-dash. The CRASH-FREE column's dash appears unstyled, contrasting with the muted dashes in neighboring columns.
Reviewed by Cursor Bugbot for commit 82e0bd2. Configure here.
…ection When multiple DSNs are detected (e.g., cli from src/lib/constants.ts and cli-website from docs/sentry.client.config.js), rank targets by source path: src/lib/app/ and .env files get priority 0, root-level configs get priority 1, docs/test/scripts get priority 2. Picks only the top- ranked target for auto-detect, preventing mixed releases from unrelated projects.


Summary
release listandrelease viewcommandshealth=1to the releases API so adoption and crash-free metrics are populatedreleasecommand group with adoption/health subcommand #463Changes
API layer (
src/lib/api/releases.ts):listReleasesPaginatedgainshealth?: booleanoptiongetReleasegains optional{ health, adoptionStages, healthStatsPeriod }query paramsReleaseSortValuetype for future--sortsupportList command (
src/commands/release/list.ts):health=1in bothlistForOrgandlistPaginatedhasHealthData: trueView command (
src/commands/release/view.ts):health=true, adoptionStages=trueon every viewTests (
test/commands/release/view.test.ts):projects[].healthDatafields pass throughhasHealthData: false