diff --git a/services/libs/tinybird/pipes/leaderboards_avg_commits_per_author.pipe b/services/libs/tinybird/pipes/leaderboards_avg_commits_per_author.pipe index f542e392b8..bd2b39193c 100644 --- a/services/libs/tinybird/pipes/leaderboards_avg_commits_per_author.pipe +++ b/services/libs/tinybird/pipes/leaderboards_avg_commits_per_author.pipe @@ -38,11 +38,11 @@ SQL > CAST(coalesce(c.commits, 0) AS Float64) / CAST(coalesce(c.unique_authors, 1) AS Float64) DESC ) as rank, - p.id, - p.segmentId, - p.name, - p.slug, - p.logoUrl, + p.id as id, + p.segmentId as segmentId, + p.name as name, + p.slug as slug, + p.logoUrl as logoUrl, (coalesce(c.commits, 0) / coalesce(c.unique_authors, 1)) as value FROM leaderboards_avg_commits_per_author_projects p INNER JOIN leaderboards_avg_commits_per_author_activities c ON p.segmentId = c.segmentId diff --git a/services/libs/tinybird/pipes/leaderboards_codebase_size.pipe b/services/libs/tinybird/pipes/leaderboards_codebase_size.pipe index b22bd6f6ec..fc1237b0aa 100644 --- a/services/libs/tinybird/pipes/leaderboards_codebase_size.pipe +++ b/services/libs/tinybird/pipes/leaderboards_codebase_size.pipe @@ -29,14 +29,14 @@ DESCRIPTION > SQL > SELECT - row_number() OVER (ORDER BY coalesce(o.linesChanged, 0) DESC) as rank, - p.id, - p.segmentId, - p.name, - p.slug, - p.logoUrl, - CAST(coalesce(o.linesChanged, 0) as Float64) as value + row_number() OVER (ORDER BY coalesce(o.lineDifference, 0) DESC) as rank, + p.id as id, + p.segmentId as segmentId, + p.name as name, + p.slug as slug, + p.logoUrl as logoUrl, + CAST(coalesce(o.lineDifference, 0) as Float64) as value FROM leaderboards_codebase_size_projects p INNER JOIN leaderboards_codebase_size_activities o ON p.segmentId = o.segmentId - WHERE o.linesChanged > 0 + WHERE o.lineDifference > 0 ORDER BY value DESC diff --git a/services/libs/tinybird/pipes/leaderboards_commits.pipe b/services/libs/tinybird/pipes/leaderboards_commits.pipe index 39f6932f65..a84339b5bf 100644 --- a/services/libs/tinybird/pipes/leaderboards_commits.pipe +++ b/services/libs/tinybird/pipes/leaderboards_commits.pipe @@ -17,13 +17,13 @@ DESCRIPTION > Counts total git commits for each project in the last 12 months SQL > - SELECT segmentId, count(activityId) as commits + SELECT segmentId, count() as commits FROM activityRelations_deduplicated_cleaned_ds WHERE timestamp >= now() - INTERVAL 12 MONTH AND timestamp < now() AND activityId != '' - AND (type = 'authored-commit' OR type = 'committed-commit') + AND type = 'authored-commit' AND platform = 'git' GROUP BY segmentId @@ -38,7 +38,7 @@ SQL > timestamp >= now() - INTERVAL 24 MONTH AND timestamp < now() - INTERVAL 12 MONTH AND activityId != '' - AND (type = 'authored-commit' OR type = 'committed-commit') + AND type = 'authored-commit' AND platform = 'git' GROUP BY segmentId @@ -49,11 +49,11 @@ DESCRIPTION > SQL > SELECT row_number() OVER (ORDER BY coalesce(o.commits, 0) DESC) as rank, - p.id, - p.segmentId, - p.name, - p.slug, - p.logoUrl, + p.id as id, + p.segmentId as segmentId, + p.name as name, + p.slug as slug, + p.logoUrl as logoUrl, cast(coalesce(o.commits, 0) as Float64) as value, cast(coalesce(pp.commits, 0) as Float64) as previousPeriodValue FROM leaderboards_commits_projects p diff --git a/services/libs/tinybird/pipes/leaderboards_copy.pipe b/services/libs/tinybird/pipes/leaderboards_copy.pipe index cd984c7bef..52aeec6418 100644 --- a/services/libs/tinybird/pipes/leaderboards_copy.pipe +++ b/services/libs/tinybird/pipes/leaderboards_copy.pipe @@ -8,9 +8,6 @@ DESCRIPTION > Unions all leaderboard results with their respective type identifiers for consolidated querying SQL > - SELECT *, 0.0 as previousPeriodValue, 'longest-running' as leaderboardType - FROM leaderboards_project_first_commit - UNION ALL SELECT *, 'active-contributors' as leaderboardType FROM leaderboards_project_active_contributors UNION ALL diff --git a/services/libs/tinybird/pipes/leaderboards_issue_response.pipe b/services/libs/tinybird/pipes/leaderboards_issue_response.pipe index 179e4831dd..df9af6a76c 100644 --- a/services/libs/tinybird/pipes/leaderboards_issue_response.pipe +++ b/services/libs/tinybird/pipes/leaderboards_issue_response.pipe @@ -50,11 +50,11 @@ DESCRIPTION > SQL > SELECT row_number() OVER (ORDER BY coalesce(o.averageResponseTimeSeconds, 0) ASC) as rank, - p.id, + p.id as id, p.segmentId as segmentId, - p.name, - p.slug, - p.logoUrl, + p.name as name, + p.slug as slug, + p.logoUrl as logoUrl, coalesce(o.averageResponseTimeSeconds, 0) as value, coalesce(pp.averageResponseTimeSeconds, 0) as previousPeriodValue FROM leaderboards_issue_response_projects p diff --git a/services/libs/tinybird/pipes/leaderboards_merge_time.pipe b/services/libs/tinybird/pipes/leaderboards_merge_time.pipe index 86eafae3a0..0e72f859ec 100644 --- a/services/libs/tinybird/pipes/leaderboards_merge_time.pipe +++ b/services/libs/tinybird/pipes/leaderboards_merge_time.pipe @@ -45,11 +45,11 @@ DESCRIPTION > SQL > SELECT row_number() OVER (ORDER BY coalesce(o.averageMergeTimeSeconds, 0) ASC) as rank, - p.id, + p.id as id, p.segmentId as segmentId, - p.name, - p.slug, - p.logoUrl, + p.name as name, + p.slug as slug, + p.logoUrl as logoUrl, cast(coalesce(o.averageMergeTimeSeconds, 0) as Float64) as value, cast(coalesce(pp.averageMergeTimeSeconds, 0) as Float64) as previousPeriodValue FROM leaderboards_merge_time_projects p diff --git a/services/libs/tinybird/pipes/leaderboards_project_active_contributors.pipe b/services/libs/tinybird/pipes/leaderboards_project_active_contributors.pipe index fe646ae701..3bc89569ad 100644 --- a/services/libs/tinybird/pipes/leaderboards_project_active_contributors.pipe +++ b/services/libs/tinybird/pipes/leaderboards_project_active_contributors.pipe @@ -54,11 +54,11 @@ DESCRIPTION > SQL > SELECT row_number() OVER (ORDER BY coalesce(c.contributor_count, 0) DESC) as rank, - p.id, - p.segmentId, - p.name, - p.slug, - p.logoUrl, + p.id as id, + p.segmentId as segmentId, + p.name as name, + p.slug as slug, + p.logoUrl as logoUrl, cast(coalesce(c.contributor_count, 0) as Float64) as value, cast(coalesce(pp.contributor_count, 0) as Float64) as previousPeriodValue FROM leaderboards_project_active_contributors_projects p diff --git a/services/libs/tinybird/pipes/leaderboards_project_active_organizations.pipe b/services/libs/tinybird/pipes/leaderboards_project_active_organizations.pipe index 494144e7a2..efc40b08f9 100644 --- a/services/libs/tinybird/pipes/leaderboards_project_active_organizations.pipe +++ b/services/libs/tinybird/pipes/leaderboards_project_active_organizations.pipe @@ -54,11 +54,11 @@ DESCRIPTION > SQL > SELECT row_number() OVER (ORDER BY coalesce(o.organization_count, 0) DESC) as rank, - p.id, - p.segmentId, - p.name, - p.slug, - p.logoUrl, + p.id as id, + p.segmentId as segmentId, + p.name as name, + p.slug as slug, + p.logoUrl as logoUrl, cast(coalesce(o.organization_count, 0) as Float64) as value, cast(coalesce(pp.organization_count, 0) as Float64) as previousPeriodValue FROM leaderboards_project_active_organizations_projects p diff --git a/services/libs/tinybird/pipes/leaderboards_project_first_commit.pipe b/services/libs/tinybird/pipes/leaderboards_project_first_commit.pipe deleted file mode 100644 index 6d380f5897..0000000000 --- a/services/libs/tinybird/pipes/leaderboards_project_first_commit.pipe +++ /dev/null @@ -1,29 +0,0 @@ -DESCRIPTION > - Leaderboard ranking projects by longest running (earliest first commit). Identifies projects - that have been around the longest, ranked by the earliest recorded commit timestamp. - -NODE leaderboards_project_first_commit_projects -DESCRIPTION > - Retrieves all projects with their first commit timestamp - -SQL > - SELECT id, name, slug, segmentId, firstCommit, logoUrl - FROM insights_projects_populated_ds - GROUP BY id, name, slug, segmentId, firstCommit, logoUrl - -NODE leaderboards_copy_first_commit -DESCRIPTION > - Ranks projects by earliest first commit date, converting timestamp to unix milliseconds - -SQL > - SELECT - row_number() OVER (ORDER BY firstCommit ASC) as rank, - id, - segmentId, - name, - slug, - logoUrl, - CAST(toUnixTimestamp64Milli(firstCommit) AS Float64) as value - FROM leaderboards_project_first_commit_projects - WHERE firstCommit IS NOT NULL - ORDER BY firstCommit ASC diff --git a/services/libs/tinybird/pipes/leaderboards_resolution_rate.pipe b/services/libs/tinybird/pipes/leaderboards_resolution_rate.pipe index ecd56c7192..a54dd555e3 100644 --- a/services/libs/tinybird/pipes/leaderboards_resolution_rate.pipe +++ b/services/libs/tinybird/pipes/leaderboards_resolution_rate.pipe @@ -26,11 +26,11 @@ NODE leaderboards_resolution_rate_results SQL > SELECT row_number() OVER (ORDER BY resolutionRate DESC) as rank, - p.id, - p.segmentId, - p.name, - p.slug, - p.logoUrl, + p.id as id, + p.segmentId as segmentId, + p.name as name, + p.slug as slug, + p.logoUrl as logoUrl, c.resolutionRate as value FROM leaderboards_resolution_rate_projects p INNER JOIN leaderboards_resolution_rate_activities c ON p.segmentId = c.segmentId diff --git a/services/libs/tinybird/pipes/leaderboards_small_project_commit.pipe b/services/libs/tinybird/pipes/leaderboards_small_project_commit.pipe index 2067d282ab..90f850d683 100644 --- a/services/libs/tinybird/pipes/leaderboards_small_project_commit.pipe +++ b/services/libs/tinybird/pipes/leaderboards_small_project_commit.pipe @@ -18,12 +18,9 @@ DESCRIPTION > Counts total git commits for each project SQL > - SELECT segmentId, count(activityId) as commits + SELECT segmentId, count() as commits FROM activityRelations_deduplicated_cleaned_ds - WHERE - activityId != '' - AND (type = 'authored-commit' OR type = 'committed-commit') - AND platform = 'git' + WHERE activityId != '' AND type = 'authored-commit' AND platform = 'git' GROUP BY segmentId NODE leaderboards_small_project_commit_results @@ -33,11 +30,11 @@ DESCRIPTION > SQL > SELECT row_number() OVER (ORDER BY coalesce(o.commits, 0) DESC) as rank, - p.id, - p.segmentId, - p.name, - p.slug, - p.logoUrl, + p.id as id, + p.segmentId as segmentId, + p.name as name, + p.slug as slug, + p.logoUrl as logoUrl, cast(coalesce(o.commits, 0) as Float64) as value FROM leaderboards_small_project_commit_projects p INNER JOIN leaderboards_small_project_commit_activities o ON p.segmentId = o.segmentId