Skip to content
Closed
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
63 changes: 0 additions & 63 deletions services/libs/tinybird/datasources/health_score_copy_ds.datasource

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ DESCRIPTION >
- `repoData` array contains tuples of (repository, score, rank) for multi-repo projects.
- `softwareValue` is the estimated economic value of the software (UInt64).
- `contributorCount` and `organizationCount` are computed contributor and organization statistics (UInt64).
- `healthScore` is the overall project health score (Float64).
- `status` is the status of the project ex: active or archived
- `maturity` is the project maturity stage (e.g. Sandbox, Incubating, Graduated). Empty string when not set.
- `lastVulnerabilityScanStatus` is the aggregated vulnerability scan status across all project repositories (`LowCardinality(Nullable(String))`). Possible values: `'success'` (all scans passed), `'no_packages_found'` (no dependency packages detected), `'failure'` (at least one scan failed), `'running'` (scan in progress). NULL when no scan records exist for the project's repositories.
- `healthScoreV2` is the Health Score v2 composite (0-100), copied from `project_insights_copy_ds`. NULL when fewer than 2 categories have data, and for archived projects and `korg`.
- `healthLabel` is the Health Score v2 band ('excellent' to 'critical'), computed on the normalized score. NULL when `healthScoreV2` is NULL.
- `healthScoreV2Normalized` is `healthScoreV2 * 100 / healthMaxScore` (0-100), so partial scores sort on one scale. NULL when `healthScoreV2` or `healthMaxScore` is NULL.
- `healthMaxScore` is the denominator of a partial `healthScoreV2` (60, 65, 75 or 100), copied from `project_insights_copy_ds`. NULL when `healthScoreV2` is NULL.

TAGS "Project metadata", "Analytics enrichment"

Expand Down Expand Up @@ -59,14 +62,17 @@ SCHEMA >
`softwareValue` UInt64,
`contributorCount` UInt64,
`organizationCount` UInt64,
`healthScore` Float64,
`communityPlatforms` Array(String),
`communityKeywords` Array(String),
`communityLanguages` Array(String),
`status` String,
`maturity` LowCardinality(String),
`lastVulnerabilityScanStatus` Nullable(String),
`repoLicenses` Array(Tuple(String, String))
`repoLicenses` Array(Tuple(String, String)),
`healthScoreV2` Nullable(UInt8),
`healthLabel` Nullable(String),
`healthScoreV2Normalized` Nullable(Float64),
`healthMaxScore` Nullable(UInt8)

