Conversation
PR SummaryMedium Risk Overview Because the categories pipe emits 8-slot project tuples (no Tests cover mapping, pipe call order and query params, empty lists, 400/404/503 cases, OpenAPI tagging, and the new tuple guard/mapper in Reviewed by Cursor Bugbot for commit 1faed50. 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 implementation matches the described contract and includes comprehensive validation and test coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Adds the /v1-alpha/oss-index/categories endpoint for retrieving a category group and its categories.
Changes:
- Adds validated Tinybird queries and response schemas.
- Adds 8-slot project tuple mapping.
- Adds comprehensive endpoint and mapper tests.
| File | Description |
|---|---|
api/src/versions/v1-alpha/oss-index/categories.ts |
Implements the endpoint. |
api/src/lib/oss-index.ts |
Adds category project guards, schema, and mapper. |
api/tests/oss-index-categories.test.ts |
Tests endpoint behavior and validation. |
api/tests/oss-index.test.ts |
Tests tuple mapping and guards. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: anilb <epipav@gmail.com>
Signed-off-by: anilb <epipav@gmail.com>
gaspergrom
left a comment
There was a problem hiding this comment.
Looks good to me. The 8-slot guard composes cleanly into the 9-slot one, and the tests cover the 404 short-circuit and the malformed-row 503 paths.

Summary
Adds
GET /v1-alpha/oss-index/categories(IN-1415, epic IN-1146). It returns one category group's details and its categories, each with its top collections and top projects.categoryGroupSlugpicks the group and is required.sort(totalContributorsorsoftwareValue, defaulttotalContributors) orders the categories.category_groups_listfirst. An unknown slug answers 404not_found, and the categories pipe is then skipped.categories_oss_index, with tuples mapped through the shared module from the groups endpoint.upstream_unavailable.Notes
status, sosrc/lib/oss-index.tsgainsCategoryTopProjectand its guard and mapper. The groups route's shape is unchanged.{ name, slug, type, categories }, a single group with its child list.Tests
tests/oss-index-categories.test.ts: both pipe calls and their params, 404 for an unknown slug, 400 for a missing slug or an invalid sort, tuple mapping, 503 for malformed rows, empty categories, and the OpenAPI entry.tests/oss-index.test.ts: the 8-slot guard and mapper.main