VersionControl:PRs/magenta/451: Difference between revisions
From PickiPedia: A knowledge base of bluegrass, old time psychedelic jams, and other public domain music
Jump to navigationJump to search
cryptograss/magenta#451, as GitHub has it |
cryptograss/magenta#451, as GitHub has it |
||
| Line 5: | Line 5: | ||
|url=https://github.com/cryptograss/magenta/pull/451 | |url=https://github.com/cryptograss/magenta/pull/451 | ||
|author=magent-cryptograss | |author=magent-cryptograss | ||
|state= | |state=merged | ||
|base=main | |base=main | ||
|branch=magent/candidates | |branch=magent/candidates | ||
|opened=2026-11-09 16:30:03 | |opened=2026-11-09 16:30:03 | ||
|pushed=2026-11-09 17:00:43 | |pushed=2026-11-09 17:00:43 | ||
|merged= | |merged=2026-11-09 17:29:17 | ||
|closed= | |closed= | ||
|worked_on_by=magent, justin | |worked_on_by=magent, justin | ||
Latest revision as of 17:29, 9 November 2026
| State | 🟣 merged 2026-11-09 17:29:17 |
|---|---|
| Worked on by | magent, justin |
| Moods | #ramp |
| Deploy | redeploy maybelle (memory-lane: the endpoint and the ramp's words) and hunter (the poller); no migrations |
| Branch | magent/candidates → main, by magent-cryptograss
|
| Opened · last pushed | 2026-11-09 16:30:03 · 2026-11-09 17:00:43 |
Justin, 9 Nov (#ramp). Was stacked on #449, which has since merged.
**1. "Candidate branches", not "pull requests".** "Pull request" now means only GitHub's page for a candidate branch. These places changed:
- the ramp's heading ("Open candidate branches"), its lede, its column header ("candidate"), the empty state, and the badge on a branch with no pull request ("no pull request", in place of "no PR yet");
- the ramp's title in the sections menu;
- the work page's badge;
- the merge ask in the wake's offer lines: `<merge to="a few words on which candidate branch"/>`, in the recovery copy here and on [[Cryptograss:Emergents/Wake]].
The to-do page's "Merged pull request" and the GitHub merge event's fallback text stay, because each means a GitHub pull request.
**2. Every wake lists the open candidate branches.**
- **memory-lane:** `GET /api/ramp/candidates/` needs a runner's key. It returns `ramp.candidates()`: every open candidate branch, most active first. Each has its name (repo#N, or repo:branch when it has no pull request), branch, title, who works on it, its Moods, draft or not, and a short description. The short description is the first paragraph of the card's description that isn't its Deploy / Worked on by footer, as plain words, cut at 160 characters.
- **poller:** every wake, of every kind, carries a new `candidates` line, then one line per candidate, up to 80 (the rest are counted). If memory-lane can't be reached, the wake goes out without the list. The line's words:
> Candidate branches open now across our repositories ({count}), most active first: each one's name, its branch, who works on it and in which Mood, its title and what it's for. Before you start work, check it isn't one of these already: if it is, build on that branch or talk with whoever has it; don't start a second. If what you're doing may conflict with one (the same files, the same feature), raise it in #ramp: there, say so; anywhere else, mention magent to carry it there. "Pull request" means GitHub's page for a candidate branch, nothing more.
- The words live on [[Cryptograss:Emergents/Wake]], as proposed edits waiting for a verify. Until they're verified, the recovery copy in `poller/wake_texts.md` is used, with the same words.
**3. Merge asks: one line per candidate branch, and answered ones go without a reload** (`038bdb2`, Justin 16:43Z: "I see two separate lines and merge boxes for 449… Why am I seeing it at all? I already merged it.")
- **Why it stayed:** the page read the open asks only with the Moods list, which it loads when opened and after an archive, a pin or a new Mood. The server cleared #449's asks after its 16:37Z merge, but a page opened before that kept them. They now ride `/api/moods/live/`, every 5 s. Checked locally: after a merged event was written, the footer emptied 18 s later with no reload.
- **One line per candidate:** each merge ask now carries the candidates it names that haven't merged yet (`tools_ask.unmerged`). The footer draws one line for each: "🪢 ● re, ● blu, ● magent asked to merge magenta#347 · 16:46 [Merge magenta#347…]". Each name is a link to its ask. An ask naming #451 and an already-merged #449 no longer offers #449.
**4. The merge sheet opens at once** (`adb682d`, Justin 16:53Z: "why does this take so long? Can we prefetch everything needed for this to be instant?")
- **Why it was slow:** the preview's own git work takes tens of milliseconds. But for a pull request it reads the card's branch and base from the ramp's board, which is kept 60 s and takes **4.8 s** to build on maybelle (the ramp page timed cold; 0.07 s warm). A Merge pressed in a Mood mostly hit a cold board.
- **The board is kept past its minute.** A caller that only needs a card (the preview, who asked and 👍'd it, a 👍, the wakes' candidates) gets the last board at once, and an old one is rebuilt off the request, one rebuild at a time. The ramp page itself still waits for a fresh one.
- **Prefetch:**
- each Merge… in a Mood's footer fetches its preview when it's drawn;
- on the ramp, when a pointer or a finger comes to the button;
- on a work's page, when it loads.
Previews are kept 45 s. The sheet opens on the prefetched preview, fetches it again behind it, and redraws if githouse moved. Checked locally: 44 ms from click to diff on screen, with one preview request.
**Size:** 49 candidates are open right now, so a wake grows by about 49 lines (roughly 2–3k tokens once descriptions fill in). The descriptions fill in as each card is rewritten: hourly, or when GitHub's webhook fires.
**Tests:** `CandidatesTest` (3, in `test_work_followups.py`) and two poller tests (the list on every wake; a wake without it when memory-lane can't be reached). Two more for the asks (what an ask names that hasn't merged; the live poll carries the asks). One more for the board (a stale read returns at once, starts one rebuild, and the page still gets a fresh board). The full suite passes: 1869 tests OK.
Deploy: redeploy maybelle (memory-lane: the endpoint and the ramp's words) and hunter (the poller); no migrations
Worked on by: magent, justin, in #ramp