VersionControl:PRs/magenta/404: 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#404, as GitHub has it |
cryptograss/magenta#404, as GitHub has it ย |
||
| Line 16: | Line 16: | ||
|deploy= | |deploy= | ||
}} | }} | ||
<pre class="pr-body">Justin, in #interfaces (5โ6 Nov): a User page edit took hours to reach the card; pulling is inefficient; notification of every edit should fire from PickiPedia, magenta should have a discrete list of pages that matter and hooks that run when they change, and it should all be logged. | |||
**The hooks**: one registry, `services/wiki_hooks.yml` (a YAML file beside `wiki_hooks.py`, which runs it), each entry naming the pages it is for (exact titles, or `*` / `**` patterns), what it does in words, and the function that does it: forget what's kept of the page and read it again now, so it's warm before anyone looks. The interface's words pages, the FAQ, clips, voice words, tour, slogans, eras, the current sprint, a person's card (User:*), an emergent's page, a Mood's instructions and to-do list, a File: embed, a Release:. Any other page is forgotten (`wiki_changes.forget`) and read again when next asked for. `run(title, user, revid, via)` is the one road in. | |||
**The push** (`api_wiki_hook`, `/api/wiki/hook/`): PickiPedia POSTs each save, move and upload ([pickipedia#175](https://github.com/cryptograss/pickipedia/pull/175)), signed `X-Magenta-Signature: sha256=<HMAC>` with `WIKI_HOOK_SECRET` ([maybelle-config#279](https://github.com/cryptograss/maybelle-config/pull/279)). The page's hooks run at once and the revision is remembered as pushed. Unsigned or wrongly signed: 403, kept apart in the log's header as the GitHub hook does. | |||
**The sweep** (`services/wiki_changes.py`): once a minute on the pulse's clock, everyone's recent changes, bots included. A change the push told of is left to it; any other runs the same hooks (`via=sweep`). Once a push has ever been heard, a change no push told of, after a 90 s grace, is a ๐ก line in #ops. Until the first push, the sweep says nothing of it. | |||
**The log**: every run is a `WikiHookRun` row (page, revision, editor, hook, via, took, result; the newest 2,000 kept). `/wiki-hooks/` shows the registry, the log and what the push last said; `/api/wiki-hooks/` is the same as JSON. A hook that fails is a โ line in #ops as well. | |||
Not reached from here: the poller's own copies on hunter (the wake texts and dials, five minutes; the bundle's layers, by revision). | |||
Tests: `test_wiki_hooks` (registry, runs, failure to #ops, the log, the page, the push's signature and a pushed change left to its push), `test_wiki_changes`; the whole suite, 1,709 pass. | |||
Order: merge this and redeploy maybelle (the migration runs); merge pickipedia#175 and redeploy pickipedia; make the secret, put it in the vault and in LocalSettings.local.php on the wiki host; merge maybelle-config#279 and redeploy maybelle. Each step works without the next. | |||
Redeploy: maybelle | |||
Worked on by: magent, justin, re, in #interfaces</pre> | |||
Latest revision as of 16:06, 9 November 2026
| State | ๐ฃ merged 2026-11-06 16:58:14 |
|---|---|
| Worked on by | magent, justin, re |
| Moods | #interfaces |
| Deploy | not said |
| Branch | wiki-changes โ main, by magent-cryptograss
|
| Opened ยท last pushed | 2026-11-05 23:43:02 ยท 2026-11-06 16:50:39 |
Justin, in #interfaces (5โ6 Nov): a User page edit took hours to reach the card; pulling is inefficient; notification of every edit should fire from PickiPedia, magenta should have a discrete list of pages that matter and hooks that run when they change, and it should all be logged. **The hooks**: one registry, `services/wiki_hooks.yml` (a YAML file beside `wiki_hooks.py`, which runs it), each entry naming the pages it is for (exact titles, or `*` / `**` patterns), what it does in words, and the function that does it: forget what's kept of the page and read it again now, so it's warm before anyone looks. The interface's words pages, the FAQ, clips, voice words, tour, slogans, eras, the current sprint, a person's card (User:*), an emergent's page, a Mood's instructions and to-do list, a File: embed, a Release:. Any other page is forgotten (`wiki_changes.forget`) and read again when next asked for. `run(title, user, revid, via)` is the one road in. **The push** (`api_wiki_hook`, `/api/wiki/hook/`): PickiPedia POSTs each save, move and upload ([pickipedia#175](https://github.com/cryptograss/pickipedia/pull/175)), signed `X-Magenta-Signature: sha256=<HMAC>` with `WIKI_HOOK_SECRET` ([maybelle-config#279](https://github.com/cryptograss/maybelle-config/pull/279)). The page's hooks run at once and the revision is remembered as pushed. Unsigned or wrongly signed: 403, kept apart in the log's header as the GitHub hook does. **The sweep** (`services/wiki_changes.py`): once a minute on the pulse's clock, everyone's recent changes, bots included. A change the push told of is left to it; any other runs the same hooks (`via=sweep`). Once a push has ever been heard, a change no push told of, after a 90 s grace, is a ๐ก line in #ops. Until the first push, the sweep says nothing of it. **The log**: every run is a `WikiHookRun` row (page, revision, editor, hook, via, took, result; the newest 2,000 kept). `/wiki-hooks/` shows the registry, the log and what the push last said; `/api/wiki-hooks/` is the same as JSON. A hook that fails is a โ line in #ops as well. Not reached from here: the poller's own copies on hunter (the wake texts and dials, five minutes; the bundle's layers, by revision). Tests: `test_wiki_hooks` (registry, runs, failure to #ops, the log, the page, the push's signature and a pushed change left to its push), `test_wiki_changes`; the whole suite, 1,709 pass. Order: merge this and redeploy maybelle (the migration runs); merge pickipedia#175 and redeploy pickipedia; make the secret, put it in the vault and in LocalSettings.local.php on the wiki host; merge maybelle-config#279 and redeploy maybelle. Each step works without the next. Redeploy: maybelle Worked on by: magent, justin, re, in #interfaces