|
1 | 1 | DESCRIPTION > |
2 | 2 | Nightly copy pipe that precomputes org-level KPIs for the org page. |
3 | 3 | Writes one row per organizationId into org_page_kpis_copy_ds. |
| 4 | + Active contributors counts only code contribution activity types (commits, PRs, code reviews). |
4 | 5 | Active contributors and critical projects use a 730-day (2-year) window. |
5 | 6 | Trend compares current 730-day period against the prior 730-day period (days 731–1460). |
6 | 7 |
|
7 | 8 | TAGS "Organization page" |
8 | 9 |
|
| 10 | +NODE org_page_kpis_code_activity_types |
| 11 | +DESCRIPTION > |
| 12 | + Code contribution activity types only |
| 13 | + |
| 14 | +SQL > |
| 15 | + SELECT activityType, platform FROM activityTypes FINAL WHERE isCodeContribution |
| 16 | + |
9 | 17 | NODE org_page_kpis_current_contributors |
10 | 18 | DESCRIPTION > |
11 | | - Active contributors per org in the last 730 days (2 years) |
| 19 | + Active code contributors per org in the last 730 days (2 years) |
12 | 20 |
|
13 | 21 | SQL > |
14 | | - SELECT organizationId, uniq(memberId) AS activeContributors |
15 | | - FROM activityRelations_deduplicated_cleaned_bucket_union |
| 22 | + SELECT ar.organizationId, uniq(ar.memberId) AS activeContributors |
| 23 | + FROM activityRelations_deduplicated_cleaned_bucket_union ar |
| 24 | + INNER JOIN |
| 25 | + org_page_kpis_code_activity_types at |
| 26 | + ON ar.type = at.activityType |
| 27 | + AND ar.platform = at.platform |
16 | 28 | WHERE |
17 | | - organizationId != '' |
18 | | - AND timestamp >= toStartOfDay(now() - toIntervalDay(730)) |
19 | | - AND timestamp < toStartOfDay(now() + toIntervalDay(1)) |
20 | | - GROUP BY organizationId |
| 29 | + ar.organizationId != '' |
| 30 | + AND ar.timestamp >= toStartOfDay(now() - toIntervalDay(730)) |
| 31 | + AND ar.timestamp < toStartOfDay(now() + toIntervalDay(1)) |
| 32 | + GROUP BY ar.organizationId |
21 | 33 |
|
22 | 34 | NODE org_page_kpis_previous_contributors |
23 | 35 | DESCRIPTION > |
24 | | - Active contributors per org in the prior 730-day window (days 731–1460, for trend calc) |
| 36 | + Active code contributors per org in the prior 730-day window (days 731–1460, for trend calc) |
25 | 37 |
|
26 | 38 | SQL > |
27 | | - SELECT organizationId, uniq(memberId) AS activeContributorsPrevious |
28 | | - FROM activityRelations_deduplicated_cleaned_bucket_union |
| 39 | + SELECT ar.organizationId, uniq(ar.memberId) AS activeContributorsPrevious |
| 40 | + FROM activityRelations_deduplicated_cleaned_bucket_union ar |
| 41 | + INNER JOIN |
| 42 | + org_page_kpis_code_activity_types at |
| 43 | + ON ar.type = at.activityType |
| 44 | + AND ar.platform = at.platform |
29 | 45 | WHERE |
30 | | - organizationId != '' |
31 | | - AND timestamp >= toStartOfDay(now() - toIntervalDay(1460)) |
32 | | - AND timestamp < toStartOfDay(now() - toIntervalDay(730)) |
33 | | - GROUP BY organizationId |
| 46 | + ar.organizationId != '' |
| 47 | + AND ar.timestamp >= toStartOfDay(now() - toIntervalDay(1460)) |
| 48 | + AND ar.timestamp < toStartOfDay(now() - toIntervalDay(730)) |
| 49 | + GROUP BY ar.organizationId |
34 | 50 |
|
35 | 51 | NODE org_page_kpis_maintainer_roles |
36 | 52 | DESCRIPTION > |
|
0 commit comments