Repository navigation
feat: add health score v2 to project lists and re-source dependency metrics (IN-1222) - #4920
Conversation
PR SummaryMedium Risk Overview
Reviewed by Cursor Bugbot for commit 75675a4. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
🔵 Needs a closer look
Production-only validation of a 142 GB scheduled copy change deployed before merge requires human operational sign-off.
0 open findings
What changed in this PR
Adds Health Score v2 fields to project-list and OSS Index outputs while sourcing dependency metrics directly from current Tinybird pipes.
Changes:
- Propagates Health Score v2 fields through project APIs and OSS Index tuples.
- Re-sources project and repository dependency metrics.
- Prevents replacing snapshots when dependency totals are zero.
| File | Description |
|---|---|
projects_list.pipe |
Documents new sortable fields. |
project_insights_copy.pipe |
Re-sources dependency metrics and adds snapshot guards. |
insightsProjects_filtered.pipe |
Exposes Health Score v2 fields. |
insights_projects_populated_copy.pipe |
Joins and normalizes v2 scores. |
collections_oss_index.pipe |
Appends v2 fields to project tuples. |
category_groups_oss_index.pipe |
Appends v2 fields to project tuples. |
categories_oss_index.pipe |
Appends v2 fields to project tuples. |
insights_projects_populated_ds.datasource |
Adds the four v2 columns. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…etrics (IN-1222) Add healthScoreV2, healthLabel and healthScoreV2Normalized to insights_projects_populated_ds, insightsProjects_filtered and projects_list, and append them to the OSI topProjects tuples. The v1 healthScore slot keeps its index. Read project and repository dependency metrics from the live health_score_*_dependency and repo_health_score_*_dependency pipes instead of health_score_copy_ds and repo_health_score_copy_ds, and fail the project_insights_copy job when a row type has no non-zero dependency metric. Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
Add healthMaxScore to insights_projects_populated_ds, insightsProjects_filtered and projects_list, and append it as the last element of the OSI topProjects tuples, so the UI can mark partial scores. Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
97349cb to
84e7b83
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ 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 84e7b83. Configure here.
| id, | ||
| healthScoreV2, | ||
| healthLabel, | ||
| if(healthMaxScore > 0, healthScoreV2 * 100.0 / healthMaxScore, NULL) AS healthScoreV2Normalized, |
There was a problem hiding this comment.
Normalized score disagrees with label
Medium Severity
healthScoreV2Normalized is computed from the stored healthScoreV2, which is already toUInt8(round(...)), while healthLabel is copied from the pre-round sum divided by healthMaxScore. On partial denominators such as 60, rounding by less than a point can cross a band threshold, so the index pill and the normalized sort disagree.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 84e7b83. Configure here.
| ON base.segmentId = cdep.dependencySegmentId | ||
| LEFT JOIN | ||
| project_insights_copy_organization_dependency AS odep | ||
| ON base.segmentId = odep.dependencySegmentId |
There was a problem hiding this comment.
Blank segment inherits dependency counts
Medium Severity
Project dependency counts now join health_score_contributor_dependency and health_score_organization_dependency on segmentId alone. Those pipes group every activity segment, including ''. Projects with an empty segment that previously missed health_score_copy_ds (that copy keeps segmentId != '') now pick up the shared orphan bucket instead of 0.
Reviewed by Cursor Bugbot for commit 84e7b83. Configure here.
…2-osi-dependency-source Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
|
|
||
| SQL > | ||
| SELECT segmentId AS dependencySegmentId, contributorDependencyCount, contributorDependencyPercentage | ||
| FROM health_score_contributor_dependency |
| id, | ||
| healthScoreV2, | ||
| healthLabel, | ||
| if(healthMaxScore > 0, healthScoreV2 * 100.0 / healthMaxScore, NULL) AS healthScoreV2Normalized, |




Prod Tinybird already runs this branch, so merge it soon. Until it merges, a
tbpush of any file this PR changes from main reverts the live change, and nothing warns you.Summary
healthScoreV2,healthLabel,healthScoreV2NormalizedandhealthMaxScoreto the project list. They pass throughinsights_projects_populated_ds,insightsProjects_filteredandprojects_list, and they are appended to the Open Source Index collection, category and category group tuples. Insights reads them for the index pills and sort.healthScorecolumn and its tuple slot. Existing readers see no change. crowd.dev PR 3 removes them.project_insights_copy. Project and repo rows now join thehealth_score_*_dependencypipes directly. They used to come fromhealth_score_copy_dsandrepo_health_score_copy_ds, and the removals later in this series delete those. The repo source had no scheduled prod run since 2026-09-14, so repo values are current again.healthScorecolumn is non-null, and some projects have no v2 score. Writing v2 into it would need a type change on a heavily read datasource. Writing 0 would show as Critical.COALESCE(..., 0)would otherwise write zeros.Deploy status
Live in production Tinybird. Both commits on this branch were deployed on 2026-10-12. Merging brings main in line with prod. It does not change prod.
Post-deploy checks in prod:
insights_projects_populated_ds.healthScoreV2: 11,158 non-null, sum 695,058. Unchanged.healthMaxScore: 0 mismatches.project_insights_copynow runs about 237 s (was about 90 s), reads 142 GB and peaks at 2.79 GB. It finishes near 03:04, before the 03:10 readers.Staging could not run
project_insights_copy(staging caps copy pipes at 20) or the OSI pipes (staging collections lackssoUserId). Prod was the only real test for these pipes.Deploy steps (run 2026-10-12)
insights_projects_populated_ds: four appended columns.project_insights_copy,insights_projects_populated_copy,insightsProjects_filtered,projects_list,collections_oss_index,categories_oss_indexandcategory_groups_oss_index.tbc project_insights_copy, poll to done. Thentbc insights_projects_populated_copy, poll to done.What breaks if out of order
/api/projectreturns 500 on thehealthScoreV2Normalizedsort. Prod has the columns, so insights PR 1 can deploy now.Cross-repo order
Related PRs
JIRA
IN-1222: Deprecate v1 health score sinks and tables
https://linuxfoundation.atlassian.net/browse/IN-1222