Context
packages/loopover-miner/lib/manage-poll.js:108-116 (ensureManagedPrRow) enqueues { repoFullName, identifier, priority: 0 } with no apiBaseUrl, which portfolio-queue.js's normalizeApiBaseUrl silently defaults to DEFAULT_FORGE_CONFIG.apiBaseUrl (github.com). The same recordManagePollSnapshot function correctly threads apiBaseUrl into the real GitHub poll two lines away. portfolio-queue.js's own #5563 migration comment states the composite (api_base_url, repo_full_name, identifier) primary key exists specifically so two hosts serving the same owner/repo name never collide — this write path violates that invariant. listQueue(repoFullName)'s "already exists" check is also forge-blind (no api_base_url filter), so a same-named repo+PR-number tracked on two hosts can suppress row creation for the second host. test/unit/miner-manage-poll.test.ts has zero references to apiBaseUrl.
Requirements
- Thread
options.apiBaseUrl from recordManagePollSnapshot into ensureManagedPrRow, and pass it to portfolioQueue.enqueue({ ..., apiBaseUrl }).
- Scope the "already exists" check to the same forge host, not just
repoFullName.
Deliverables
Test Coverage Requirements
99%+ Codecov patch coverage on every changed line and branch, plus a regression test that reproduces the exact failure mode described above and asserts it's fixed.
Expected Outcome
A managed PR on a non-default forge host gets a correctly-scoped portfolio-queue row, matching the CI poll's own forge scoping.
Links & Resources
packages/loopover-miner/lib/manage-poll.js:108-116,141-159, packages/loopover-miner/lib/portfolio-queue.js:51-55,108-112.
Context
packages/loopover-miner/lib/manage-poll.js:108-116(ensureManagedPrRow) enqueues{ repoFullName, identifier, priority: 0 }with noapiBaseUrl, whichportfolio-queue.js'snormalizeApiBaseUrlsilently defaults toDEFAULT_FORGE_CONFIG.apiBaseUrl(github.com). The samerecordManagePollSnapshotfunction correctly threadsapiBaseUrlinto the real GitHub poll two lines away.portfolio-queue.js's own #5563 migration comment states the composite(api_base_url, repo_full_name, identifier)primary key exists specifically so two hosts serving the same owner/repo name never collide — this write path violates that invariant.listQueue(repoFullName)'s "already exists" check is also forge-blind (noapi_base_urlfilter), so a same-named repo+PR-number tracked on two hosts can suppress row creation for the second host.test/unit/miner-manage-poll.test.tshas zero references toapiBaseUrl.Requirements
options.apiBaseUrlfromrecordManagePollSnapshotintoensureManagedPrRow, and pass it toportfolioQueue.enqueue({ ..., apiBaseUrl }).repoFullName.Deliverables
apiBaseUrlthreaded throughensureManagedPrRowapiBaseUrland asserting the resulting queue row is scoped to that hostTest Coverage Requirements
99%+ Codecov patch coverage on every changed line and branch, plus a regression test that reproduces the exact failure mode described above and asserts it's fixed.
Expected Outcome
A managed PR on a non-default forge host gets a correctly-scoped portfolio-queue row, matching the CI poll's own forge scoping.
Links & Resources
packages/loopover-miner/lib/manage-poll.js:108-116,141-159,packages/loopover-miner/lib/portfolio-queue.js:51-55,108-112.