Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,41 @@ DESCRIPTION >
- `repoUrl` is the repository URL — the join key back to `repositories`.
- `developmentActivityScoreV2` — NULL when covered sub-signal weight is <40% of the 25pt max
(spec Layer 1 graceful degradation), otherwise the rescaled 0-25 score.
- `releaseCadenceScore`/`commitActivityScore`/`issueResolutionScore`/`prMergeScore` (IN-1212) are
the raw per-signal sub-scores before rescaling, as computed in `health_score_v2_development.pipe`.
- `releaseCadenceAvailable`/`issueResolutionAvailable`/`prMergeAvailable` (IN-1212) are the Layer 1
coverage flags — 0 means the signal was `blocked` (no data), not scored 0. Commit activity has no
`Available` flag: it always contributes via the `repos.lastCommitAt` fallback (see pipe DESCRIPTION).
- `daysSinceLatest`/`daysBetweenRecent` (IN-1212) are the raw release-cadence signal; NULL when the
repo has no published packages with release dates.
- `commitsLast6m` (IN-1212) is the raw commit count behind `commitActivityScore`; NULL when the repo
has no `authored-commit` activity (the score then falls back to `lastCommitAt`).
- `lastCommitAt` (IN-1212) is the repo's last commit timestamp, used as the commit-activity fallback.
- `closed12m`/`opened12m`/`medianCloseS` (IN-1212) are the raw issue-resolution counts/median behind
`issueResolutionScore`; NULL when unavailable.
- `merged12m`/`closedUnmerged12m`/`medianMergeS` (IN-1212) are the raw PR-merge counts/median behind
`prMergeScore`; NULL when unavailable.

SCHEMA >
`repoUrl` String,
`developmentActivityScoreV2` Nullable(UInt8)
`developmentActivityScoreV2` Nullable(UInt8),
`releaseCadenceScore` UInt8,
`releaseCadenceAvailable` UInt8,
`daysSinceLatest` Nullable(Int64),
`daysBetweenRecent` Nullable(Int64),
`commitActivityScore` UInt8,
`commitsLast6m` Nullable(UInt64),
`lastCommitAt` Nullable(DateTime64(3)),
`issueResolutionScore` UInt8,
`issueResolutionAvailable` UInt8,
`closed12m` Nullable(UInt64),
`opened12m` Nullable(UInt64),
`medianCloseS` Nullable(Float64),
`prMergeScore` UInt8,
`prMergeAvailable` UInt8,
`merged12m` Nullable(UInt64),
`closedUnmerged12m` Nullable(UInt64),
`medianMergeS` Nullable(Float64)

ENGINE MergeTree
ENGINE_SORTING_KEY repoUrl
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,36 @@ DESCRIPTION >
- `repoUrl` is the repository URL — the join key back to `repositories`.
- `maintainerHealthScoreV2` — NULL when covered sub-signal weight is <40% of the 40pt max
(spec Layer 1 graceful degradation), otherwise the rescaled 0-40 score.
- `busFactorScore`/`orgDiversityScore`/`responsivenessScore` (IN-1212) are the raw per-signal
sub-scores before rescaling, as computed in `health_score_v2_maintainer.pipe`.
- `busFactorAvailable`/`orgDiversityAvailable`/`responsivenessAvailable` (IN-1212) are the Layer 1
coverage flags — 0 means the signal was `blocked` (no data), not scored 0.
- `busFactorCount`/`orgCount` (IN-1212) are the raw counts behind the bus-factor and org-diversity
scores; NULL when the signal is blocked.
- `medianPrResponseS`/`medianIssueResponseS` (IN-1212) are the raw median response times (seconds)
behind the responsiveness score; NULL when unavailable.
- `isGerrit`/`isExcluded` (IN-1212) are the repo classification flags used to decide responsiveness
availability and scoring branch.
- `coveredWeight` (IN-1212) is the sum of available sub-signal weights (max 40) used as the
rescale denominator for `maintainerHealthScoreV2` — exposed so the content spec's "category
coverage" UI can show what fraction of the 40pt max was actually scored.

