ARNO installed opencode-codearts-auth as github:yuweihao17/codearts. Its row
on Plugins always had an Update button, and still did right after updating
it to the newest commit. The page drew Update for every git plugin whatever
its commit, since npm has no version to compare for one, and nothing asked
the repository. ba0e2a8a fixed the same complaint for pinned npm plugins
only.
A git plugin is now compared by commit:
- internal/plugin/gitrev.go reads the commit Bun installed: the package's
.bun-tag (owner-repo-<sha7> for GitHub's, the full sha for a clone),
else bun.lock's "#<sha>". It asks where the spec's branch or tag (the
default branch without #ref) is now: GitHub's API (commits?per_page=1
[&sha=ref]) for github:o/r, o/r, https://github.com/o/r and
git+https/git+ssh/git:// URLs on github.com; git ls-remote for gitlab:,
bitbucket: and any other git URL (an annotated tag's commit, not the
tag's). A spec pinned to a commit is that commit, asked of nobody.
Answers are kept 10 minutes (GitHub allows 60 unauthenticated requests
an hour).
- updates.go: the hourly CheckUpdates and the Check for updates button
(CheckNow) report a git plugin as current or update, with its commit
and the repository's head, in place of the old "git" status. A waiting
git update is dropped once the installed commit is the head.
- GUI: /api/plugins/git gives the heads, asked after load and after an
install or update. The row shows the commit installed. Update, the
"New commits" chip, the Discover card's Update and Update all show only
when the repository is at another commit. Five new strings are in zh,
zh-TW, ja and de.
- Docs: the Updates list in site/public/docs (en, zh, ja) says how a git
plugin's update is told.
Tarball specs are unaffected, since magpie plugin add refuses them as not
a package name.
Run:
- go test -tags nogui ./internal/plugin ./internal/gui (temp HOME): ok.
- New TestGitPluginUpdateOnlyWhenItsRepositoryMoved, for
github:yuweihao17/codearts, its #main form, owner/repo, the
https://github.com URL, git+file and git+file#main, against a fake
GitHub API and bare repositories. After add, nothing waits. A new
commit at the same version is an update. After Upgrade, nothing waits
again.
- TestGitCommitAsBunWritesIt uses ARNO's literal bun.lock line and
.bun-tag. TestGitSource covers spec parsing and the pinned-sha form.
- Broke GitBehind by hand (any installed commit is behind): the new test
goes red in every form. Restored.
- GUI: plugin-git.test.cjs now checks no Update at the head, then New
commits with Update and Update all once the head moves, then none after
Update. It went red with the old condition put back. All 28 plugin-*
files plus click-scroll, i18n-keys, gui-ja and gui-de pass in Chromium
and WebKit.
- Real case, sandbox HOME, magpie web on a spare port: magpie plugin add
github:yuweihao17/codearts installed c594984. /api/plugins/git and
/api/plugins/check say current at c594984 against the real GitHub, and
nothing is waiting. In both engines the row shows "v0.1.0 c594984" with
no Update and no Update all.
- gofmt -l clean; go vet -tags nogui darwin, GOOS=linux and GOOS=windows
on internal/plugin and internal/gui.
What: Update, Update all, the hourly auto-update and the move's install
ask npm for the plugin's newest version and have bun install that exact
version (installAt), then check it is the one installed. When bun won't,
the error says why, reason first for the status pill: "<pkg> 0.1.21 isn't
installed yet: Bun's minimumReleaseAge (in a .bunfig.toml) holds back
versions published less than 2 days ago, and magpie installs it once it
is older (bun's own words)". Another bun error (a registry of the user's
own without the version) is "<pkg> <v> isn't installed: <bun's error:
lines>". Specs stay as they were (name@latest); pinned and git plugins,
and npm not answering, install as their spec says, as before.
Why: the Factory card stayed at 0.1.18 with 0.1.21 out, through clicking
update and restarts. bun add pkg@latest resolves "latest" by bun's own
config: a minimumReleaseAge in the user's ~/.bunfig.toml or
$XDG_CONFIG_HOME/.bunfig.toml makes it install the newest version older
than that and exit 0. 172800s (2 days) gives exactly 0.1.18 (0.1.19-21
were published 10-08). So every update path succeeded with nothing
changed, and the page said "updated to v0.1.21". Asked for 0.1.21 itself,
bun fails with "blocked by minimum-release-age: 172800 seconds". The same
code serves every moved plugin (Cursor, Devin, Kiro, Qoder, ...), so all
of them had it. npm view: 0.1.21 is latest; npmmirror has it too.
Run:
- TestUpdateBunHoldsBackSaysWhy (new): real bun 1.4.2 against a fake
registry with 0.1.18 (3 days old) and 0.1.21 (1 hour), a bunfig with
minimumReleaseAge = 172800. On the old code it fails: "Update with
0.1.21 held back by Bun: <nil>, want bun's reason (installed 0.1.18)".
Breaking Update alone fails at "Update all: <nil>", breaking the hourly
update alone at "the hourly update: <nil>". Without the bunfig it
installs 0.1.21 and keeps the spec @latest.
- Real use: magpie web (nogui build) under a sandbox HOME, real npm, with
the bunfig: add factory-auth@0.1.18, spec @latest, POST
/api/plugins/upgrade and /update return the reason above, the card
stays 0.1.18; bunfig removed, upgrade installs 0.1.21.
- Ruled out on macOS and the Windows box: plain upgrade 0.1.18 -> 0.1.21
works there without a bunfig, host running or not.
- gofmt -l; go vet (darwin, GOOS=linux, GOOS=windows, -tags nogui) on
internal/plugin, internal/provider, internal/gui; go build (darwin),
GOOS=linux and GOOS=windows -tags nogui builds; go test -tags nogui ./...
under a temp HOME, all ok.