Skip to content

feat: refactor all apis in new path (CM-1236)#4221

Open
ulemons wants to merge 2 commits into
mainfrom
feat/dashboard-v2-api-refactor
Open

feat: refactor all apis in new path (CM-1236)#4221
ulemons wants to merge 2 commits into
mainfrom
feat/dashboard-v2-api-refactor

Conversation

@ulemons

@ulemons ulemons commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Introduces /v1/akrites as 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 with TODO[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 /ossprey sub-prefix), packages and stewardships keep their sub-paths
  • backend/src/api/public/v1/index.ts — mounts akritesRouter() at /akrites with oauth2 middleware; adds TODO[deprecate] above the old route group
  • backend/src/api/public/v1/{ossprey,packages,stewardships}/index.ts — each marked TODO[deprecate]: superseded by /v1/akrites/...
  • services/libs/data-access-layer/src/osspckgs/api.tsOsspreyMetrics interface and getOsspreyMetrics function marked TODO[deprecate]: rename to AkritesMetrics / getAkritesMetrics once /v1/ossprey is removed

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Performance improvement
  • Chore / dependency update
  • Documentation

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/akrites as the consolidated OAuth2-protected surface for package stewardship and dashboard APIs, reusing existing handlers instead of duplicating logic.

Former /v1/ossprey routes move to the akrites root (/metrics, /packages, /packages/scatter, /activity). /v1/packages and /v1/stewardships behaviors are exposed under /v1/akrites/packages and /v1/akrites/stewardships, including POST /packages:batch-stewardship, with separate 60 req/min rate limiters for packages vs stewardships (same isolation as before). Route order keeps /packages/scatter ahead of the /packages sub-router.

Legacy /packages, /stewardships, and /ossprey mounts stay for backward compatibility and are tagged TODO[deprecate]. GET /v1/packages (listPackages) is not mirrored on akrites because it differs from GET /v1/akrites/packages (ossprey list shape). DAL OsspreyMetrics / getOsspreyMetrics only 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.

Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
@ulemons ulemons self-assigned this Jun 16, 2026
Copilot AI review requested due to automatic review settings June 16, 2026 13:39

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread backend/src/api/public/v1/akrites/index.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ 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/packages and /akrites/stewardships.
  • Mounts /v1/akrites in the public v1 router with OAuth2 middleware, and marks legacy route groups with TODO[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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants