From 6beaaa3d3669ab2447178eced56129d837eb3b94 Mon Sep 17 00:00:00 2001 From: Caio Fonseca Date: Mon, 28 Sep 2026 22:59:39 +0100 Subject: [PATCH] fix: prevent Cartesian product in contributor metrics Signed-off-by: Caio Fonseca --- collectoss/api/metrics/contributor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/collectoss/api/metrics/contributor.py b/collectoss/api/metrics/contributor.py index 4dbc35e8f..2df5ca759 100644 --- a/collectoss/api/metrics/contributor.py +++ b/collectoss/api/metrics/contributor.py @@ -93,7 +93,7 @@ def contributors(repo_group_id, repo_id=None, period='day', begin_date=None, end FROM commit_comment_ref, commits, message - WHERE commit_comment_ref.cmt_id = commit_comment_ref.cmt_id + WHERE commits.cmt_id = commit_comment_ref.cmt_id AND message.msg_id = commit_comment_ref.msg_id AND commits.repo_id = :repo_id AND created_at BETWEEN :begin_date AND :end_date @@ -180,7 +180,7 @@ def contributors(repo_group_id, repo_id=None, period='day', begin_date=None, end FROM commit_comment_ref, commits, message - WHERE commit_comment_ref.cmt_id = commit_comment_ref.cmt_id + WHERE commits.cmt_id = commit_comment_ref.cmt_id AND message.msg_id = commit_comment_ref.msg_id AND commits.repo_id in (SELECT repo_id FROM repo WHERE repo_group_id=:repo_group_id) AND created_at BETWEEN :begin_date AND :end_date