Skip to content

fix: active contributors maintainers count (IN-1175)#4226

Open
joanagmaia wants to merge 14 commits into
mainfrom
fix/IN-1175-active-contributors-maintainers-count
Open

fix: active contributors maintainers count (IN-1175)#4226
joanagmaia wants to merge 14 commits into
mainfrom
fix/IN-1175-active-contributors-maintainers-count

Conversation

@joanagmaia

@joanagmaia joanagmaia commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

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:

  • Changed the deduplication logic in maintainers_roles_copy.pipe to select the most recent memberId per id using argMax, ensuring only the latest identity is used.
  • Updated the maintainer count in active_contributors.pipe to count only non-empty memberId values and to include only roles explicitly marked as 'maintainer', improving accuracy.

Refinement to date filtering:

  • Modified the fallback end date in active_contributors.pipe to 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 use uniqIf to drop empty memberId values, restrict rows to role = 'maintainer', and when no date range is passed use now() 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 → memberId mapping no longer relies on a simple FINAL read; it picks the latest (memberId, deletedAt) per identity id via argMax on updatedAt, 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.

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>
Copilot AI review requested due to automatic review settings June 17, 2026 09:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ 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 memberIdentities by id using argMax(memberId, updatedAt) to select the latest linked member.
  • Refine maintainerCount to exclude empty memberId values and include only role = 'maintainer'.
  • Change the “missing startDate” overlap fallback for maintainer endDate filtering to use now() (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.

Comment thread services/libs/tinybird/pipes/active_contributors.pipe Outdated
Comment thread services/libs/tinybird/pipes/active_contributors.pipe
Comment thread services/libs/tinybird/pipes/maintainers_roles_copy.pipe Outdated
Comment thread services/libs/tinybird/pipes/active_contributors.pipe
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
Copilot AI review requested due to automatic review settings June 17, 2026 09:52
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ 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.

Comment thread services/libs/tinybird/pipes/maintainers_roles_copy.pipe Outdated
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
Copilot AI review requested due to automatic review settings June 17, 2026 10:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ 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.

Comment thread services/libs/tinybird/pipes/maintainers_roles_copy.pipe
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
Comment thread services/libs/tinybird/pipes/active_contributors.pipe
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
Copilot AI review requested due to automatic review settings June 17, 2026 10:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ 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.

Comment thread services/libs/tinybird/pipes/maintainers_roles_copy.pipe Outdated
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
Copilot AI review requested due to automatic review settings June 17, 2026 10:50
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ 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.

Comment thread services/libs/tinybird/pipes/active_contributors.pipe
Comment thread services/libs/tinybird/pipes/maintainers_roles_copy.pipe
@joanagmaia joanagmaia requested a review from gaspergrom June 17, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants