Commit5c7fbd2unknown_key
fix(admin): default self-host repo to ccantynz-alt + SELF_HOST_REPO override
fix(admin): default self-host repo to ccantynz-alt + SELF_HOST_REPO override "Failed to enable auto-merge: Repository not found: ccantynz/Gluecron.com" in /admin/ops, plus parallel breakage in /admin/self-host's deploy-history read — both hardcoded "ccantynz" as the Gluecron-side username, but the operator actually signed up as "ccantynz-alt" (matching the GitHub mirror handle). Nothing on Gluecron is owned by a user called "ccantynz", so every lookup 404'd inside the admin tools. Fix both surfaces to default to "ccantynz-alt/Gluecron.com" and read the SELF_HOST_REPO env var when set. Same pattern just used for the GitHub deploy default (commit ffad5aa). Test updated to match the new default + comment explaining the rename so a future agent doesn't think the value was wrong.
3 files changed+16−85c7fbd2d931d174484da38f182a0837f5ee48427
3 changed files+16−8
Modifiedsrc/__tests__/admin-ops.test.ts+3−1View fileUnifiedSplit
@@ -286,7 +286,9 @@ describe("POST /admin/ops/auto-merge/enable", () => {
286286 expect(loc).toContain("success=");
287287 expect(loc.toLowerCase()).toContain("enabled");
288288 expect(captured).not.toBeNull();
289 expect(captured.ownerSlash).toBe("ccantynz/Gluecron.com");
289 // Default OPS_REPO is the GitHub-mirror username (ccantynz-alt) the
290 // operator actually signed up with — env-overridable via SELF_HOST_REPO.
291 expect(captured.ownerSlash).toBe("ccantynz-alt/Gluecron.com");
290292 expect(captured.pattern).toBe("main");
291293 expect(captured.off).toBe(false);
292294 expect(captured.actorUserId).toBe(ADMIN_ID);
Modifiedsrc/routes/admin-ops.tsx+5−3View fileUnifiedSplit
@@ -99,9 +99,11 @@ export function __setOpsDepsForTests(d: Partial<OpsDeps> | null): void {
9999}
100100
101101// The repo + pattern we operate on. `/admin/ops` is a site-admin tool for
102// the platform's own repo. If the operator needs to flip auto-merge on a
103// different repo they still have the CLI (N1).
104const OPS_REPO = "ccantynz/Gluecron.com";
102// the platform's own repo. Env-overridable (SELF_HOST_REPO) because the
103// canonical name varies per deployment — on the main site it's
104// "ccantynz-alt/Gluecron.com" (the actual user who signed up). The CLI
105// (N1) still works for any other repo.
106const OPS_REPO = process.env.SELF_HOST_REPO || "ccantynz-alt/Gluecron.com";
105107const OPS_PATTERN = "main";
106108
107109// ---------------------------------------------------------------------------
Modifiedsrc/routes/admin-self-host.tsx+8−4View fileUnifiedSplit
@@ -93,9 +93,13 @@ export function __setSelfHostDepsForTests(d: Partial<Deps> | null): void {
9393// Constants — the repo we self-host.
9494// ---------------------------------------------------------------------------
9595
96const SELF_HOST_OWNER = "ccantynz";
97const SELF_HOST_NAME = "Gluecron.com";
98const SELF_HOST_FULL = `${SELF_HOST_OWNER}/${SELF_HOST_NAME}`;
96// Env-overridable via SELF_HOST_REPO (format: "owner/name"). Defaults
97// to the canonical mainline (ccantynz-alt/Gluecron.com — the GitHub-
98// mirror-matching username the operator actually signed up with).
99const SELF_HOST_FULL = process.env.SELF_HOST_REPO || "ccantynz-alt/Gluecron.com";
100const [SELF_HOST_OWNER_PARSED, SELF_HOST_NAME_PARSED] = SELF_HOST_FULL.split("/");
101const SELF_HOST_OWNER = SELF_HOST_OWNER_PARSED || "ccantynz-alt";
102const SELF_HOST_NAME = SELF_HOST_NAME_PARSED || "Gluecron.com";
99103const SELF_DEPLOY_SOURCE = "self-deploy";
100104
101105// ---------------------------------------------------------------------------
@@ -382,7 +386,7 @@ selfHost.get("/admin/self-host", async (c) => {
382386 <p style="font-size:13px;color:var(--text-muted);margin:0 0 10px 0">
383387 Mirror Gluecron's source from GitHub onto this Gluecron
384388 instance. Idempotent — safe to re-run. See{" "}
385 <a href="/ccantynz/Gluecron.com/blob/main/docs/SELF_HOST.md">
389 <a href={`/${SELF_HOST_OWNER}/${SELF_HOST_NAME}/blob/main/docs/SELF_HOST.md`}>
386390 docs/SELF_HOST.md
387391 </a>{" "}
388392 for the full runbook.
389393