fix(github): retarget the backfill-registered-repos job family from isRegistered to isInstalled - #5688
Conversation
…sRegistered to isInstalled backfillRegisteredRepositories and enqueueRepositoryOpenDataBackfill (the two entry points for open-data backfill) both filtered/gated on repo.isRegistered. Any repo on the gittensor subnet's registry file got swept into backfill every 30 minutes, regardless of whether this self-host instance ever installed the app on it. Live-verified on edge-nl-01: 15 of 18 gittensor-subnet repos were unrelated third-party miner repos, none installed on this instance, all still getting backfill-repo-segment jobs dispatched every cron cycle -- the direct driver of the unbounded queue growth reported in #5016. Retargets both entry points to isInstalled. The optional job-type rename (backfill-registered-repos -> backfill-installed-repos) suggested in the issue is deliberately left for a separate follow-up to keep this fix small and low-risk. Also wires clearInstallationTokenCacheForTest() into backfill.test.ts's afterEach: the module-level installation-token cache is keyed by installationId alone, and the new isInstalled-eligible test repos all share one hardcoded id, so without this reset whichever test first mints a token poisons every later test reusing that id, independent of that later test's own fetch mock. Same underlying cache also required a one-line install call in backfill-file-hydration-scoping.test.ts, queue.test.ts, and queue-2.test.ts, whose own repo fixtures only ever set isRegistered and now need isInstalled too to keep exercising the same code path they always did. Closes #5021
|
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 #5688 +/- ##
==========================================
- Coverage 95.04% 95.02% -0.03%
==========================================
Files 576 576
Lines 45977 45977
Branches 14724 14724
==========================================
- Hits 43699 43688 -11
- Misses 1525 1530 +5
- Partials 753 759 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-14 04:05:24 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 5 non-blocking
Concerns raised — review before merging
📋 Copy for AI agents — paste into your coding agent
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 LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
backfillRegisteredRepositoriesandenqueueRepositoryOpenDataBackfill(the two entry points for open-data backfill) both filtered/gated onrepo.isRegistered. Any repo on the gittensor subnet's registry file got swept into backfill every 30 minutes, regardless of whether this self-host instance ever installed the app on it.backfill-repo-segmentjobs dispatched every cron cycle — the direct driver of the unbounded queue growth reported in the parent epic Untangle gittensor-subnet integration from core self-host review features #5016.isInstalled. The optional job-type rename (backfill-registered-repos→backfill-installed-repos) suggested in the issue is deliberately left for a separate follow-up to keep this fix small and low-risk.A note on test fallout
Fixing the two gate checks surfaced a real, pre-existing test-isolation gap: the module-level installation-token cache (
src/github/app.ts) is keyed byinstallationIdalone, and the newly-eligible test repos needed a real installed-repo fixture, several of which ended up sharing the same hardcoded id. Without resetting that cache between tests, whichever test happened to mint a token first would silently poison every later test reusing that id — regardless of that later test's own fetch mock. A dedicated reset helper (clearInstallationTokenCacheForTest) already existed for exactly this purpose (used elsewhere in the repo) but wasn't wired intobackfill.test.ts; fixed that, plus one-line install fixtures in three other test files whose repo setups only ever setisRegisteredand now needisInstalledtoo to keep exercising the same code path they always did.Test plan
npm run test:ci— full local gate, clean (0 failures), run twice for stability