diff --git a/test/integration/api.test.ts b/test/integration/api.test.ts index e982f5b802..4da0c07910 100644 --- a/test/integration/api.test.ts +++ b/test/integration/api.test.ts @@ -2146,8 +2146,16 @@ describe("api routes", () => { }); it("serves installation repair diagnostics and refreshes installation health", async () => { + // No repo file mocked (this test only cares about DB-configured settings): stub fetch to a plain 404 so + // resolveRepositorySettings's manifest lookup never makes a REAL network call to raw.githubusercontent.com, + // which -- being a live, mutable URL that transparently follows the gittensory->loopover rename -- would + // silently pick up whatever real .loopover.yml content the actual repo carries today instead of the + // deterministic DB-only settings this test asserts against. LOOPOVER_DRIFT_ISSUE_REPO is also overridden + // so a 404'd fetch doesn't fall back to the bundled self-repo manifest (LOOPOVER_REPO_FOCUS_MANIFEST_YAML), + // which carries its own settings.autonomy block (#773) that would equally clobber this test's DB-only setup. + vi.stubGlobal("fetch", async () => new Response("not found", { status: 404 })); const app = createApp(); - const env = createTestEnv({ GITHUB_APP_PRIVATE_KEY: await generatePrivateKeyPem() }); + const env = createTestEnv({ GITHUB_APP_PRIVATE_KEY: await generatePrivateKeyPem(), LOOPOVER_DRIFT_ISSUE_REPO: "unrelated-org/unrelated-repo" }); const repoPayload = { name: "gittensory", full_name: "JSONbored/gittensory", private: true, default_branch: "main", owner: { login: "JSONbored" } }; await upsertInstallation(env, { installation: { diff --git a/test/unit/backfill.test.ts b/test/unit/backfill.test.ts index 3a236eda47..a09b28f9c1 100644 --- a/test/unit/backfill.test.ts +++ b/test/unit/backfill.test.ts @@ -1173,7 +1173,15 @@ describe("GitHub backfill", () => { }); it("marks comment, label, and check repair impacts disabled by repo settings", async () => { - const env = createTestEnv(); + // No repo file mocked (this test only cares about DB-configured settings): stub fetch to a plain 404 so + // resolveRepositorySettings's manifest lookup never makes a REAL network call to raw.githubusercontent.com, + // which -- being a live, mutable URL that transparently follows the gittensory->loopover rename -- would + // silently pick up whatever real .loopover.yml content the actual repo carries today instead of the + // deterministic DB-only settings this test asserts against. LOOPOVER_DRIFT_ISSUE_REPO is also overridden + // so a 404'd fetch doesn't fall back to the bundled self-repo manifest (LOOPOVER_REPO_FOCUS_MANIFEST_YAML), + // which carries its own settings.autonomy block (#773) that would equally clobber this test's DB-only setup. + vi.stubGlobal("fetch", async () => new Response("not found", { status: 404 })); + const env = createTestEnv({ LOOPOVER_DRIFT_ISSUE_REPO: "unrelated-org/unrelated-repo" }); await upsertRepositoryFromGitHub(env, { name: "gittensory", full_name: "JSONbored/gittensory", private: true, owner: { login: "JSONbored" } }, 123); await upsertRepositorySettings(env, { repoFullName: "JSONbored/gittensory", @@ -1245,7 +1253,11 @@ describe("GitHub backfill", () => { }); it("repair diagnostics require contents:write for merge autonomy (#audit-install-health display)", async () => { - const env = createTestEnv(); + // See the sibling "marks comment, label, and check repair impacts disabled by repo settings" test above -- + // stub fetch AND override the self-repo identity so this test's DB-only autonomy override is never + // silently overlaid by a real, live fetch or the bundled self-repo manifest's own autonomy block. + vi.stubGlobal("fetch", async () => new Response("not found", { status: 404 })); + const env = createTestEnv({ LOOPOVER_DRIFT_ISSUE_REPO: "unrelated-org/unrelated-repo" }); await upsertRepositoryFromGitHub(env, { name: "gittensory", full_name: "JSONbored/gittensory", private: true, owner: { login: "JSONbored" } }, 123); await upsertRepositorySettings(env, { repoFullName: "JSONbored/gittensory", autonomy: { merge: "auto" } }); diff --git a/test/unit/queue-5.test.ts b/test/unit/queue-5.test.ts index 30674d0fcf..f5bfb2898e 100644 --- a/test/unit/queue-5.test.ts +++ b/test/unit/queue-5.test.ts @@ -2634,8 +2634,10 @@ describe("queue processors", () => { // other slop detector. Asserted via the persisted `pull_requests` slopRisk/slopBand columns // (updatePullRequestSlopAssessment runs unconditionally inside shouldCollectSlopEvidence, independent of // the publish/comment pipeline), mirroring how "clears the persisted dashboard slop score when the slop - // gate is off (#911)" above verifies the same live score. - const env = createTestEnv({ GITHUB_APP_PRIVATE_KEY: await generatePrivateKeyPem() }); + // gate is off (#911)" above verifies the same live score. LOOPOVER_DRIFT_ISSUE_REPO is overridden so this + // test's 404'd manifest fetch doesn't fall back to the bundled self-repo manifest, which carries its own + // settings.autonomy block (#773) unrelated to (and irrelevant for) the slop assessment under test here. + const env = createTestEnv({ GITHUB_APP_PRIVATE_KEY: await generatePrivateKeyPem(), LOOPOVER_DRIFT_ISSUE_REPO: "unrelated-org/unrelated-repo" }); await persistRegistrySnapshot( env, normalizeRegistryPayload({ "JSONbored/gittensory": { emission_share: 0.01, issue_discovery_share: 0 } }, { kind: "raw-github", url: "https://example.test" }, "2026-05-23T00:00:00.000Z"),