feat: refactor all apis in new path (CM-1236)#4221
Conversation
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2924192. Configure here.
There was a problem hiding this comment.
⚠️ Not ready to approve
One of the new deprecation notes points to an incorrect replacement route (/v1/akrites/ossprey) even though the new router exposes those endpoints at the /v1/akrites root.
Pull request overview
Adds a consolidated OAuth2-protected public API surface under /v1/akrites, reusing existing handlers from the legacy /v1/ossprey, /v1/packages, and /v1/stewardships routers while keeping the legacy paths in place for backward compatibility.
Changes:
- Introduces
akritesRouter()that mounts former ossprey endpoints at the akrites root and nests packages/stewardships under/akrites/packagesand/akrites/stewardships. - Mounts
/v1/akritesin the public v1 router with OAuth2 middleware, and marks legacy route groups withTODO[deprecate]notes. - Adds DAL-level
TODO[deprecate]notes for future renames of ossprey metrics types/functions.
File summaries
| File | Description |
|---|---|
| backend/src/api/public/v1/akrites/index.ts | New consolidated router wiring existing ossprey/packages/stewardships handlers under /v1/akrites. |
| backend/src/api/public/v1/index.ts | Mounts /akrites with OAuth2 and adds deprecation note for legacy route groups. |
| backend/src/api/public/v1/ossprey/index.ts | Adds deprecation note indicating ossprey router is superseded by akrites. |
| backend/src/api/public/v1/packages/index.ts | Adds deprecation note indicating packages router is superseded by akrites. |
| backend/src/api/public/v1/stewardships/index.ts | Adds deprecation note indicating stewardships router is superseded by akrites. |
| services/libs/data-access-layer/src/osspckgs/api.ts | Adds deprecation notes for future renames of ossprey metrics types/functions. |
Copilot's findings
- Files reviewed: 6/6 changed files
- Comments generated: 2
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import { packageListHandler } from './packageList' | ||
| import { packageScatterHandler } from './packageScatter' | ||
|
|
||
| // TODO[deprecate]: superseded by /v1/akrites/ossprey — remove once consumers have migrated |
| const router = Router() | ||
|
|
||
| router.get('/metrics', safeWrap(metricsHandler)) | ||
| // /packages/scatter must be registered before /packages to avoid Express treating 'scatter' as a path param |
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>

Summary
Introduces
/v1/akritesas the new unified public API path, consolidating the endpoints currently spread across/v1/ossprey,/v1/packages, and/v1/stewardships. The old paths are kept intact for backward compatibility and marked withTODO[deprecate]comments to track removal once consumers migrate.Changes
backend/src/api/public/v1/akrites/index.ts— new router that re-uses the existing handlers without duplicating logic; ossprey endpoints are promoted to the akrites root (no/osspreysub-prefix), packages and stewardships keep their sub-pathsbackend/src/api/public/v1/index.ts— mountsakritesRouter()at/akriteswith oauth2 middleware; addsTODO[deprecate]above the old route groupbackend/src/api/public/v1/{ossprey,packages,stewardships}/index.ts— each markedTODO[deprecate]: superseded by /v1/akrites/...services/libs/data-access-layer/src/osspckgs/api.ts—OsspreyMetricsinterface andgetOsspreyMetricsfunction markedTODO[deprecate]: rename to AkritesMetrics / getAkritesMetrics once /v1/ossprey is removedType of change
JIRA ticket
ticket
Note
Medium Risk
Broad routing change with parallel old and new paths; stewardship write endpoints are exposed on a new URL but behavior is unchanged. Migration mistakes could hit deprecated routes or the wrong list endpoint.
Overview
Adds
/v1/akritesas the consolidated OAuth2-protected surface for package stewardship and dashboard APIs, reusing existing handlers instead of duplicating logic.Former
/v1/osspreyroutes move to the akrites root (/metrics,/packages,/packages/scatter,/activity)./v1/packagesand/v1/stewardshipsbehaviors are exposed under/v1/akrites/packagesand/v1/akrites/stewardships, includingPOST /packages:batch-stewardship, with separate 60 req/min rate limiters for packages vs stewardships (same isolation as before). Route order keeps/packages/scatterahead of the/packagessub-router.Legacy
/packages,/stewardships, and/osspreymounts stay for backward compatibility and are taggedTODO[deprecate].GET /v1/packages(listPackages) is not mirrored on akrites because it differs fromGET /v1/akrites/packages(ossprey list shape). DALOsspreyMetrics/getOsspreyMetricsonly get rename TODOs for a future cleanup.Reviewed by Cursor Bugbot for commit 9837582. Bugbot is set up for automated code reviews on this repo. Configure here.