fix: active contributors maintainers count (IN-1175)#4226
Conversation
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
…ntributors-maintainers-count Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
There was a problem hiding this comment.
⚠️ Not ready to approve
There are critical correctness issues in the updated Tinybird logic (soft-delete handling in memberIdentities dedup and date-overlap fallback semantics) that can undercount/overcount maintainers depending on data and provided parameters.
Pull request overview
This PR adjusts Tinybird analytics pipes to improve maintainer / active contributor counting accuracy by (1) deduplicating identities to the latest memberId, (2) tightening the maintainer-count filter to explicit maintainer roles and non-empty member IDs, and (3) updating date-range fallback behavior.
Changes:
- Deduplicate
memberIdentitiesbyidusingargMax(memberId, updatedAt)to select the latest linked member. - Refine
maintainerCountto exclude emptymemberIdvalues and include onlyrole = 'maintainer'. - Change the “missing startDate” overlap fallback for maintainer
endDatefiltering to usenow()(but see review comment: this currently breaks the “only endDate provided” case).
File summaries
| File | Description |
|---|---|
| services/libs/tinybird/pipes/maintainers_roles_copy.pipe | Changes identity-to-member deduplication to pick the most recent memberId per identity id. |
| services/libs/tinybird/pipes/active_contributors.pipe | Updates maintainer counting to exclude empty member IDs, filters to maintainer role, and adjusts overlap date fallback logic. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 3
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
There was a problem hiding this comment.
⚠️ Not ready to approve
A derived-table subquery in maintainers_roles_copy.pipe lacks an explicit alias, which is inconsistent with existing Tinybird SQL patterns in the repo and may break in environments that require aliases.
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 1
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
There was a problem hiding this comment.
⚠️ Not ready to approve
The new dedup query can return a memberId and deletedAt from different source rows under updatedAt ties, risking incorrect maintainer identity resolution.
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 1
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
There was a problem hiding this comment.
⚠️ Not ready to approve
The updated argMax(... ) .1/.2 tuple-field syntax in maintainers_roles_copy.pipe appears invalid as written (space before .1/.2) and would likely break the pipe compilation/execution.
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 1
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fecb80d. Configure here.

This pull request updates the logic in the Tinybird pipes related to maintainers and active contributors. The main focus is on improving the accuracy of maintainer counts and deduplication, as well as refining date filtering for contributor activity.
Improvements to maintainer deduplication and counting:
maintainers_roles_copy.pipeto select the most recentmemberIdperidusingargMax, ensuring only the latest identity is used.active_contributors.pipeto count only non-emptymemberIdvalues and to include only roles explicitly marked as 'maintainer', improving accuracy.Refinement to date filtering:
active_contributors.pipeto use the current timestamp (now()) instead of a fixed historical date, ensuring more relevant filtering for active maintainers.Note
Low Risk
Analytics-only Tinybird pipe changes that correct deduplication and filters; no auth, writes, or application runtime paths are affected.
Overview
Fixes inflated or wrong maintainer counts on the active contributors widget by tightening how maintainers are resolved and counted in Tinybird.
In
active_contributors.pipe, maintainer totals now useuniqIfto drop emptymemberIdvalues, restrict rows torole = 'maintainer', and when no date range is passed usenow()for the open-ended tenure window instead of falling back to the 1970 sentinel so “currently active” maintainers match expectations.In
maintainers_roles_copy.pipe, member identity →memberIdmapping no longer relies on a simpleFINALread; it picks the latest(memberId, deletedAt)per identityidviaargMaxonupdatedAt, so stale or reassigned identities don’t double-count or attach the wrong member to maintainer roles.Reviewed by Cursor Bugbot for commit d70c4a3. Bugbot is set up for automated code reviews on this repo. Configure here.