Skip to content

Commit 5cbe39a

Browse files
prontclaude
andcommitted
Exclude current incomplete month from contributor_monthly
export_contributor_monthly was grouping by month with no upper bound, so for a fresh fetch mid-month the rightmost cell carried partial data and made recent activity look misleadingly low. Apply the same HAVING month < current_month guard already used by export_monthly_summary so both summaries treat "complete months" the same way. Surfaced while rendering the first quickwit heatmap on 2026-05-19 — the 2026-05 column showed half-month counts next to full months. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3ddc319 commit 5cbe39a

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/commands/generate_summaries.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,13 +327,15 @@ fn export_contributor_monthly(
327327
exclude_labels: Option<&[String]>,
328328
) -> Result<()> {
329329
let (wc, params) = build_where(table, exclude_labels, &["user_login IS NOT NULL"]);
330+
let current_month = Utc::now().format("%Y-%m").to_string();
330331
let query = format!(
331332
"SELECT substr({table}.created_at, 1, 7) AS month,
332333
{table}.user_login AS user_login,
333334
COUNT(*) AS count
334335
FROM {table}
335336
{wc}
336337
GROUP BY month, user_login
338+
HAVING month < '{current_month}'
337339
ORDER BY month, count DESC"
338340
);
339341
write_query_to_csv(

0 commit comments

Comments
 (0)