SCHEMA >
`repoUrl` String,
`maintainerHealthScoreV2` Nullable(UInt8)
`maintainerHealthScoreV2` Nullable(UInt8),
`busFactorScore` UInt8,
`busFactorAvailable` UInt8,
`busFactorCount` Nullable(UInt64),
`orgDiversityScore` UInt8,
`orgDiversityAvailable` UInt8,
`orgCount` Nullable(UInt64),
`responsivenessScore` UInt8,
`responsivenessAvailable` UInt8,
`medianPrResponseS` Nullable(Float64),
`medianIssueResponseS` Nullable(Float64),
`isGerrit` UInt8,
`isExcluded` UInt8,
`coveredWeight` UInt8

ENGINE MergeTree
ENGINE_SORTING_KEY repoUrl
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,40 @@ DESCRIPTION >
- `repoUrl` is the repository URL — the join key back to `repositories`.
- `securitySupplyChainScoreV2` — NULL when covered sub-signal weight is <40% of the 35pt max
(spec Layer 1 graceful degradation), otherwise the rescaled 0-35 score.
- `openVulnScore`/`scorecardScorePts`/`securityPracticesScore`/`dependencyHealthScore` (IN-1212)
are the raw per-signal sub-scores before rescaling, as computed in `health_score_v2_security.pipe`.
- `scorecardAvailable`/`securityPracticesAvailable`/`dependencyHealthAvailable` (IN-1212) are the
Layer 1 coverage flags — 0 means the signal was `blocked` (no data), not scored 0.
- `openCriticals`/`openHighs`/`openModerates` (IN-1212) are the raw open-vulnerability counts by
severity; NULL when the repo has no rows in `vulnerabilities`.
- `scorecardScore` (IN-1212) is the raw OpenSSF Scorecard aggregate score (0-10 as a string,
passed through from `repos.scorecardScore`; empty string when unavailable).
- `securityPolicyEnabled`/`branchProtectionEnabled`/`branchProtectionRequiredReviews`/
`branchProtectionRequiresStatusChecks`/`branchProtectionAllowsForcePush` (IN-1212) are the raw
security-practice flags behind `securityPracticesScore`; NULL when unavailable.
- `vulnerableDeps` (IN-1212) is the raw count of dependencies with an open HIGH/CRITICAL advisory
behind `dependencyHealthScore`; NULL when the repo has no published packages.

SCHEMA >
`repoUrl` String,
`securitySupplyChainScoreV2` Nullable(UInt8)
`securitySupplyChainScoreV2` Nullable(UInt8),
`openVulnScore` UInt8,
`openCriticals` Nullable(UInt64),
`openHighs` Nullable(UInt64),
`openModerates` Nullable(UInt64),
`scorecardScorePts` UInt8,
`scorecardAvailable` UInt8,
`scorecardScore` String,
`securityPracticesScore` UInt8,
`securityPracticesAvailable` UInt8,
`securityPolicyEnabled` Nullable(UInt8),
`branchProtectionEnabled` Nullable(UInt8),
`branchProtectionRequiredReviews` Nullable(Int32),
`branchProtectionRequiresStatusChecks` Nullable(UInt8),
`branchProtectionAllowsForcePush` Nullable(UInt8),
`dependencyHealthScore` UInt8,
`dependencyHealthAvailable` UInt8,
`vulnerableDeps` Nullable(UInt64)

