VersionControl:PRs/magenta/333

From PickiPedia: A knowledge base of bluegrass, old time psychedelic jams, and other public domain music
Jump to navigationJump to search
magenta#333: Autocomplete for mergeables: repo:branch
State 🟣 merged 2026-11-06 05:44:15
Worked on by magent, justin, re
Moods #ramp
Deploy redeploy maybelle (memory-lane), after maybelle-config#250
Branch magent/branch-autocomplete → main, by magent-cryptograss
Opened · last pushed 2026-11-01 01:37:26 · 2026-11-06 04:31:19
Justin, in #ramp (1 Nov): mergeables are named `<repo>:<branch>` (`maybelle-config:re/fix-mtime-guard`), never PR numbers, and "make sure autocomplete is a thing from the start."

In the Mood composer, typing a repository's name and a colon (`maybelle-config:`), or an owner's name and a slash (`re/`), suggests mergeables from githouse's `branches.json` (maybelle-config#250). Live ones come first (🟢), then merged (🟣), then closed (⚫), because a name is used once and a merged one is still worth naming. After `repo:`, any part of the branch name matches (`maybelle-config:mtime`); after `re/`, it matches from the start. It only triggers after a space, a bracket or a backtick, so URLs and paths (`https://x.com/re/fix`) and times (`10:30`) don't open it. The list is fetched once, 4 s after the page loads (or on the first word that looks like one).

**Where the list comes from:** `/api/branches/` on magenta itself (`views_settings.api_branches`), which reads `branches.json` from `settings.GITHOUSE_DIR` (default `/srv/git`). maybelle-config#250 mounts maybelle's githouse copy there read-only; until it's deployed, the endpoint answers `{}` and the composer suggests nothing. Same origin, so no CORS, and no new hostname.

Checked: the matching and the sorting, in node, against a sample branches.json; `test_branches_api` (3 tests: what githouse wrote, nothing yet, not an object); full `conversations.tests` on sqlite, 1549 OK. No test covers the composer's JS, and it hasn't been tried in a browser with real data.

Deploy: redeploy maybelle (memory-lane), after maybelle-config#250
Worked on by: magent, Justin, re, in #ramp