VersionControl:PRs/magenta/463
From PickiPedia: A knowledge base of bluegrass, old time psychedelic jams, and other public domain music
| State | 🟢 open |
|---|---|
| Worked on by | magent, skyler, justin |
| Moods | #interfaces |
| Deploy | redeploy maybelle (memory-lane); no migrations. Then save the four Conflict task pages as a trusted editor, or nothing wakes |
| Branch | magent/ramp-conflicts → main, by magent-cryptograss
|
| Opened · last pushed | 2026-11-10 20:13:48 · 2026-11-10 20:24:13 |
Skyler, 10 Nov (#interfaces): "should we have conflict tab that tells us if there is conflict in the code?" Justin: "yep go". Built as marks on each ramp row, not a separate tab, so you see them where you'd press Merge.
**Two marks per open candidate branch:**
- **⚠ conflicts with main** (or whatever its base is): merging it into the base as githouse has it now would conflict. Hovering lists the files and says the author merges or rebases onto the base first.
- **⇄ magenta#436**: if both this and that open candidate merged, they would conflict. Hovering lists the files and says whichever merges second rebases.
**Lines, not files.** When I proposed this I said ⇄ would mean "touches the same files". In magenta nearly every branch touches `moods.html`, so that would mark almost every pair. The check now does a real three-way merge of the two heads, so ⇄ means they change the same lines.
**Avoiding false ⇄ marks.** If either branch already conflicts with its base in a file, that file isn't counted for the pair. Without this, #436, which conflicts with main in `todo.py`, also showed as clashing with #460 and #462, only because those are built on main. Its ⚠ already says so.
**How:**
- `git merge-tree --write-tree --name-only` runs the merge in memory.
- Its objects go to a scratch directory (`GIT_OBJECT_DIRECTORY`, with githouse's objects as alternates), since githouse's copy is mounted read-only on maybelle.
- Each answer is cached for a week, keyed by the two commit ids, which never change, so a board rebuild only checks heads that moved.
- Pairs are capped at 600 per build.
- If git can't answer (too old, a bad id), no mark is shown.
**On a candidate's own page too** (Skyler: "that will show up in ramp when we go to look at the code?"):
- The same ⚠ and ⇄ marks sit by its title. ⇄ links to the other candidate's page.
- In its file list, each file where it conflicts is marked **⚠ conflict**.
- The check against the base runs when the page is drawn, against githouse's copy as it is then. The ⇄ marks come from the board.
- New test `test_the_page_says_if_it_conflicts_and_where`: main changes the line re/foo changed, and the page marks app.py but not new.txt.
**A conflict wakes its author** (Justin, 20:18Z: "it makes sense for conflicts to awaken you in the mood where the CB originated"; Skyler: "yeah that makes sense").
- `services/ramp_conflicts.py`, run every minute from `run_due_tasks`, reads the last ramp board. It never builds one.
- **Who:** the emergent who owns the branch (`re/foo` is re's), or else the first emergent named on its card. A branch owned by a person (`skyler/…`) wakes nobody; its ramp marks still show the conflict.
- **Where:** the first Mood named on its card, else the first Mood it was mentioned in, else #ramp.
- **How:** it starts that emergent's **Conflict** task in that Mood, the same way the Jenkins alarms start theirs. Its blanks are `{ref} {branch} {repo} {base} {head} {title} {conflicts} {clashes} {page}`.
- **The task pages**, all created by magent and waiting on a trusted editor (they don't run until one saves them):
- [Cryptograss:Emergents/Tasks/Conflict](https://pickipedia.xyz/wiki/Cryptograss:Emergents/Tasks/Conflict): the shared instructions. Settle conflicts with the base by merging or rebasing, then push. For a clash with another branch, talk with its author or in #ramp, since whichever merges second rebases.
- One page each for Magent, Re and Blu: `{{Emergent task|cap=3|tools=full|shared=…}}`. Each is capped at $3 a day per Mood.
- **Once per commit:** the task line records the head, so a branch that stays in conflict wakes its author once. A new commit that still conflicts wakes them again.
- **Expect at deploy:** #436 (magent's) conflicts with main in `todo.py`. Once its page is saved, magent is woken about it once, in #docs-tests-qa.
- **Tests:** new `test_ramp_conflicts` covers: woken once per head, in its Mood, with the filled-in words; a clash wakes too; who and where; and nothing starts with no conflict, a person's branch, or no trusted page.
**On real data**, against hunter's read-only copy of magenta with its 11 open PR heads:
- First run 0.86 s; cached 0.001 s.
- #436 shows ⚠ for `todo.py`; nothing else conflicts right now.
**Tests:** new `ClashTest` uses real repositories, with the bare copy chmodded read-only:
- conflicts with the base, by file;
- a branch built on the moved base is clean;
- two candidates at odds only with each other get ⇄;
- the row renders both marks.
The full suite passes: 1,963 tests OK.
Deploy: redeploy maybelle (memory-lane); no migrations. Then save the four Conflict task pages as a trusted editor, or nothing wakes
Worked on by: magent, skyler, justin, in #interfaces