fix(review): persist culture profile total count - #3957
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 #3957 +/- ##
=======================================
Coverage 93.66% 93.66%
=======================================
Files 372 372
Lines 34856 34857 +1
Branches 12743 12743
=======================================
+ Hits 32649 32650 +1
Misses 1588 1588
Partials 619 619
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-07 07:57:43 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 3 non-blocking
Concerns raised — review before merging
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
listRecentMergedPullRequests()which limits to 200 rows) while cache validation compared against the uncapped total (countRecentMergedPullRequests()), making caches permanently stale for repos with >200 merged PRs.signal_snapshotswrites under normal PR activity when the feature is enabled, increasing cost/storage pressure.Description
sampleCountAtGeneration = await countRecentMergedPullRequests(env, repoFullName)and passing it topersistCultureProfileinsrc/review/repo-culture-profile.tsso the writer and validator use the same basis for invalidation.test/unit/repo-culture-profile.test.tsthat seeds 201 merged PR records, verifies the derived profile uses the 200-row sample for statistics, and confirms a subsequent extraction reuses the cached snapshot (asserting only onesignal_snapshotsrow was created).Testing
npm run typecheckcompleted successfully with no type errors.npx vitest run test/unit/repo-culture-profile.test.tspassed and the new regression test (201-PR case) succeeded.npx vitest -t "reuses a fresh culture-profile cache") also passed.npm run test:coverage -- --run test/unit/repo-culture-profile.test.ts) executed the tests but coverage remapping failed withTypeError: jsTokens is not a functiondue to a local dependency resolution mismatch inast-v8-to-istanbul, andnpm audit --audit-level=moderatecould not complete in this environment (registry/auth error).Codex Task