The Plugins page's Discover lists the repositories tagged
magpie-plugin, and keeps what each one's package.json, npm and the
file it names made of it by `owner/repo@pushed_at`, so a repository
is read once a push. raw.githubusercontent.com can answer from before
a push for a while after it (its answers, a 404 too, say they stand
five minutes): the package.json or the file it names missing, or the
package.json as it was. A read then was kept for the push, so a
repository read as missing stayed out of the list until magpie
started again or the repository was pushed to again (MengXiangxi
on #3821, #4067).
Now a read less than rawFresh, ten minutes, after the push is shown
as any read is, and read again at the next ask; one rawFresh or more
after the push is kept for the push, as before. When it was read is
what counts: a whole list stands ten minutes, so the next ask is
often past rawFresh, and judged then, a 404 read a minute after the
push would be kept. A read again that comes in after the page stops
waiting is shown at the ask after, as any late read is; one that
gets no answer leaves the repository as it was read. A list is asked
again when its time is up: ten minutes for a whole one, 20 seconds
for one cut short, a minute after a failed search, and at once on
Try again when it isn't whole. So such a repository is read about
once more.
raw's answers have no Age, and their Expires is each answer's own
date plus five minutes, but they carry Source-Age, how long raw's
cache has held them, a 404's too: 2s after a push, raw's 404 had
Source-Age 20, cached before the push (below). This reads no headers
(fetchJSON keeps none) and goes by the time since the push.
What was run (tree 00637ea4, on origin/main 174250b2, go1.26.8,
linux/amd64, Linux 5.15), outside graftcp, the Go tests at umask 077:
- raw.githubusercontent.com, on a branch of JoeyWu-tech/magpie made
for it and deleted after, twice: at a commit without a file, the
file read 404, x-cache MISS, then HIT; the branch pushed on to a
commit that has the file, raw still answered 404 (x-cache HIT) 1s
or 2s and 23s after the push, and 200 (MISS) at 48s and 49s. The
second time kept Source-Age: 0, 6 and 13 for the 404s before the
push, 20 and 41 for those after it, 0 for the 200. An earlier try
stopped at its first read after the push: 404, HIT, 2s after.
- TestTaggedReadSoonAfterAPushIsReadAgain, new: GitHub's search, raw
and npm faked, someone/fresh pushed a minute ago and someone/old an
hour ago, each with word-guard's files (a middleware alone), npm
having neither. Six asks, each with the list's ten minutes run out:
with raw's 404 for fresh's package.json, then for the middleware
file it names, fresh is left out; with both there, the next ask has
it at 0.1.1; with its package.json at 0.1.2, the next has 0.1.2.
rawFresh then set under the minute since the push, as ten minutes
on, the next reads it again and has 0.1.3, and the one after keeps
0.1.3 with 0.1.4 on raw. old's package.json is read once in six.
- TestTaggedLateReadSoonAfterAPushIsShown, new: the same fakes, old
read first, taggedWait at 2s. fresh's package.json held, the page
stops waiting with one missing; once that read is in, the next ask,
raw answering 503 for fresh at once, has fresh at 0.1.1 with no
error; the next, its package.json at 0.1.2 and held again, has 0.1.1
still, with no error; once that read is in, the next has 0.1.2 with
no error. old's package.json is read once in five.
- Both at -count=20: 20 of 20 each.
- Broken by hand, each red, then put back: a read shown and never
read again, as on main: the first test red at its third ask, and in
the late test 0.1.2 is never read; soon judged when asked, not when
read: red at the fifth ask, 0.1.2 not read again; a read that found
the repository kept at once: red at the fourth ask, 0.1.1, and in
the late test 0.1.2 is never read; no read kept for good: red at the
sixth ask, 0.1.4, and the late test reads old's package.json 5
times; a read that soon after the push not kept: the late test red,
its late read never kept; a read again with no answer taking the
place of the one shown: the late test red at its third ask, fresh
missing (503).
- go test -tags nogui -race -count=20 -run '^TestTagged'
./internal/plugin: 160 of 160 pass (the eight TestTagged tests),
no race reported.
- go test -tags nogui -count=1 -v ./internal/plugin, Bun 1.4.2 first
on PATH: 228 pass, none red, 2 skip (TestFlowBigReplyProd, opt in;
TestRenewOtherHost, run by TestRenewOnceAcrossHosts).
- gofmt -l clean. go vet -tags nogui for linux, windows and darwin, go
vet for windows, go build -tags nogui for linux and darwin and go
build for windows: exit 0 each. go vet and go build without the tag
on linux: exit 1 (no libsoup-3.0 or gio-unix-2.0 here).
- go test -tags nogui -count=1 -timeout 45m ./... (Bun 1.4.2, log kept;
8m55s, load 31 at its start): 71 packages ok, and 14 tests red in 6
packages, none in internal/plugin: agent TestInstalledVersion,
TestCopilotFolderFromAnIDEPluginIsNotTheCLI,
TestQoderSettingsFromAnIDEPluginIsNotTheCLI, TestOmpDetectedWithPiDir
and TestZedAppPath (#3141), TestCodexBehindReverseProxy (#3398),
TestReasonixCLIRequiresSupportedNativeVersion and
TestReasonixCLIRecoversAfterProbeTimeout (#3641); davsync
TestSyncTeraCloudStillSeesOtherWrites (#3420); edit
TestWriteAtomicReadOnlyHardLink and testenv TestProgram (#3640, at
umask 077); gateway TestPluginToldWhereTheAgentWorks (#3675, the
/tmp/.git); gui TestGatewayHeldByAContainer and
TestGatewayFixQuitsOnlyAMagpie (#3649).
Not tried: macOS and Windows; a repository tagged magpie-plugin,
pushed to and read by the real Plugins page (a tagged repository is
listed for every user).
Reviewed and run again by the maintainer at the stack's tree 45994757c
(this commit and the six beside it, on origin/main 90518de26), go1.26.8:
- mote (macOS, arm64): gofmt -l clean; go vet and go build for darwin,
GOOS=linux -tags nogui and GOOS=windows (library, plugin, gui): exit 0.
go test -tags nogui -count=1 -timeout 45m ./...: every package ok but
internal/gui TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
internal/proc TestNoCommandBypassesProc (#4491), both red on main
from b09349d17 and c59c547c5, in files this stack doesn't touch.
go test -race -run 'TestWSL|TestTagged|TestPinnedPiCache' for
library and plugin: ok.
- magpie-desktop (Linux, wsl-run; WebKit hangs on mote), Chromium and
WebKit: every library-*, sync-*, s3-sync, github-sync and i18n-keys
file, 4 at a time: 1003 of 1020. The 17 reds are in 6 files no commit here
touches: i18n-keys ("Unmarked", #4524), library-chip-fan, -items,
-mcp-health, -mcp-hub (#4483) and -mcp-tools. Those 6 alone, one at a
time, at load ~60: 74 of 92 here, 77 of 92 at 90518de26 itself. Red
in both: i18n-keys, -chip-fan and -items in WebKit, -mcp-tools in
Chromium ja 420; -mcp-health green in both; -mcp-hub's WebKit case
red here only, the case #4483 has red on main. -chip-fan and -items
are #3072's and #4501's kind, WebKit under load.
- Broken by hand on mote: with a read just after a push kept as any
other (`if true || !soon`), TestTaggedReadSoonAfterAPushIsReadAgain
("raw has its files now: someone/old@0.1.1") and
TestTaggedLateReadSoonAfterAPushIsShown ("late read never kept:
0.1.1, want 0.1.2") are red.