feat: add enriched fields (CM-1285) - #4257
Conversation
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
There was a problem hiding this comment.
Pull request overview
This PR expands the public package detail API (GET /packages/detail and Akrites equivalent) to surface Tinybird-enriched package health fields that already exist on the packages table, so clients no longer receive omitted/null health breakdown and lifecycle data.
Changes:
- Extended
getPackageDetailByPurl(DAL) to select and type seven Tinybird-enriched columns (health_*, component scores,lifecycle_label,signal_coverage_health). - Updated the public v1
getPackagehandler to return the enriched health totals/breakdown, lifecycle label, andsignalCoverageHealth. - Updated the public OpenAPI spec to include a health “label” field and the
signalCoverageHealthproperty.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| services/libs/data-access-layer/src/osspckgs/api.ts | Selects Tinybird-enriched health/lifecycle columns and exposes them via PackageDetailRow. |
| backend/src/api/public/v1/packages/getPackage.ts | Maps the new DAL fields into the public API response. |
| backend/src/api/public/v1/packages/openapi.yaml | Documents signalCoverageHealth and adds a health label field. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const healthScoreTotal = | ||
| pkg.healthScore ?? (scorecardScore !== null ? Math.round(scorecardScore * 10) : null) | ||
|
|
||
| ok(res, { | ||
| purl: pkg.purl, |
| type: | ||
| - string | ||
| - 'null' | ||
| example: Good |
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 11fa261. Configure here.
| maintainerHealth: pkg.maintainerHealthScore, | ||
| securitySupplyChain: pkg.securitySupplyChainScore, | ||
| developmentActivity: pkg.developmentActivityScore, | ||
| }, |
There was a problem hiding this comment.
healthScoreDetails never null
Medium Severity
The handler always builds a healthScoreDetails object with nullable fields, but the updated OpenAPI schema says that property stays null until Tinybird enrichment. Unenriched package responses therefore expose an empty breakdown object instead of null, which breaks clients that gate UI on a missing healthScoreDetails.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 11fa261. Configure here.


Summary
Exposes Tinybird-enriched package health fields in the self-serve package detail API (
GET /packages/detail,/akrites/packages/detail). These columns were added to thepackagestable in PR #4243 and are now returned in the response instead of being omitted or null.Changes
data-access-layer—getPackageDetailByPurl: adds 7 new columns to the SQL SELECT (health_score,health_label,maintainer_health_score,security_supply_chain_score,development_activity_score,lifecycle_label,signal_coverage_health) and extendsPackageDetailRowwith the corresponding typed fields.Type of change
JIRA ticket
CM-1285
Note
Medium Risk
Public package-detail response semantics change for
healthScoreand new fields; clients that assumed Scorecard-derived health may see different values when Tinybird data exists.Overview
Package detail (
GET /packages/detail) now returns Tinybird-enriched health data frompackagesinstead of deriving health mostly from OpenSSF Scorecard.getPackageDetailByPurlselects seven new columns (health_score, breakdown scores,lifecycle_label,signal_coverage_health) and maps them onPackageDetailRow. The handler returnshealthScoreandhealthScoreDetails(total, label, maintainer/security/development subscores) from those fields, setsriskSignals.lifecyclefromlifecycleLabel, and adds top-levelsignalCoverageHealth.healthBandstill usescomputeHealthBand, but the input is TinybirdhealthScore / 10when present, otherwise Scorecard as before.OpenAPI
PackageDetailis updated to document the new fields and examples (replacing the old “scorecard × 10 only” health shape).Reviewed by Cursor Bugbot for commit 11fa261. Bugbot is set up for automated code reviews on this repo. Configure here.