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
2 changes: 1 addition & 1 deletion services/libs/tinybird/pipes/org_page_projects.pipe
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
DESCRIPTION >
Returns the list of projects an organization contributed to in the last 365 days,
Returns the list of projects an organization contributed to in the last 730 days (24 months),
read from the precomputed org_page_projects_copy_ds.

TAGS "Organization page"
Expand Down
9 changes: 5 additions & 4 deletions services/libs/tinybird/pipes/org_page_projects_copy_pipe.pipe
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
DESCRIPTION >
Nightly copy pipe that precomputes per-org per-project metrics for the org page.
Writes one row per (organizationId, segmentId) into org_page_projects_copy_ds.
Activity and contributor counts use code-only activity types over the last 730 days (24 months).

TAGS "Organization page"

Expand All @@ -9,11 +10,11 @@ DESCRIPTION >
Collaboration and code contribution activity types (mirrors leaderboards filter)

SQL >
SELECT activityType, platform FROM activityTypes FINAL WHERE isCollaboration OR isCodeContribution
SELECT activityType, platform FROM activityTypes FINAL WHERE isCodeContribution

NODE org_page_projects_org_segment_activity
DESCRIPTION >
Collaboration/code activity and contributor counts per org per project segment in the last 365 days
Code-only activity and contributor counts per org per project segment in the last 730 days (24 months)

SQL >
SELECT
Expand All @@ -25,7 +26,7 @@ SQL >
AND ar.platform = at.platform
WHERE
ar.organizationId != ''
AND ar.timestamp >= toStartOfDay(now() - toIntervalDay(365))
AND ar.timestamp >= toStartOfDay(now() - toIntervalDay(730))
AND ar.timestamp < toStartOfDay(now() + toIntervalDay(1))
GROUP BY ar.organizationId, ar.segmentId

Expand Down Expand Up @@ -138,7 +139,7 @@ SQL >
(
-- Maintainers: 3 pts if org has at least 1 active maintainer (24-month window)
-- Contributors: 0 if no share; 1.1 if share in (0, 0.1%]; share + 1.0 otherwise
CASE WHEN ifNull(mt.scoreMaintainersCount, 0) >= 1 THEN 3.0 ELSE 0.0 END + CASE
CASE WHEN ifNull(mt.scoreMaintainersCount, 0) >= 1 THEN 10.0 ELSE 0.0 END + CASE
WHEN
ifNull(pa.scoreContributorCount, 0) = 0
OR ifNull(oa.scoreOrgContributorCount, 0) = 0
Expand Down
Loading