Conversation
Signed-off-by: anilb <epipav@gmail.com>
PR SummaryMedium Risk Overview Handlers and OpenAPI collection copy gains a wording tweak (“the project endpoint” → member-project endpoints). Tests extend the shared collection suite to development and add a collection-target case for Reviewed by Cursor Bugbot for commit f652691. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The scope refactor is consistently applied and covered by shared route, OpenAPI, and target-isolation tests.
Review effort: Balanced
Findings: None
What changed in this PR
Adds collection-scoped routes for all 14 Development widgets while preserving project behavior.
Changes:
- Reuses Development handlers for project and collection scopes via
widgetRoutes. - Generalizes activity-count targeting and retains project-only Popularity routes.
- Extends shared collection-route and activity-count tests.
| File | Description |
|---|---|
api/src/lib/widget-scope.ts |
Adds reusable project targets and collection wording. |
api/src/lib/activity-count.ts |
Generalizes activity counts across scopes. |
api/src/versions/v1-alpha/development/active-days.ts |
Adds collection routing. |
api/src/versions/v1-alpha/development/code-review-participants.ts |
Adds collection routing. |
api/src/versions/v1-alpha/development/code-reviews.ts |
Adds collection routing. |
api/src/versions/v1-alpha/development/commit-activities.ts |
Adds collection routing through shared targeting. |
api/src/versions/v1-alpha/development/contributions-outside-work-hours.ts |
Adds collection routing. |
api/src/versions/v1-alpha/development/issues-resolution.ts |
Adds collection routing. |
api/src/versions/v1-alpha/development/median-time-to-close.ts |
Adds collection routing. |
api/src/versions/v1-alpha/development/median-time-to-review.ts |
Adds collection routing. |
api/src/versions/v1-alpha/development/merge-lead-time.ts |
Adds collection routing. |
api/src/versions/v1-alpha/development/patchsets-per-review.ts |
Adds collection routing. |
api/src/versions/v1-alpha/development/pull-requests.ts |
Adds collection routing. |
api/src/versions/v1-alpha/development/review-comments.ts |
Adds collection routing. |
api/src/versions/v1-alpha/development/review-efficiency.ts |
Adds collection routing and adjusted documentation. |
api/src/versions/v1-alpha/development/review-time-by-pr-size.ts |
Adds collection routing. |
api/src/versions/v1-alpha/popularity/forks.ts |
Adapts to project target helper. |
api/src/versions/v1-alpha/popularity/mailing-lists-messages.ts |
Adapts to project target helper. |
api/src/versions/v1-alpha/popularity/stars.ts |
Adapts to project target helper. |
api/tests/activity-count.test.ts |
Tests project and collection target isolation. |
api/tests/project-routes.test.ts |
Covers all Development collection variants. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
Serves the 14 development widgets for a collection under
/v1-alpha/collections/{slug}/development/*(IN-1412, epic IN-1146). It is stacked on #2347 and adopts itswidgetRouteshelper, so each collection variant reuses the project route handler and passescollectionSlugto the pipe.fetchActivityCountsinsrc/lib/activity-count.tsnow takes the scope target in place of a project slug, so commit-activities works in both scopes. Project and scope params a caller passes are cleared before the target applies.projectTargetinsrc/lib/widget-scope.tsis the project branch ofwidgetRoutes, exported for the popularity routes that usefetchActivityCountsand stay project-only for now.connectedPlatforms.Notes
collectionSlugis taken from the Nuxt app: every development widget is available in collection scope and sendscollectionSlugto the same pipes. No route is left out.Tests
tests/project-routes.test.ts: development joins the pinned collection groups, so the shared collection suite covers all 14 routes, and the wording check also rejects a collection endpoint reference.tests/activity-count.test.ts: the new signature, plus a collection target case that drops caller-supplied scope params.main