fix: distinguish never-scanned repos from real 0.0 OpenSSF Scorecard score (IN-1237) - #4508
Conversation
…score (IN-1237) Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
PR SummaryLow Risk Overview
Tinybird pipe deploy only—Insights already shows a no-data state when Reviewed by Cursor Bugbot for commit 62090bb. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Pull request overview
Corrects Scorecard availability detection so unscanned repositories are not treated as genuine zero scores.
Changes:
- Uses
scorecardLastRunAtto determine availability. - Exposes the latest scan timestamp in the repository aggregation.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| round(least(toFloat64OrZero(rd.scorecardScore), 10) * 0.7) | ||
| ) AS scorecardScorePts, | ||
| (rd.url != '') AS scorecardAvailable, | ||
| (rd.scorecardLastRunAt IS NOT NULL) AS scorecardAvailable, |
Summary
health_score_v2_securityTinybird pipe computedscorecardAvailablefrom whether arepostable row existed (rd.url != ''), not whether the OpenSSF Scorecard had actually run. Since every linked package gets areposrow during deps.dev seeding regardless of scan status, unscanned repos gotscorecardAvailable=truewithscorecardScoredefaulting to'0', and the Insights frontend displayed "0.0/10" — indistinguishable from a repo that was genuinely scanned and scored 0.0.scorecardAvailablefromrd.scorecardLastRunAt IS NOT NULLinstead, and exposescorecardLastRunAtthrough therdaggregation subquery so it's in scope.getScorecardRow()ininsights/frontend/config/health-breakdown-templates.tsalready renders ano-datastate whenscorecardAvailableis false; it was only ever wrong because the upstream signal was wrong.coveredWeight/rawScorealready excludescorecardAvailable=falserepos from the aggregate, so Health Score v2 will stop penalizing unscanned repos as failing 0s once this pipe is deployed.Jira: IN-1237
Deploy notes
Tinybird pipe change only — deploy
health_score_v2_security.pipeto staging then production. No Insights redeploy required; it reads the pipe live.Test plan
COPY_SCHEDULE 5 2 * * *)health_score_v2_security_dsfor a repo known to have never been Scorecard-scanned — confirmscorecardAvailable=falsescorecardAvailable=true,scorecardScore='0'