Skip to content

feat: add enriched fields (CM-1285) - #4257

Merged
ulemons merged 2 commits into
mainfrom
feat/enriched-fields
Jun 24, 2026
Merged

feat: add enriched fields (CM-1285)#4257
ulemons merged 2 commits into
mainfrom
feat/enriched-fields

Conversation

@ulemons

@ulemons ulemons commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

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 the packages table in PR #4243 and are now returned in the response instead of being omitted or null.

Changes

  • data-access-layergetPackageDetailByPurl: 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 extends PackageDetailRow with the corresponding typed fields.

Type of change

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

JIRA ticket

CM-1285


Note

Medium Risk
Public package-detail response semantics change for healthScore and 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 from packages instead of deriving health mostly from OpenSSF Scorecard.

getPackageDetailByPurl selects seven new columns (health_score, breakdown scores, lifecycle_label, signal_coverage_health) and maps them on PackageDetailRow. The handler returns healthScore and healthScoreDetails (total, label, maintainer/security/development subscores) from those fields, sets riskSignals.lifecycle from lifecycleLabel, and adds top-level signalCoverageHealth. healthBand still uses computeHealthBand, but the input is Tinybird healthScore / 10 when present, otherwise Scorecard as before.

OpenAPI PackageDetail is 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.

Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
@ulemons ulemons self-assigned this Jun 24, 2026
Copilot AI review requested due to automatic review settings June 24, 2026 08:26
Comment thread backend/src/api/public/v1/packages/getPackage.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.

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 getPackage handler to return the enriched health totals/breakdown, lifecycle label, and signalCoverageHealth.
  • Updated the public OpenAPI spec to include a health “label” field and the signalCoverageHealth property.

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.

Comment on lines 43 to 47
const healthScoreTotal =
pkg.healthScore ?? (scorecardScore !== null ? Math.round(scorecardScore * 10) : null)

ok(res, {
purl: pkg.purl,
Comment on lines +289 to +298
type:
- string
- 'null'
example: Good
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>

@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 11fa261. Configure here.

maintainerHealth: pkg.maintainerHealthScore,
securitySupplyChain: pkg.securitySupplyChainScore,
developmentActivity: pkg.developmentActivityScore,
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 11fa261. Configure here.

@ulemons
ulemons merged commit 4ad17ce into main Jun 24, 2026
16 checks passed
@ulemons
ulemons deleted the feat/enriched-fields branch June 24, 2026 08:58
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