VersionControl:PRs/magenta/415: Difference between revisions

From PickiPedia: A knowledge base of bluegrass, old time psychedelic jams, and other public domain music
Jump to navigationJump to search
DrivingThatTrain (talk | contribs)
cryptograss/magenta#415, as GitHub has it
DrivingThatTrain (talk | contribs)
cryptograss/magenta#415, as GitHub has it
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:
|url=https://github.com/cryptograss/magenta/pull/415
|url=https://github.com/cryptograss/magenta/pull/415
|author=magent-cryptograss
|author=magent-cryptograss
|state=open
|state=merged
|base=main
|base=main
|branch=magent/asks-from-githouse
|branch=magent/asks-from-githouse
|opened=2026-11-07 00:48:11
|opened=2026-11-07 00:48:11
|pushed=2026-11-07 02:22:55
|pushed=2026-11-07 02:22:55
|merged=
|merged=2026-11-07 03:14:44
|closed=
|closed=
|worked_on_by=magent, justin, re
|worked_on_by=magent, justin, re
Line 16: Line 16:
|deploy=redeploy maybelle
|deploy=redeploy maybelle
}}
}}
<pre class="pr-body">The first watch of [[Cryptograss:Moods/ramp/Plan]] section 4: merged is read from git, from the copy we own.
**What changes**
- `services/githouse.py` (new): reads `settings.GITHOUSE_DIR` (maybelle's canonical copies, mounted read-only at `/srv/git` since maybelle-config#250; hunter's mirror in a Mood container). `pull_merged(repo, n)`: is `refs/pull/n/head` an ancestor of one of GitHub's branches (`main`, `master`, `production`, `release/*`). `branch_merged(repo, branch)`: has the name moved to `refs/merged/`. `commit_merged(repo, commit)` is the question a watch asks. Each answers `None` for what githouse doesn't hold, so the caller may still ask GitHub. Merged answers are kept a day, unmerged a minute (githouse's fetch cadence). One uncached check against the real mirror: 19 ms.
- `todo._merged` asks githouse first for any `cryptograss/*` repository; GitHub only when githouse can't say. So the to-do lists tick, and the 🪢 asks clear, without GitHub's API, its unsigned hour, or the webhook.
- Merge asks may name a mergeable: `&lt;merge to="magenta:re/foo"/&gt;` clears when `refs/merged/re/foo` exists. `arthel` and `rabbithole` join the alias table; a repo githouse holds is accepted by its own name.
- `GITHOUSE_DIR` is a real setting now (`/srv/git` default); `/api/branches/` reads it through the service.
- The test runner points `GITHOUSE_DIR` at an empty temp dir: in a Mood container the default is the real mirror, and `test_asks_after_words…` read #313 as merged from it.
**Checked**
- Against hunter's mirror: #408, #333, #413, maybelle-config#250, #280, pickipedia#171 all `True`; the closed-unmerged maybelle-config#246 `False`; a nonexistent number `None`; the closed smoke-test branch `False`.
- `test_githouse` (6 tests on real bare repositories made in the test, including a squash merge reading as unmerged), `test_tools_ask` (+1), `test_branches_api`, `test_tasks`: 57 OK. Full suite running as this is opened; result in #ramp.
**Not in this PR**: the merged *event line* in the Mood still comes only from the webhook; a deploy watch (server, commit) waits on deploys stamping the commit they deployed. Both are section 4's next steps.
Deploy: redeploy maybelle
Worked on by: magent, justin, re, in #ramp</pre>

Latest revision as of 16:06, 9 November 2026

magenta#415: Merge asks and to-do ticks read "merged" from githouse's copy; GitHub only as fallback
State 🟣 merged 2026-11-07 03:14:44
Worked on by magent, justin, re
Moods #ramp
Deploy redeploy maybelle
Branch magent/asks-from-githouse → main, by magent-cryptograss
Opened · last pushed 2026-11-07 00:48:11 · 2026-11-07 02:22:55
The first watch of [[Cryptograss:Moods/ramp/Plan]] section 4: merged is read from git, from the copy we own.

**What changes**
- `services/githouse.py` (new): reads `settings.GITHOUSE_DIR` (maybelle's canonical copies, mounted read-only at `/srv/git` since maybelle-config#250; hunter's mirror in a Mood container). `pull_merged(repo, n)`: is `refs/pull/n/head` an ancestor of one of GitHub's branches (`main`, `master`, `production`, `release/*`). `branch_merged(repo, branch)`: has the name moved to `refs/merged/`. `commit_merged(repo, commit)` is the question a watch asks. Each answers `None` for what githouse doesn't hold, so the caller may still ask GitHub. Merged answers are kept a day, unmerged a minute (githouse's fetch cadence). One uncached check against the real mirror: 19 ms.
- `todo._merged` asks githouse first for any `cryptograss/*` repository; GitHub only when githouse can't say. So the to-do lists tick, and the 🪢 asks clear, without GitHub's API, its unsigned hour, or the webhook.
- Merge asks may name a mergeable: `<merge to="magenta:re/foo"/>` clears when `refs/merged/re/foo` exists. `arthel` and `rabbithole` join the alias table; a repo githouse holds is accepted by its own name.
- `GITHOUSE_DIR` is a real setting now (`/srv/git` default); `/api/branches/` reads it through the service.
- The test runner points `GITHOUSE_DIR` at an empty temp dir: in a Mood container the default is the real mirror, and `test_asks_after_words…` read #313 as merged from it.

**Checked**
- Against hunter's mirror: #408, #333, #413, maybelle-config#250, #280, pickipedia#171 all `True`; the closed-unmerged maybelle-config#246 `False`; a nonexistent number `None`; the closed smoke-test branch `False`.
- `test_githouse` (6 tests on real bare repositories made in the test, including a squash merge reading as unmerged), `test_tools_ask` (+1), `test_branches_api`, `test_tasks`: 57 OK. Full suite running as this is opened; result in #ramp.

**Not in this PR**: the merged *event line* in the Mood still comes only from the webhook; a deploy watch (server, commit) waits on deploys stamping the commit they deployed. Both are section 4's next steps.

Deploy: redeploy maybelle
Worked on by: magent, justin, re, in #ramp