Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion test/integration/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 github.com/ghraw,
// 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: {
Expand Down
16 changes: 14 additions & 2 deletions test/unit/backfill.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 github.com/ghraw,
// 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",
Expand Down Expand Up @@ -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" } });

Expand Down
6 changes: 4 additions & 2 deletions test/unit/queue-5.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
Loading