CodeIssuesPull RequestsActionsSecurityInsights
✨ AI
More
Settings

PR merge chain resolves bare-repo disk path from the request slug, not the DB row's diskPath#196

Openccantynz opened this issue 25d ago
ccantynzAuthorcommented 25d ago

Found live on 2026-08-07: gluecron_merge_pr for PR #3527 with repo: "gluecron.com" returned "Head branch not found" while the branch existed — because a stale orphan gluecron.com.git (left by the failed bulk import, see PR #3527's description) sat beside the real Gluecron.com.git, and some step in the merge chain built the disk path from the request's lowercase slug instead of using the resolved repository row's diskPath. Retrying with repo: "Gluecron.com" merged fine.

This is the "two sources of truth" pattern again: repo identity is resolved case-insensitively via the DB in one place, but the filesystem path is derived from the raw slug in another. Any route/tool that does join(reposPath, owner, ${repoParam}.git) instead of row.diskPath has the same latent bug — it just needs a case-mismatched or shadowing directory to surface.

Fix: sweep the merge chain (pr-merge-gated.ts and whatever git helpers it calls) — and ideally all routes — so every filesystem access goes through the repository row's diskPath. Related: the pending per-route lowercase-slug sweep.

The two orphan dirs (ccantynz/gluecron.com.git, ccantynz/vapron.git) still need quarantining/removal from the git-repos volume; blocked on owner approval for the destructive step.

c comment · e edit title · x close/reopen · ? shortcuts