ENGINE MergeTree
ENGINE_SORTING_KEY repoUrl
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
DESCRIPTION >
- `health_score_v2_signal_detail_ds` holds the per-repo flat signal-detail row for Health Score v2
(IN-1212 Content Spec) — every promoted per-signal raw value and `*Available` coverage flag from
the 3 category datasources (`health_score_v2_maintainer_ds`, `health_score_v2_security_ds`,
`health_score_v2_development_ds`), joined on `repoUrl`. Populated by
`health_score_v2_signal_detail.pipe`.
- `repoUrl` is the repository URL — the join key back to `repositories`.
- Maintainer signals: `busFactorScore`, `busFactorAvailable`, `busFactorCount`,
`orgDiversityScore`, `orgDiversityAvailable`, `orgCount`, `responsivenessScore`,
`responsivenessAvailable`, `medianPrResponseS`, `medianIssueResponseS`, `isGerrit`, `isExcluded`
— see `health_score_v2_maintainer_ds` for definitions.
- Security signals: `openVulnScore`, `openCriticals`, `openHighs`, `openModerates`,
`scorecardScorePts`, `scorecardAvailable`, `scorecardScore`, `securityPracticesScore`,
`securityPracticesAvailable`, `securityPolicyEnabled`, `branchProtectionEnabled`,
`branchProtectionRequiredReviews`, `branchProtectionRequiresStatusChecks`,
`branchProtectionAllowsForcePush`, `dependencyHealthScore`, `dependencyHealthAvailable`,
`vulnerableDeps` — see `health_score_v2_security_ds` for definitions.
- Development signals: `releaseCadenceScore`, `releaseCadenceAvailable`, `daysSinceLatest`,
`daysBetweenRecent`, `commitActivityScore`, `commitsLast6m`, `lastCommitAt`,
`issueResolutionScore`, `issueResolutionAvailable`, `closed12m`, `opened12m`, `medianCloseS`,
`prMergeScore`, `prMergeAvailable`, `merged12m`, `closedUnmerged12m`, `medianMergeS` — see
`health_score_v2_development_ds` for definitions.
- All columns except `repoUrl` are Nullable here (even ones that are non-Nullable in their source
`_ds`) because this table is built via LEFT JOIN — a repo missing from one of the 3 source
datasources surfaces NULL for that category's columns rather than dropping the repo.

SCHEMA >
`repoUrl` String,
`busFactorScore` Nullable(UInt8),
`busFactorAvailable` Nullable(UInt8),
`busFactorCount` Nullable(UInt64),
`orgDiversityScore` Nullable(UInt8),
`orgDiversityAvailable` Nullable(UInt8),
`orgCount` Nullable(UInt64),
`responsivenessScore` Nullable(UInt8),
`responsivenessAvailable` Nullable(UInt8),
`medianPrResponseS` Nullable(Float64),
`medianIssueResponseS` Nullable(Float64),
`isGerrit` Nullable(UInt8),
`isExcluded` Nullable(UInt8),
`openVulnScore` Nullable(UInt8),
`openCriticals` Nullable(UInt64),
`openHighs` Nullable(UInt64),
`openModerates` Nullable(UInt64),
`scorecardScorePts` Nullable(UInt8),
`scorecardAvailable` Nullable(UInt8),
`scorecardScore` Nullable(String),
`securityPracticesScore` Nullable(UInt8),
`securityPracticesAvailable` Nullable(UInt8),
`securityPolicyEnabled` Nullable(UInt8),
`branchProtectionEnabled` Nullable(UInt8),
`branchProtectionRequiredReviews` Nullable(Int32),
`branchProtectionRequiresStatusChecks` Nullable(UInt8),
`branchProtectionAllowsForcePush` Nullable(UInt8),
`dependencyHealthScore` Nullable(UInt8),
`dependencyHealthAvailable` Nullable(UInt8),
`vulnerableDeps` Nullable(UInt64),
`releaseCadenceScore` Nullable(UInt8),
`releaseCadenceAvailable` Nullable(UInt8),
`daysSinceLatest` Nullable(Int64),
`daysBetweenRecent` Nullable(Int64),
`commitActivityScore` Nullable(UInt8),
`commitsLast6m` Nullable(UInt64),
`lastCommitAt` Nullable(DateTime64(3)),
`issueResolutionScore` Nullable(UInt8),
`issueResolutionAvailable` Nullable(UInt8),
`closed12m` Nullable(UInt64),
`opened12m` Nullable(UInt64),
`medianCloseS` Nullable(Float64),
`prMergeScore` Nullable(UInt8),
`prMergeAvailable` Nullable(UInt8),
`merged12m` Nullable(UInt64),
`closedUnmerged12m` Nullable(UInt64),
`medianMergeS` Nullable(Float64)

