fix(queue): bound linked-issue webhook fanout by queuing staggered per-PR jobs - #2476
Conversation
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-02 05:34:46 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 7 non-blocking
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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2476 +/- ##
=======================================
Coverage 95.93% 95.93%
=======================================
Files 225 225
Lines 25338 25340 +2
Branches 9218 9219 +1
=======================================
+ Hits 24308 24310 +2
Misses 417 417
Partials 613 613
🚀 New features to boost your workflow:
|
Motivation
issueswebhook handler synchronously re-reviewed every open PR linking the changed issue, causing an unbounded, expensive fanout that can exhaust GitHub/queue/worker resources and bypass the rate-limit-aware per-PR path.Description
maybeReReviewOnLinkedIssueChangeinsrc/queue/processors.tsto enqueue bounded per-PRagent-regate-prjobs (one job per linked PR) instead of calling the expensivereReviewStoredPullRequestinline, and staggered enqueues by index to reuse the sweep's backpressure behavior.SWEEP_MAX_PRSso an issue-side event cannot synchronously schedule more work than the sweep budget.issueLinkedPrReReviewCoalesced) and trailing re-review scheduling (scheduleTrailingIssueLinkedReReview) behavior intact so same-PR bursts still coalesce and the latest state is captured after the window.test/unit/queue.test.tsto assert the new behavior and added regression tests that verify no inline GitHub work is performed by the issue handler, the fanout is capped and staggered, and trailing/coalesced job retry/dedupe semantics remain correct.Testing
git diff --checkwith no issues reported.npm run typecheck, which completed successfully with no type errors.npx vitest run test/unit/queue.test.ts -t "issue" --reporter=dot, and the targeted tests passed locally (issue-related tests covering capping, enqueueing, coalescing, and trailing retry/dedupe passed).npm run test:ciandnpm audit --audit-level=moderatebut the CI-level run and audit were blocked by external network/resolution issues in the environment (actionlint setup fallback and registry audit endpoint returned network/permission errors), so the full gated CI could not be completed in this session.Codex Task