feat: include private repo contributions in graph metrics

Aggregate graph endpoints (daily counts, language daily counts, source
summaries, OG image) now include private repository activity. These
endpoints only expose numeric counts — no commit messages, repo names,
or other metadata — so private details remain hidden. The activity
timeline continues to serve only public events.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-11 15:35:22 +03:00
parent f386e0b574
commit b41e8c330a
3 changed files with 13 additions and 11 deletions

View File

@@ -130,7 +130,7 @@ async fn list_sources(
) -> Result<Json<Vec<SourceSummary>>, ApiError> {
let summaries = state
.store
.source_summaries(/* include_private */ false)
.source_summaries(/* include_private */ true)
.await
.map_err(internal)?;
Ok(Json(summaries))
@@ -155,7 +155,7 @@ async fn daily_counts(
) -> Result<Json<Vec<DailyCount>>, ApiError> {
let to = params.to.unwrap_or_else(|| Utc::now().date_naive());
let from = params.from.unwrap_or_else(|| to - chrono::Duration::days(365));
let counts = state.store.daily_counts(from, to).await.map_err(internal)?;
let counts = state.store.daily_counts(from, to, /* include_private */ true).await.map_err(internal)?;
Ok(Json(counts))
}
@@ -165,7 +165,7 @@ async fn language_daily_counts(
) -> Result<Json<Vec<LanguageDailyCount>>, ApiError> {
let to = params.to.unwrap_or_else(|| Utc::now().date_naive());
let from = params.from.unwrap_or_else(|| to - chrono::Duration::days(365));
let counts = state.store.language_daily_counts(from, to).await.map_err(internal)?;
let counts = state.store.language_daily_counts(from, to, /* include_private */ true).await.map_err(internal)?;
Ok(Json(counts))
}
@@ -182,7 +182,7 @@ async fn og_contributions(
// Get date range from source summaries
let summaries = state
.store
.source_summaries(false)
.source_summaries(/* include_private */ true)
.await
.map_err(internal)?;
let earliest = summaries
@@ -195,7 +195,7 @@ async fn og_contributions(
let counts = state
.store
.daily_counts(earliest, today)
.daily_counts(earliest, today, /* include_private */ true)
.await
.map_err(internal)?;