feat(cycle-time): per-repo open-to-merge distribution on the org dashboard#60
Merged
Conversation
…board Adds a new "Cycle Time" section to the org dashboard so engineering can see how long it takes to go from PR open to merge, broken down per repository. The engine now emits mean, P90, % merged within 24h and a five-bucket distribution alongside the existing median, and the platform aggregates these into 4 KPI cards, a sorted "% merged within 1 day per repo" bar chart, and a stacked distribution chart per repo. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pr_mean_time_to_merge_hours,pr_p90_time_to_merge_hours,pr_pct_merged_within_24h, and a five-bucketpr_cycle_time_buckets(same_day / 1d / 2–3d / 4–7d / 7+d).en-USandpt-BR. New--color-bucket-*tokens in the design system.What's in the PR
Engine (Python)
iris/analysis/pr_lifecycle.py—PRLifecycleResultgainsmean,p90,pct_within_24h, andCycleTimeBuckets. Nearest-rank percentile usesceilso the rank stays monotonic.iris/metrics/aggregator.py— passes the new fields intoReportMetrics.iris/models/metrics.py—ReportMetricsschema extended (optional fields preserve backward compatibility).iris/reports/writer.py— Markdown report shows the new metrics when present.iris/i18n.py— en/pt strings for the new metric labels.tests/test_pr_lifecycle.py— 5 new tests cover buckets, % within 24h boundary, mean/P90, and the merged-only filter.Platform (TypeScript / Next.js)
platform/src/types/metrics.ts— TS types mirror the engine fields.platform/src/types/org-summary.ts— newCycleTimeDatashape.platform/lib/queries/org-summary.ts— newcomputeCycleTime()aggregator.platform/src/app/[tenant]/dashboard/sections/CycleTime.tsx— the new section: 4 KPI cards, "% merged within 1 day per repo" sorted ranking chart, and a stacked bucket distribution chart per repo. Insight banner appears once there are ≥ 50 merged PRs.platform/src/app/[tenant]/dashboard/page.tsx— wires the section in (belowPRHealth).platform/src/styles/globals.css— new--color-bucket-*ordinal palette for the stacked bars.platform/lib/translations.ts—dashboard.cycleTime.*strings inen-USandpt-BR.Docs
docs/METRICS.md— new fields documented in §15.CHANGELOG.md— entry underUnreleased.Test plan
pytest tests/— 135 passed (5 new intest_pr_lifecycle.py)npm run test(vitest) — 186 passedtsc --noEmit— cleannpm run lint— 0 errors (preexisting warnings only)npm run build— production build succeeds🤖 Generated with Claude Code