fix(review): skip open-PR refresh for uninstalled registry repos in the regate sweep - #3797
Conversation
…s in the regate sweep The scheduled regate sweep refreshed open-PR data (via the shared GITHUB_PUBLIC_TOKEN) for every repo in the subnet registry, including repos with no installed GitHub App -- even though the per-PR re-review fan-out already skips these repos entirely. This burned real, shared REST budget on data no part of the sweep could use, and starved that same shared budget for installed repos processed later in the staggered per-repo dispatch.
|
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 #3797 +/- ##
=======================================
Coverage 93.33% 93.33%
=======================================
Files 317 317
Lines 32469 32470 +1
Branches 11904 11905 +1
=======================================
+ Hits 30305 30306 +1
Misses 1530 1530
Partials 634 634
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-06 11:04:02 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 4 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.
|
Summary
agent-regate-sweeprefreshed open-PR data via the sharedGITHUB_PUBLIC_TOKENfor every repo in the subnet registry (registry/sync.ts,isRegistered), including repos with no installed GitHub App at all. The per-PR re-review fan-out already skips uninstalled repos entirely (existing, unchanged behavior, covered by pre-existing tests), so this refresh was pure waste: it burned real, shared REST budget on data nothing downstream would use.installationId) were refreshing their open-PR lists on every sweep tick, draining the shared public-token budget. Combined with the sweep's staggered per-repo dispatch (delaySeconds = index * 10, up to 10 minutes), repos dispatched later in a rollout — including this instance's own actively-installed repos — could see an already-drained shared budget, causing real contributor PRs to go unreviewed for hours.refreshOpenPullRequestsForScheduledSweepnow returns early when the repo has noinstallationId, before touching the shared credential/segment-refresh path at all.No issue link: small, self-evident production-driven fix; root-caused today via live audit-log investigation (git history for
src/queue/processors.tsshows same-day narrow fixes without an issue link are an established pattern here).Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally (full unsharded run: 93.52% stmts / 92.46% branches / 92.8% funcs / 94.19% lines — all above threshold; new/changed lines inprocessors.tscovered by 2 new regression tests, one per branch of the new conditional)npm run test:workers— not re-run locally this pass (no Workers-pool-specific code touched); CI will run itnpm run build:mcp— not re-run locally this pass (no MCP package touched); CI will run itnpm run test:mcp-pack— not re-run locally this pass; CI will run itnpm run ui:openapi:check— not re-run locally this pass (no API/schema change); CI will run itnpm run ui:lint— N/A, no UI files touchednpm run ui:typecheck— N/A, no UI files touchednpm run ui:build— N/A, no UI files touchednpm audit --audit-level=moderate— not re-run this pass; no dependency changes in this diffIf any required check was skipped, explain why:
test:cichain; the untouched areas above (MCP, UI, Workers pool, OpenAPI) have zero overlap with this change (src/queue/processors.ts+test/unit/queue.test.tsonly) and CI will run them regardless.Safety
UI Evidencesection below. (N/A — no UI/visual change)Notes