Skip to content

feat(code-review): Team tab with a per-person scorecard for reviews and CI - #2018

Merged
Makisuo merged 3 commits into
mainfrom
feat/code-review-team
Oct 31, 2026
Merged

Makisuo merged 3 commits into
mainfrom
feat/code-review-team

docs(query-engine): an empty default-branch list matches nothing

359f925
Select commit
Loading
Failed to load commit list.
Maple Review Bot / Maple / review succeeded Oct 31, 2026 in 50s

Confidence 8/10 · No issues found

🟢 Confidence 8/10 · likely safe to merge. Held at 8 because earlier reviews of this pull request found 1 defect.
no findings · tests covered · risk medium · 3/3 new units observable · 1 defect fixed in earlier rounds

Adds the Code Review Team tab: a tenant-scoped /internal/code-review/team endpoint, the ciActorStatsQuery per-actor CI fold, and the scorecard page over it. Since the last review only a satisfies clause and one comment changed; safe to merge.

  • ciActorStatsQuery folds runs and ran jobs per GitHub actor
  • CodeReviewTeamService merges review and CI counts per login
  • Team tab derives rates, medians, sorting and ranking

Fixed since the last review

  • ✅ F1 · ciActorStatsQuery emits Branch IN () when the org has no repository

Production impact

Telemetry this change adds and removes (4)
  • ➕ span name CodeReviewTeamService.team · packages/backend/src/services/pr-review/CodeReviewTeamService.ts:273
  • ➕ attribute maple.code_review.pull_requests · packages/backend/src/services/pr-review/CodeReviewTeamService.ts:342
  • ➕ attribute maple.code_review.pull_requests_capped · packages/backend/src/services/pr-review/CodeReviewTeamService.ts:343
  • ➕ attribute maple.code_review.ci_actors · packages/backend/src/services/pr-review/CodeReviewTeamService.ts:344
What was checked
  • CH.inList with an empty list renders 1 = 0 (pinned at gcp-infra.test.ts:190), so defaultBranches: [] counts no pinned branch rather than IN ()
  • Both halves of ciActorStatsQuery filter OrgId via ciScope (ci-runs.ts:165), and the jobs subquery is one row per TraceId, so the join cannot fan out
  • Rates stay 0–1 fractions into formatPercent (packages/ui/src/lib/format.ts:111), matching the CI tab's rateOf
Observability coverage: 3 of 3 changes observable
Change Kind Observable Evidence
GET /internal/code-review/team inbound entrypoint yes Added to the existing HttpApiBuilder.group handlers next to analytics/ciRuns (code-review.http.ts:45)
CodeReviewTeamService.team service operation yes Effect.fn("CodeReviewTeamService.team") with maple.code_review.* span annotations (CodeReviewTeamService.ts:273)
ciActorStats warehouse query outbound DB query yes warehouse.compiledQuery(..., { context: "ciActorStats" }) (CodeReviewTeamService.ts:331)

359f925 · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.