fix(review): preserve per-repo issue cap when miner global cap is set to off#5205
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 #5205 +/- ##
=======================================
Coverage 94.34% 94.35%
=======================================
Files 473 473
Lines 39973 39973
Branches 14573 14573
=======================================
+ Hits 37712 37715 +3
Misses 1585 1585
+ Partials 676 673 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-12 09:52:11 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 5 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 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.
|
… to off maybeCloseIssueOverContributorCap's early return fired whenever ONLY the miner-global-cap resolver returned null (e.g. GLOBAL_CONTRIBUTOR_OPEN_ITEM_CAP_MINER=off), which skipped the per-repo cap check too, not just the global one. Scopes the early return to the install-wide branch so the per-repo cap still runs independently. Adds a regression test for the fix (miner-cap-off falls through to the per-repo cap) and a second test covering the empty-plan branch on the install-wide path (an over-cap issue with no autonomy granted plans no action and never executes a close) -- both changed branches on the pre-existing (now-reindented) install-wide block.
abb8764 to
311ff4f
Compare
Motivation
GLOBAL_CONTRIBUTOR_OPEN_ITEM_CAP_MINER=offcaused an earlyreturnin the issues processing path, which inadvertently skipped the repository-levelcontributorOpenIssueCapenforcement for confirmed miners.Description
src/queue/processors.tsso the install-wide check is guarded byif (globalCap !== null) { ... }instead ofif (globalCap === null) return;, ensuring only the install-wide branch is skipped while the per-repo cap logic still runs.test/unit/queue-3.test.tstitledinstall-wide contributor open-item cap (#4511): miner cap off still falls through to the per-repo issue capthat simulates a confirmed miner with the miner cap set to"off"and asserts the issue is closed and an audit event is written.src/queue/processors.tsandtest/unit/queue-3.test.tsand keep existing plan/execution flow for install-wide closes.Testing
npx vitest run test/unit/queue-3.test.ts -t "miner cap off", which passed.npx vitest run test/unit/queue-3.test.tsand observed all tests in that file (including the new regression) passed (130/130).npm run typecheck, which completed with no type errors.Codex Task