ENGINE MergeTree
ENGINE_PARTITION_KEY toYear(createdAt)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
DESCRIPTION >
- `project_insights_copy_ds` contains materialized project insights data.
- Populated by `project_insights_copy.pipe` copy pipe.
- Includes project metadata, health score, first commit, and activity metrics for last 365 days and previous 365 days.
- Includes project metadata, Health Score v2, first commit, and activity metrics for last 365 days and previous 365 days.
- `id` column is the primary key identifier for the project or repository.
- `type` column indicates the record type: 'project' for project insights or 'repo' for repository insights.
- `repoUrl` column is the full repository URL for repo type records (empty string for project type).
Expand All @@ -17,11 +17,6 @@ DESCRIPTION >
- `organizationDependencyCount` column is the number of organizations making up 51% of contributions.
- `organizationDependencyPercentage` column is the combined contribution percentage of dependent organizations.
- `achievements` column is an array of tuples (leaderboardType, rank, totalCount) representing project achievements.
- `healthScore` column is the overall health score for the project (0-100).
- `contributorHealthScore` column is the health score percentage for the contributors category (0-100).
- `popularityHealthScore` column is the health score percentage for the popularity category (0-100).
- `developmentHealthScore` column is the health score percentage for the development category (0-100).
- `securityHealthScore` column is the health score percentage for the security category (0-100).
- `firstCommit` column is the timestamp of the first commit in the project.
- `starsLast365Days` column is the count of stars in the last 365 days.
- `forksLast365Days` column is the count of forks in the last 365 days.
Expand All @@ -32,7 +27,7 @@ DESCRIPTION >
- `activeContributorsPrevious365Days` column is the unique count of active contributors in the previous 365 days (365-730 days ago).
- `activeOrganizationsPrevious365Days` column is the unique count of active organizations in the previous 365 days (365-730 days ago).
- `status` column is the current status of the project (e.g., 'active', 'archived').
- `healthScoreV2` column is the Akrites-methodology composite health score (0-100). For project records (`type='project'`): sum of the three per-category medians (maintainerHealthScoreV2 + securitySupplyChainScoreV2 + developmentActivityScoreV2), null-guarded per IN-1248 (null when fewer than 2 categories are present). For repo records (`type='repo'`): per-repo score passed through from `health_score_v2_repo_copy_ds`. Distinct from the legacy `healthScore` column (community/contributor-based).
- `healthScoreV2` column is the Akrites-methodology composite health score (0-100). For project records (`type='project'`): sum of the three per-category medians (maintainerHealthScoreV2 + securitySupplyChainScoreV2 + developmentActivityScoreV2), null-guarded per IN-1248 (null when fewer than 2 categories are present). For repo records (`type='repo'`): per-repo score passed through from `health_score_v2_repo_copy_ds`.
- `healthLabel` column buckets `healthScoreV2`: 'excellent' (85+), 'healthy' (70-84), 'fair' (50-69), 'concerning' (30-49), 'critical' (<30). Lowercase, matches `ossPackages_enriched_ds.healthLabel` convention.
- `lifecycleLabel` column is the project's aggregated maintenance state across its packages, using best-state-wins precedence (active > stable > declining > abandoned > archived) over `ossPackages_enriched_ds.lifecycleLabel`.
- `impactScore` column is the average Osprey criticality `impact` (0-100) across the project's packages. Null when the project has no linked package data.
Expand Down Expand Up @@ -62,11 +57,6 @@ SCHEMA >
`organizationDependencyCount` UInt64,
`organizationDependencyPercentage` Float64,
`achievements` Array(Tuple(String, UInt64, UInt64)),
`healthScore` Nullable(Float64),
`contributorHealthScore` Nullable(Float64),
`popularityHealthScore` Nullable(Float64),
`developmentHealthScore` Nullable(Float64),
`securityHealthScore` Nullable(Float64),
`firstCommit` Nullable(DateTime64(3)),
`starsLast365Days` UInt64,
`forksLast365Days` UInt64,
Expand Down
32 changes: 27 additions & 5 deletions services/libs/tinybird/pipes/categories_oss_index.pipe
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,25 @@ DESCRIPTION >
Returns only needed columns from insights projects

SQL >
SELECT id, name, logoUrl, description, healthScore
SELECT
id,
name,
logoUrl,
description,
healthScoreV2,
healthLabel,
healthScoreV2Normalized,
healthMaxScore
FROM insights_projects_populated_ds
GROUP BY id, name, logoUrl, description, healthScore
GROUP BY
id,
name,
logoUrl,
description,
healthScoreV2,
healthLabel,
healthScoreV2Normalized,
healthMaxScore

NODE categories_oss_index_collections_deduplicated
DESCRIPTION >
Expand Down Expand Up @@ -80,7 +96,10 @@ SQL >
pd.name AS projectName,
pd.logoUrl AS projectLogo,
pd.description AS description,
pd.healthScore AS healthScore
pd.healthScoreV2 AS healthScoreV2,
pd.healthLabel AS healthLabel,
pd.healthScoreV2Normalized AS healthScoreV2Normalized,
pd.healthMaxScore AS healthMaxScore
FROM categories_oss_index_projects_ranked_by_category topProjects
JOIN categories_oss_index_projects_deduplicated pd ON pd.id = topProjects.projectId
WHERE topProjects.rn <= 5
Expand Down Expand Up @@ -159,8 +178,11 @@ SQL >
projectLogo,
softwareValue,
avgScore,
healthScore,
description
description,
healthScoreV2,
healthLabel,
healthScoreV2Normalized,
healthMaxScore
)
) AS topProjects
FROM categories_oss_index_projects
Expand Down
34 changes: 29 additions & 5 deletions services/libs/tinybird/pipes/category_groups_oss_index.pipe
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,27 @@ DESCRIPTION >
Returns only columns which we need from insights projects table

