Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ DESCRIPTION >
- Only includes issues that have been closed (`isNotNull(closedAt)`) to ensure accurate velocity calculations.
- Queries `issues_analyzed` directly for optimal performance using sorting key on `segmentId, channel, openedAt`.
- Primary use case: displaying average issue resolution time metrics in development health dashboards.
- The pipe scopes data either to a single project (via `segments_filtered`) or to every project in a
collection (via `segments_filtered_by_collection`). Exactly one of `project`/`collectionSlug` must be given.
- Parameters:
- `project`: Required string for project slug (e.g., 'k8s', 'tensorflow') - inherited from `segments_filtered`
- `project`: Project slug (e.g., 'k8s', 'tensorflow') - inherited from `segments_filtered`. Required unless `collectionSlug` is given.
- `collectionSlug`: Collection slug (e.g., 'cncf') - inherited from `segments_filtered_by_collection`. Required unless `project` is given.
- `repos`: Optional array of repository URLs for filtering (e.g., ['https://github.com/kubernetes/kubernetes'])
- `startDate`: Optional DateTime filter for issues opened after timestamp (e.g., '2024-01-01 00:00:00')
- `endDate`: Optional DateTime filter for issues opened before timestamp (e.g., '2024-12-31 23:59:59')
Expand All @@ -17,7 +20,10 @@ SQL >
SELECT round(avg(closedInSeconds)) AS "averageIssueResolveVelocitySeconds"
FROM issues_analyzed
WHERE
segmentId = (SELECT segmentId FROM segments_filtered) AND isNotNull(closedAt)
{% if defined(collectionSlug) %}
segmentId IN (SELECT segmentId FROM segments_filtered_by_collection)
{% else %} segmentId = (SELECT segmentId FROM segments_filtered)
{% end %} AND isNotNull(closedAt)
{% if defined(repos) %}
AND channel
IN {{ Array(repos, 'String', description="Filter activity repo list", required=False) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ DESCRIPTION >
- Excludes Gerrit platform as it uses a different workflow model.
- Queries `pull_requests_analyzed` directly for optimal performance using sorting key on `segmentId, channel, openedAt`.
- Primary use case: displaying average PR resolution time metrics in development health dashboards.
- The pipe scopes data either to a single project (via `segments_filtered`) or to every project in a
collection (via `segments_filtered_by_collection`). Exactly one of `project`/`collectionSlug` must be given.
- Parameters:
- `project`: Required string for project slug (e.g., 'k8s', 'tensorflow') - inherited from `segments_filtered`
- `project`: Project slug (e.g., 'k8s', 'tensorflow') - inherited from `segments_filtered`. Required unless `collectionSlug` is given.
- `collectionSlug`: Collection slug (e.g., 'cncf') - inherited from `segments_filtered_by_collection`. Required unless `project` is given.
- `repos`: Optional array of repository URLs for filtering (e.g., ['https://github.com/kubernetes/kubernetes'])
- `startDate`: Optional DateTime filter for PRs opened after timestamp (e.g., '2024-01-01 00:00:00')
- `endDate`: Optional DateTime filter for PRs opened before timestamp (e.g., '2024-12-31 23:59:59')
Expand All @@ -18,10 +21,10 @@ SQL >
SELECT round(avg(resolvedInSeconds)) AS "averagePullRequestResolveVelocitySeconds"
FROM pull_requests_analyzed
WHERE
segmentId = (SELECT segmentId FROM segments_filtered)
AND isNotNull(resolvedAt)
AND resolvedInSeconds > 0
AND platform != 'gerrit'
{% if defined(collectionSlug) %}
segmentId IN (SELECT segmentId FROM segments_filtered_by_collection)
{% else %} segmentId = (SELECT segmentId FROM segments_filtered)
{% end %} AND isNotNull(resolvedAt) AND resolvedInSeconds > 0 AND platform != 'gerrit'
{% if defined(repos) %}
AND channel
IN {{ Array(repos, 'String', description="Filter activity repo list", required=False) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@ SQL >

NODE repositories_populated_copy_contributor_org_counts
DESCRIPTION >
Calculate contributor and organization counts per repository (channel)
Calculate contributor and organization counts per repository (channel).
Excludes 'star' and 'fork' activity: stargazers/forkers are engagement, not contributors,
and counting them inflated contributorCount massively for popular repos (e.g. OpenClaw showed
483K where the true contributor count is ~46K - 404K of those were stargazers). This mirrors
the "contributions only" semantics the widget pipes use via onlyContributions/activityTypes_filtered.

SQL >
SELECT
channel,
uniq(CASE WHEN memberId != '' THEN memberId ELSE NULL END) AS contributorCount,
uniq(CASE WHEN organizationId != '' THEN organizationId ELSE NULL END) AS organizationCount
FROM activityRelations_deduplicated_cleaned_bucket_union
WHERE type NOT IN ('star', 'fork')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomplete contributor activity type filter

Medium Severity

Repo contributorCount and organizationCount now exclude only star and fork activities. Pipes that define contributors on activityRelations_deduplicated_cleaned_bucket_union are expected to restrict rows to code and collaboration activity types via activityTypes, not a short denylist. Members with only other non-contribution activity (e.g. reactions or membership events) can still inflate counts relative to widgets and collection_insights_aggregate.

Fix in Cursor Fix in Web

Triggered by learned rule: Tinybird pipes counting contributors must filter by activityTypes

Reviewed by Cursor Bugbot for commit 6664f5e. Configure here.

GROUP BY channel

NODE repositories_populated_copy_first_commit
Expand Down
Loading