fix(miner): scope the managed-PR queue row to the polled forge host - #6861
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 #6861 +/- ##
=======================================
Coverage 93.64% 93.64%
=======================================
Files 685 685
Lines 68239 68241 +2
Branches 18707 18707
=======================================
+ Hits 63904 63906 +2
Misses 3350 3350
Partials 985 985
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-17 09:18:36 UTC
Review summary Nits — 3 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver 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://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Closes #6764
Problem
ensureManagedPrRow(packages/loopover-miner/lib/manage-poll.js) enqueues{ repoFullName, identifier, priority: 0 }with noapiBaseUrl, soportfolio-queue.js'snormalizeApiBaseUrlsilently defaults the row to github.com — even when the poll two lines away ran against a different forge host (recordManagePollSnapshotalready threadsoptions.apiBaseUrlintopollCheckRuns). The queue's composite(api_base_url, repo_full_name, identifier)primary key exists specifically so two hosts serving the same owner/repo name never collide (#5563); this write path violates that invariant.The "already exists" check is forge-blind for the same reason:
listQueue(repoFullName)returns rows across every host, so the same repo + PR-number already tracked on another host suppresses row creation for this one entirely.Fix
options.apiBaseUrlfromrecordManagePollSnapshotintoensureManagedPrRowand pass it toenqueue, so the row is scoped to the host it was actually polled from.enqueuestill performs its own normalization/validation.resolveManagedRowApiBaseUrlfold that mirrorsportfolio-queue-manager.js's existing one (omitted/blank → the github.com default, so every pre-existing single-forge caller is byte-identical).Tests
Two regression tests in
test/unit/miner-manage-poll.test.ts(which previously had zeroapiBaseUrlreferences), both failing before the fix:apiBaseUrl→ the resulting queue row is scoped to that host (before: silently github.com);expected length 2 but got 1).Validation
npx vitest run test/unit/miner-manage-poll.test.ts→ 11/11 pass (9 existing + 2 new)npm run typecheck→ clean (0 errors)