SQL >
SELECT id, name, logoUrl, description, healthScore, status
SELECT
id,
name,
logoUrl,
description,
healthScoreV2,
healthLabel,
healthScoreV2Normalized,
healthMaxScore,
status
FROM insights_projects_populated_ds
GROUP BY id, name, logoUrl, description, healthScore, status
GROUP BY
id,
name,
logoUrl,
description,
healthScoreV2,
healthLabel,
healthScoreV2Normalized,
healthMaxScore,
status

NODE category_groups_oss_index_collections_deduplicated
DESCRIPTION >
Expand Down Expand Up @@ -77,7 +95,10 @@ SQL >
pd.name AS projectName,
pd.logoUrl AS projectLogo,
pd.description AS description,
pd.healthScore AS healthScore,
pd.healthScoreV2 AS healthScoreV2,
pd.healthLabel AS healthLabel,
pd.healthScoreV2Normalized AS healthScoreV2Normalized,
pd.healthMaxScore AS healthMaxScore,
pd.status as status
FROM category_groups_oss_index_projects_ranked_by_category_group topProjects
JOIN category_groups_oss_index_projects_deduplicated pd ON pd.id = topProjects.projectId
Expand Down Expand Up @@ -161,9 +182,12 @@ SQL >
projectLogo,
softwareValue,
avgScore,
healthScore,
description,
status
status,
healthScoreV2,
healthLabel,
healthScoreV2Normalized,
healthMaxScore
)
) AS topProjects
FROM category_groups_oss_index_projects
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ NODE collection_insights_aggregate_projects_aggregated
DESCRIPTION >
Aggregates project counts and health scores per collection from insights_projects_populated_ds.
Uses same "onboarded" definition as original logic: projects with organizationCount > 0 OR contributorCount > 0.
Averages healthScoreV2 (not legacy healthScore) to agree with the "Unavailable" state
shown elsewhere, which also gates on healthScoreV2 IS NULL (IN-1257).
Averages healthScoreV2, matching the "Unavailable" state's healthScoreV2 IS NULL gate (IN-1257).
Normalizes each project's score to a /100 scale before averaging (healthScoreV2 * 100 /
healthMaxScore) so a partial score (e.g. 45/60) contributes its equivalent full-scale value
(75) rather than being averaged in as a raw, disadvantaged 45 (IN-1262, per product decision).
Expand Down
36 changes: 31 additions & 5 deletions services/libs/tinybird/pipes/collections_oss_index.pipe
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,29 @@ DESCRIPTION >
Returns only needed columns from insights projects

SQL >
SELECT id, name, slug, logoUrl, description, healthScore, status
SELECT
id,
name,
slug,
logoUrl,
description,
healthScoreV2,
healthLabel,
healthScoreV2Normalized,
healthMaxScore,
status
FROM insights_projects_populated_ds
GROUP BY id, name, slug, logoUrl, description, healthScore, status
GROUP BY
id,
name,
slug,
logoUrl,
description,
healthScoreV2,
healthLabel,
healthScoreV2Normalized,
healthMaxScore,
status

NODE collections_oss_index_projects_ranked_by_collection
DESCRIPTION >
Expand Down Expand Up @@ -76,7 +96,10 @@ SQL >
pd.slug AS projectSlug,
pd.logoUrl AS projectLogo,
pd.description,
pd.healthScore,
pd.healthScoreV2,
pd.healthLabel,
pd.healthScoreV2Normalized,
pd.healthMaxScore,
pd.status
FROM collections_oss_index_projects_ranked_by_collection topProjects
JOIN collections_oss_index_projects_deduplicated pd ON pd.id = topProjects.projectId
Expand Down Expand Up @@ -109,10 +132,13 @@ SQL >
projectLogo,
softwareValue,
avgScore,
healthScore,
description,
projectSlug,
status
status,
healthScoreV2,
healthLabel,
healthScoreV2Normalized,
healthMaxScore
)
) AS topProjects
FROM collections_oss_index_projects
Expand Down

This file was deleted.

Loading
Loading