ENGINE MergeTree
ENGINE_SORTING_KEY repoUrl
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
DESCRIPTION >
- `project_insights_health_breakdown_ds` contains the materialized project-level Health Score v2
signal breakdown (IN-1212), populated by `project_insights_health_breakdown_copy.pipe` on a
schedule.
- Precomputed so the public `project_insights_health_breakdown.pipe` endpoint is a cheap filtered
SELECT rather than a live per-request rollup — see that pipe's DESCRIPTION and
`project_insights_health_breakdown_copy.pipe`'s DESCRIPTION for the full per-column aggregation
methodology (score columns avg, count columns max, median-seconds columns avg, boolean/flag
columns max, `isGerrit`/`isExcluded` min).
- `projectId` is the project id (`insightsProjects.id`).
- `slug` is the project's URL-friendly identifier — the primary filter key for the endpoint.
- Maintainer signals: `busFactorScore` (avg), `busFactorAvailable` (max), `busFactorCount` (max),
`orgDiversityScore` (avg), `orgDiversityAvailable` (max), `orgCount` (max),
`responsivenessScore` (avg), `responsivenessAvailable` (max), `medianPrResponseS` (avg),
`medianIssueResponseS` (avg), `isGerrit` (min), `isExcluded` (min).
- Security signals: `openVulnScore` (avg), `openCriticals`/`openHighs`/`openModerates` (max),
`scorecardScorePts` (avg), `scorecardAvailable` (max), `scorecardScore` (avg, cast from the raw
String), `securityPracticesScore` (avg), `securityPracticesAvailable` (max),
`securityPolicyEnabled`/`branchProtectionEnabled`/`branchProtectionRequiredReviews`/
`branchProtectionRequiresStatusChecks`/`branchProtectionAllowsForcePush` (max),
`dependencyHealthScore` (avg), `dependencyHealthAvailable` (max), `vulnerableDeps` (max).
- Development signals: `releaseCadenceScore` (avg), `releaseCadenceAvailable` (max),
`daysSinceLatest`/`daysBetweenRecent` (max), `commitActivityScore` (avg), `commitsLast6m` (max),
`lastCommitAt` (max), `issueResolutionScore` (avg), `issueResolutionAvailable` (max),
`closed12m`/`opened12m` (max), `medianCloseS` (avg), `prMergeScore` (avg), `prMergeAvailable`
(max), `merged12m`/`closedUnmerged12m` (max), `medianMergeS` (avg).
- All columns except `projectId`/`slug` are Nullable: a project with zero enabled/non-excluded
repos, or repos with no Health Score v2 signal data, rolls up to NULL rather than a fabricated 0.

SCHEMA >
`projectId` String,
`slug` String,
`busFactorScore` Nullable(Float64),
`busFactorAvailable` Nullable(UInt8),
`busFactorCount` Nullable(UInt64),
`orgDiversityScore` Nullable(Float64),
`orgDiversityAvailable` Nullable(UInt8),
`orgCount` Nullable(UInt64),
`responsivenessScore` Nullable(Float64),
`responsivenessAvailable` Nullable(UInt8),
`medianPrResponseS` Nullable(Float64),
`medianIssueResponseS` Nullable(Float64),
`isGerrit` Nullable(UInt8),
`isExcluded` Nullable(UInt8),
`openVulnScore` Nullable(Float64),
`openCriticals` Nullable(UInt64),
`openHighs` Nullable(UInt64),
`openModerates` Nullable(UInt64),
`scorecardScorePts` Nullable(Float64),
`scorecardAvailable` Nullable(UInt8),
`scorecardScore` Nullable(Float64),
`securityPracticesScore` Nullable(Float64),
`securityPracticesAvailable` Nullable(UInt8),
`securityPolicyEnabled` Nullable(UInt8),
`branchProtectionEnabled` Nullable(UInt8),
`branchProtectionRequiredReviews` Nullable(Int32),
`branchProtectionRequiresStatusChecks` Nullable(UInt8),
`branchProtectionAllowsForcePush` Nullable(UInt8),
`dependencyHealthScore` Nullable(Float64),
`dependencyHealthAvailable` Nullable(UInt8),
`vulnerableDeps` Nullable(UInt64),
`releaseCadenceScore` Nullable(Float64),
`releaseCadenceAvailable` Nullable(UInt8),
`daysSinceLatest` Nullable(Int64),
`daysBetweenRecent` Nullable(Int64),
`commitActivityScore` Nullable(Float64),
`commitsLast6m` Nullable(UInt64),
`lastCommitAt` Nullable(DateTime64(3)),
`issueResolutionScore` Nullable(Float64),
`issueResolutionAvailable` Nullable(UInt8),
`closed12m` Nullable(UInt64),
`opened12m` Nullable(UInt64),
`medianCloseS` Nullable(Float64),
`prMergeScore` Nullable(Float64),
`prMergeAvailable` Nullable(UInt8),
`merged12m` Nullable(UInt64),
`closedUnmerged12m` Nullable(UInt64),
`medianMergeS` Nullable(Float64)

