Skip to content

Commit 307993f

Browse files
authored
feat: add category health score to project insights (#3914)
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
1 parent fa00e9d commit 307993f

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

services/libs/tinybird/datasources/project_insights_copy_ds.datasource

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ DESCRIPTION >
1616
- `organizationDependencyPercentage` column is the combined contribution percentage of dependent organizations.
1717
- `achievements` column is an array of tuples (leaderboardType, rank, totalCount) representing project achievements.
1818
- `healthScore` column is the overall health score for the project (0-100).
19+
- `contributorHealthScore` column is the health score percentage for the contributors category (0-100).
20+
- `popularityHealthScore` column is the health score percentage for the popularity category (0-100).
21+
- `developmentHealthScore` column is the health score percentage for the development category (0-100).
22+
- `securityHealthScore` column is the health score percentage for the security category (0-100).
1923
- `firstCommit` column is the timestamp of the first commit in the project.
2024
- `starsLast365Days` column is the count of stars in the last 365 days.
2125
- `forksLast365Days` column is the count of forks in the last 365 days.
@@ -43,6 +47,10 @@ SCHEMA >
4347
`organizationDependencyPercentage` Float64,
4448
`achievements` Array(Tuple(String, UInt64, UInt64)),
4549
`healthScore` Nullable(Float64),
50+
`contributorHealthScore` Nullable(Float64),
51+
`popularityHealthScore` Nullable(Float64),
52+
`developmentHealthScore` Nullable(Float64),
53+
`securityHealthScore` Nullable(Float64),
4654
`firstCommit` Nullable(DateTime64(3)),
4755
`starsLast365Days` UInt64,
4856
`forksLast365Days` UInt64,

services/libs/tinybird/pipes/project_insights.pipe

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
DESCRIPTION >
22
- `project_insights.pipe` serves project insights data for a specific project.
3-
- Returns comprehensive metrics including project metadata (name, logoUrl, isLF), health score, contributor count, software value, contributor and organization dependency metrics, leaderboard achievements, and activity metrics for both current and previous 365-day periods.
3+
- Returns comprehensive metrics including project metadata (name, logoUrl, isLF), health score with category breakdowns (contributors, popularity, development, security), contributor count, software value, contributor and organization dependency metrics, leaderboard achievements, and activity metrics for both current and previous 365-day periods.
44
- Parameters:
55
- `slug`: Optional string for a single project slug (e.g., 'kubernetes')
66
- `slugs`: Optional array of project slugs for multi-project query (e.g., ['kubernetes', 'tensorflow'])
@@ -27,6 +27,10 @@ SQL >
2727
organizationDependencyPercentage,
2828
achievements,
2929
healthScore,
30+
contributorHealthScore,
31+
popularityHealthScore,
32+
developmentHealthScore,
33+
securityHealthScore,
3034
firstCommit,
3135
starsLast365Days,
3236
forksLast365Days,

services/libs/tinybird/pipes/project_insights_copy.pipe

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ SQL >
3939
contributorDependencyCount,
4040
contributorDependencyPercentage,
4141
organizationDependencyCount,
42-
organizationDependencyPercentage
42+
organizationDependencyPercentage,
43+
contributorPercentage,
44+
popularityPercentage,
45+
developmentPercentage,
46+
securityPercentage
4347
FROM health_score_copy_ds
4448

4549
NODE project_insights_copy_achievements
@@ -106,6 +110,10 @@ SQL >
106110
COALESCE(dep.organizationDependencyPercentage, 0) AS organizationDependencyPercentage,
107111
COALESCE(ach.achievements, []) AS achievements,
108112
base.healthScore AS healthScore,
113+
dep.contributorPercentage AS contributorHealthScore,
114+
dep.popularityPercentage AS popularityHealthScore,
115+
dep.developmentPercentage AS developmentHealthScore,
116+
dep.securityPercentage AS securityHealthScore,
109117
base.firstCommit AS firstCommit,
110118
l365.starsLast365Days AS starsLast365Days,
111119
l365.forksLast365Days AS forksLast365Days,

0 commit comments

Comments
 (0)