Commit Graph
1 Commits
Author SHA1 Message Date
yetone 0e9af21ff3 library: a plugin from a git download keeps one name across updates (#7269)
A plugin at the top of a git or GitHub download was named after the temp
folder it was cloned into (magpie-skill-<random>), so each Update read a new
name and added a second bundle, while the project's .pi/settings.json kept
pointing at the first folder and Pi went on loading v1 (jinpwng, v0.1.4572).

- rootName names the download's top after the repository (file:///x/acme.git
  is "acme", owner/repo is "repo", git@host:a/b.git is "b"); a folder inside
  the download, or a local folder, keeps its own name.
- UpdatePlugin of a one-plugin source installs under the bundle's own name,
  so a bundle a magpie before this named magpie-skill-... is updated in place
  too: same folder, same project assignment, same Pi entry.

Run (mote): go test ./internal/library -run
'TestPluginRootName|TestPiPackageFromGitUpdatesInPlace|TestPluginUpdateKeepsItsName|Plugin'
-count=1 -timeout 45m: ok. Full suite with the batch's last commit.
Real Pi: a throwaway test drove Pi 1.5.2 (npm, --mode rpc --approve) in a
sandbox HOME against a project the Library gave the git package to. With
this change: one bundle "skills" (the repo's name), get_commands acme-v1
before and acme-v2 after Update, settings.json unchanged. Broken by hand:
the same run on origin/main's plugin.go gave bundles
[magpie-skill-332298903 magpie-skill-745278034] and Pi still listed acme-v1
after Update; the two new Go tests were red there too (temp-folder name;
two bundles).
Not tried: the reporter's own repository.
2026-11-20 12:06:44 +08:00