ENGINE MergeTree
ENGINE_SORTING_KEY slug, projectId
50 changes: 47 additions & 3 deletions services/libs/tinybird/pipes/health_score_v2_development.pipe
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,45 @@ SQL >
coveredWeight / 25.0 < 0.4,
NULL,
toNullable(toUInt8(round(least(25.0, rawScore * (25.0 / coveredWeight)))))
) AS developmentActivityScoreV2
) AS developmentActivityScoreV2,
releaseCadenceScore,
releaseCadenceAvailable,
daysSinceLatest,
daysBetweenRecent,
commitActivityScore,
commitsLast6m,
lastCommitAt,
issueResolutionScore,
issueResolutionAvailable,
closed12m,
opened12m,
medianCloseS,
prMergeScore,
prMergeAvailable,
merged12m,
closedUnmerged12m,
medianMergeS
FROM
(
SELECT
repoUrl,
releaseCadenceScore,
releaseCadenceAvailable,
daysSinceLatest,
daysBetweenRecent,
commitActivityScore,
commitsLast6m,
lastCommitAt,
issueResolutionScore,
issueResolutionAvailable,
closed12m,
opened12m,
medianCloseS,
prMergeScore,
prMergeAvailable,
merged12m,
closedUnmerged12m,
medianMergeS,
(
releaseCadenceAvailable * releaseCadenceScore
+ commitActivityScore
Expand All @@ -40,7 +74,10 @@ SQL >
(
SELECT
rp.repoUrl AS repoUrl,
rp.lastCommitAt AS lastCommitAt,
(rs.repoUrl != '') AS releaseCadenceAvailable,
rs.daysSinceLatest AS daysSinceLatest,
rs.daysBetweenRecent AS daysBetweenRecent,
multiIf(
rs.daysSinceLatest < 90 AND rs.daysBetweenRecent < 90,
8,
Expand All @@ -52,6 +89,7 @@ SQL >
2,
0
) AS releaseCadenceScore,
c.commitsLast6m AS commitsLast6m,
-- commit activity is never `blocked`: it has its own spec-mandated fallback to
-- repos.lastCommitAt, so it always contributes its full 5pt weight to coverage
multiIf(
Expand All @@ -74,7 +112,10 @@ SQL >
0
) AS commitActivityScore,
(ist.repoUrl != '') AS issueResolutionAvailable,
(
ist.closed12m AS closed12m,
ist.opened12m AS opened12m,
ist.medianCloseS AS medianCloseS,
toUInt8(
multiIf(
ist.opened12m = 0,
0,
Expand All @@ -87,7 +128,10 @@ SQL >
+ multiIf(ist.medianCloseS < 604800, 3, ist.medianCloseS < 2592000, 2, 0)
) AS issueResolutionScore,
(prs.repoUrl != '') AS prMergeAvailable,
(
prs.merged12m AS merged12m,
prs.closedUnmerged12m AS closedUnmerged12m,
prs.medianMergeS AS medianMergeS,
toUInt8(
multiIf(
(prs.merged12m + prs.closedUnmerged12m) = 0,
0,
Expand Down
Loading
Loading