fix(test): stop createTestEnv() default leaking the bundled self-repo manifest - #6493
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 #6493 +/- ##
===========================================
+ Coverage 75.82% 95.56% +19.74%
===========================================
Files 589 589
Lines 47121 47121
Branches 14989 14989
===========================================
+ Hits 35728 45032 +9304
+ Misses 9366 1297 -8069
+ Partials 2027 792 -1235
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-16 11:32:56 UTC
Review summary Nits — 6 non-blocking
Concerns raised — review before merging
📋 Copy for AI agents — paste into your coding agentDecision drivers
Context & advisory signals — never blocks the verdict
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.
|
… manifest createTestEnv()'s LOOPOVER_DRIFT_ISSUE_REPO default was "JSONbored/gittensory" — the same literal string ~100+ generic test fixtures use as their arbitrary placeholder repo name. Since that value also happens to match isLoopOverSelfRepo()'s matching input, any bare createTestEnv() call whose fixture repo was named "JSONbored/gittensory" silently picked up the bundled self-repo focus manifest (including its live autonomy grant), regardless of whether that test had any intent to exercise self-repo behavior. Flip the default to a sentinel that can never collide with a real fixture, and give the handful of tests that intentionally exercise self-repo/manifest-override resolution (ops/draftFlow/publicStats/maintainerRecap/upstreamDriftIssues, the self-dogfood route) an explicit override instead of relying on the shared default. Also fixes 3 tests (2x backfill.test.ts, 1x api.test.ts) that were silently depending on a REAL, unmocked network fetch to GitHub's raw-content CDN for "JSONbored/gittensory"'s .loopover.yml — GitHub's repo-rename redirect resolves that straight through to the live, current .loopover.yml, so those assertions passed only by coincidence before this repo's autonomy config was added there. Stub fetch deterministically instead. routes-self-dogfood-registration-pack.test.ts is modernized to test against the real current self-repo identity (JSONbored/loopover) rather than pinning to the old name.
eec28ff to
c746d18
Compare
…ection Moves commentMode/publicAudienceMode/publicSignalLevel/checkRunMode/ checkRunDetailLevel/publicSurface/includeMaintainerAuthors/backfillEnabled off DB-backed upsertRepositorySettings() fixture calls onto upsertRepoFocusManifest() manifest injection (70 call sites) -- a pure plumbing move with identical resolved test behavior, ahead of these fields moving off repository_settings entirely. Also removes a handful of now-redundant LOOPOVER_DRIFT_ISSUE_REPO overrides that JSONbored#6493 made obsolete. Part of JSONbored#6440, part of JSONbored#6442
…ection Moves commentMode/checkRunMode/publicSurface/regateSweepOrderMode off DB-backed upsertRepositorySettings() fixture calls onto upsertRepoFocusManifest() manifest injection (69 call sites) -- a pure plumbing move with identical resolved test behavior, ahead of these fields moving off repository_settings entirely. Also removes now-redundant LOOPOVER_DRIFT_ISSUE_REPO overrides that JSONbored#6493 made obsolete. Part of JSONbored#6440, part of JSONbored#6442
…o manifest injection Moves commentMode/checkRunMode/publicSurface (queue.test.ts) and commentMode/checkRunMode/includeMaintainerAuthors/publicAudienceMode/ publicSurface (queue-5.test.ts) off DB-backed upsertRepositorySettings() fixture calls onto upsertRepoFocusManifest() manifest injection (58 + 55 call sites) -- a pure plumbing move with identical resolved test behavior, ahead of these fields moving off repository_settings entirely. Also removes now-redundant LOOPOVER_DRIFT_ISSUE_REPO overrides that JSONbored#6493 made obsolete, and corrects two stale comments referencing that same removed workaround. Part of JSONbored#6440, part of JSONbored#6442
… manifest injection Moves commentMode/checkRunMode/publicSurface off DB-backed upsertRepositorySettings() fixture calls onto upsertRepoFocusManifest() manifest injection in test/unit/queue-3.test.ts (46 call sites) and test/unit/queue-lifecycle-guards.test.ts (9 call sites) -- a pure plumbing move with identical resolved test behavior, ahead of these fields moving off repository_settings entirely. Also removes now-redundant LOOPOVER_DRIFT_ISSUE_REPO overrides that JSONbored#6493 made obsolete. Part of JSONbored#6440, part of JSONbored#6442
JSONbored#6493 fixed the root cause (createTestEnv()'s default no longer matches any real fixture repo name), making the earlier per-test LOOPOVER_DRIFT_ISSUE_REPO: "unrelated-org/unrelated-repo" workaround in these two files redundant.
Summary
createTestEnv()'sLOOPOVER_DRIFT_ISSUE_REPOdefault was"JSONbored/gittensory"— the same literal string ~100+ generic test fixtures use as their arbitrary placeholder repo name. Since that value also matchesisLoopOverSelfRepo()'s comparison, any barecreateTestEnv()call whose fixture repo happened to be named"JSONbored/gittensory"silently picked up the bundled self-repo focus manifest (including its live autonomy grant), regardless of whether that specific test had any intent to exercise self-repo behavior.ops/draftFlow/publicStats/maintainerRecap/upstreamDriftIssues, the self-dogfood route) an explicit override instead of relying on the shared default.backfill.test.ts, 1×api.test.ts) that were silently depending on a REAL, unmocked network fetch to GitHub's raw-content CDN for"JSONbored/gittensory"'s.loopover.yml— GitHub's repo-rename redirect resolves that straight through to the live, current.loopover.yml, so those assertions only passed by coincidence before this repo's autonomy config was added there. Stubsfetchdeterministically instead.routes-self-dogfood-registration-pack.test.tsis modernized to test against the real current self-repo identity (JSONbored/loopover) rather than pinning to the old name.Part of a broader gittensory→loopover residue cleanup (see sibling PRs).
Validation
npm run test:ci(full local gate, green)npm run test:coverage(unsharded, 17536 passed)npm run typecheck