Skip to content

Commit 8c8ab13

Browse files
authored
feat: add status to insight project (#3917)
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
1 parent 5b6ba59 commit 8c8ab13

4 files changed

Lines changed: 13 additions & 4 deletions

File tree

services/libs/tinybird/datasources/project_insights_copy_ds.datasource

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ DESCRIPTION >
2929
- `forksPrevious365Days` column is the count of forks in the previous 365 days (365-730 days ago).
3030
- `activeContributorsPrevious365Days` column is the unique count of active contributors in the previous 365 days (365-730 days ago).
3131
- `activeOrganizationsPrevious365Days` column is the unique count of active organizations in the previous 365 days (365-730 days ago).
32+
- `status` column is the current status of the project (e.g., 'active', 'archived').
3233

3334
TAGS "Project insights", "Metrics"
3435

@@ -38,6 +39,7 @@ SCHEMA >
3839
`slug` String,
3940
`logoUrl` String,
4041
`isLF` UInt8,
42+
`status` String,
4143
`contributorCount` UInt64,
4244
`organizationCount` UInt64,
4345
`softwareValue` UInt64,

services/libs/tinybird/pipes/health_score_retention.pipe

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ SQL >
3131
SELECT segmentId, groupUniqArray(memberId) AS currentQuarterMembers
3232
FROM activityRelations_deduplicated_cleaned_bucket_union
3333
WHERE
34-
memberId != '' AND channel NOT IN (SELECT channel FROM repos_to_channels_excluded)
34+
memberId != ''
35+
AND channel NOT IN (SELECT channel FROM repos_to_channels_excluded)
3536
AND (type, platform) IN (SELECT activityType, platform FROM activityTypes_filtered)
3637
{% if defined(endDate) %}
3738
AND timestamp >= toStartOfQuarter(
@@ -85,7 +86,8 @@ SQL >
8586
SELECT segmentId, groupUniqArray(memberId) AS previousQuarterMembers
8687
FROM activityRelations_deduplicated_cleaned_bucket_union
8788
WHERE
88-
memberId != '' AND channel NOT IN (SELECT channel FROM repos_to_channels_excluded)
89+
memberId != ''
90+
AND channel NOT IN (SELECT channel FROM repos_to_channels_excluded)
8991
AND (type, platform) IN (SELECT activityType, platform FROM activityTypes_filtered)
9092
{% if defined(endDate) %}
9193
AND timestamp >= toStartOfQuarter(

services/libs/tinybird/pipes/project_insights.pipe

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ DESCRIPTION >
1212
- `pageSize`: Optional integer for result limit, defaults to 10
1313
- `page`: Optional integer for pagination offset calculation, defaults to 0
1414
- Response: Project records with all insights metrics including achievements as array of (leaderboardType, rank, totalCount) tuples
15-
TAGS ""Insights, Widget", "Project""
15+
16+
TAGS "Insights, Widget", "Project"
1617

1718
NODE project_insights_endpoint
1819
SQL >
@@ -23,6 +24,7 @@ SQL >
2324
slug,
2425
logoUrl,
2526
isLF,
27+
status,
2628
contributorCount,
2729
organizationCount,
2830
softwareValue,

services/libs/tinybird/pipes/project_insights_copy.pipe

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ SQL >
1010
segmentId,
1111
logoUrl,
1212
isLF,
13+
status,
1314
contributorCount,
1415
organizationCount,
1516
softwareValue,
@@ -23,6 +24,7 @@ SQL >
2324
segmentId,
2425
logoUrl,
2526
isLF,
27+
status,
2628
contributorCount,
2729
organizationCount,
2830
softwareValue,
@@ -101,6 +103,7 @@ SQL >
101103
base.slug AS slug,
102104
base.logoUrl AS logoUrl,
103105
base.isLF AS isLF,
106+
base.status AS status,
104107
base.contributorCount AS contributorCount,
105108
base.organizationCount AS organizationCount,
106109
base.softwareValue AS softwareValue,
@@ -132,4 +135,4 @@ SQL >
132135
TYPE COPY
133136
TARGET_DATASOURCE project_insights_copy_ds
134137
COPY_MODE replace
135-
COPY_SCHEDULE 0 2 * * *
138+
COPY_SCHEDULE 0 3 * * *

0 commit comments

Comments
 (0)