fix(review): thread the reputation-skip check from caller to callee instead of re-deriving it (#4507) - #4592
Conversation
…nstead of re-deriving it (#4507) shouldStartAiReviewForAdvisory and runAiReviewForAdvisory each independently called shouldSkipAiForReputation for the same (repo, submitter) within one webhook-processing pass, doubling a bounded but real review_targets scan. The outer caller now computes it once and threads the result through both, falling back to a fresh check whenever a per-repo manifest override disagrees with the allowlist so neither call is ever forced into the wrong outcome.
|
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 #4592 +/- ##
=======================================
Coverage 94.12% 94.12%
=======================================
Files 430 430
Lines 38177 38180 +3
Branches 13920 13922 +2
=======================================
+ Hits 35935 35938 +3
Misses 1585 1585
Partials 657 657
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-10 06:54:07 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 5 non-blocking
Linked issue satisfactionAddressed 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.
|
Summary
shouldStartAiReviewForAdvisoryandrunAiReviewForAdvisoryeach independently calledshouldSkipAiForReputationfor the same(repo, submitter)within a single webhook-processing pass — a bounded but real duplicatereview_targetsscan (up toREPUTATION_WINDOW_ROW_CAP = 500rows) on every reputation-enabled, allowlisted repo.maybePublishPrPublicSurface) now computespreComputedReputationSkiponce, under the exact gate conditionshouldStartAiReviewForAdvisoryuses internally, and threads it into both functions — mirroring the existingpreAcquiredAiReviewLockthreading pattern in the same file..gittensory.ymlmanifest override disagrees with theGITTENSORY_REVIEW_REPOSallowlist (only one of the two call sites' gates evaluates true in that case, so the other's threaded value was never computed to begin with). Two regression tests specifically cover both divergence directions, proving the fix never forces a skip (or forces a run) that the two gates would have legitimately disagreed on.Closes #4507.
Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #4507).Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally — every changed line and branch insrc/queue/processors.tsis covered (confirmed via preciselcov.infocross-referencing against the exact diff hunks: zero uncovered lines, zero zero-hit branch sides).npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateagent-regate-prpipeline test proving the real outer-caller-scope computation itself is exercised (not just the two consumer functions called directly) — all four empirically verified to fail without their respective fix and pass with it, including one that caught an initially-wrong?? falsefallback during development.Safety
UI Evidencesection below. (N/A — backend-only change, no visible UI.)