fix(stats): scope reuse trend to public repos - #4991
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4991 +/- ##
=======================================
Coverage 94.31% 94.31%
=======================================
Files 454 454
Lines 39034 39037 +3
Branches 14234 14235 +1
=======================================
+ Hits 36813 36816 +3
Misses 1572 1572
Partials 649 649
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - fixes requiredReview updated: 2026-07-11 13:49:04 UTC
🛑 Suggested Action - Manual Review
Review summary Nits — 4 non-blocking
Why this is blocked
CI checks failing
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Motivation
/v1/public/statspayload by stopping global aggregation of auditgithub_app.*_cache_*and ai_review reuse events that could include private/non-allowlisted repos.Description
publicStatsProjectsfromsrc/review/public-stats.tsand thread the parsed allowlist into the reuse-rate loader.audit_eventsquery by the parsedtarget_keyrepo (handles bothowner/repoandowner/repo#numbershapes) and skip querying when the allowlist is empty.loadReuseRateDayRowssignature to acceptprojects: string[]and return an empty array when the allowlist is empty, preserving the fail-safe behavior.test/unit/public-reuse-rate-trend.test.tsto verify: allowlisted events are counted, non-allowlisted events are excluded, and the empty-allowlist case returns all-zero buckets.Testing
npm run typecheck, which succeeded.npx vitest run test/unit/public-reuse-rate-trend.test.ts, which passed.npm run build:miner) and ran the public-stats integration route testsnpx vitest run test/integration/public-stats-route.test.ts, which passed.npm run test:coverage, but the full run did not complete in this environment due to long-running/unrelated queue/watchdog tests; the specific regression/unit and integration tests validating this change passed as noted above.Codex Task