In Docker, Settings › About on the Daily channel said "0.1.4479 is out … docker pull ghcr.io/yetone/magpie:latest". :latest is the newest release (docker.yml), daily and stable the Daily and Stable channels' (docker-daily.yml, docker-stable.yml), so :latest held 0.1.4504, not the 0.1.4479 announced; on Stable it is weeks apart. docker.yml writes every release's own tag (ghcr.io/yetone/magpie:0.1.4479; checked on ghcr: 4479, 4395, latest, daily, stable, 0.1 all resolve, daily = 4479's digest). update.Image(version) is that tag, and every place that printed the command names it now, with "recreate the container from it" (a compose file on :latest would otherwise run the old tag again): - the GUI's Version row and Update pill (/api/update's new `image`, stuck "container"; app.js updateStuck); - `magpie update` in a container (internal/cli); - a Remote magpie row's tip for a container: UpdateRemotes now keeps the version it asked for on an "unsupported" answer too, so the tip names that version's image; - i18n zh, zh-TW, ja, de for both strings; - docs/docker (en, zh, ja): Updates says Settings › About names the version's own image and that latest may be ahead of the channel; llms-full and search indexes rebuilt (site/docs-index.mjs). Run at this tree (mica, through mica-run): - red on origin/main14b6b9555with the new tests copied in: TestUpdateInContainerSaysPullTheImage (cli: ":latest" in the error), TestRemoteMagpieAskedToFollow (gateway: Version v0.1.100, not the asked v0.1.200), update-stuck.test.cjs container cases and remote-update.test.cjs, both engines; - green here: go test ./internal/update ./internal/cli, internal/gateway and internal/provider -run TestRemote*, internal/gui except TestGatewayModeListsNoOwnSessions, which fails the same on14b6b9555alone (#7064); - go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./..., go build, gofmt -l (nothing); - node --test site/docker-tags.test.mjs; GUI files in chromium and webkit: update-stuck, remote-update, update-channel, update-stable-newest, update-release-page, update-check, lan-docker, i18n-keys, gui-de, gui-zh-tw, i18n-en-no-cjk (216 pass, 0 fail); gui-ja's "ja has every zh string" is red on main for another string (#7144). Not run before the push: the full `go test -tags nogui ./...` (mote and mica each had another session's full suite running); it runs after. Not tried: a real container pulling the new tag. Not checked at runtime: whether the version's image is already on ghcr; docker.yml pushes it in ~6 minutes, before the release is published, and a missing one makes docker pull fail with "manifest unknown", not pull another version.
34 lines
1.2 KiB
Go
34 lines
1.2 KiB
Go
package update
|
|
|
|
import (
|
|
"os"
|
|
"regexp"
|
|
"testing"
|
|
)
|
|
|
|
// The image a magpie in a container names for a release is that
|
|
// release's own tag, the one docker.yml writes, never a floating tag
|
|
// (latest, daily, stable) that may hold another release (fishmagic80 on
|
|
// X: Daily found 0.1.4479 and the hint said :latest).
|
|
func TestImageIsTheReleasesOwnTag(t *testing.T) {
|
|
for in, want := range map[string]string{
|
|
"0.1.4479": "ghcr.io/yetone/magpie:0.1.4479",
|
|
"v0.1.4479": "ghcr.io/yetone/magpie:0.1.4479",
|
|
} {
|
|
if got := Image(in); got != want {
|
|
t.Errorf("Image(%q) = %q, want %q", in, got, want)
|
|
}
|
|
}
|
|
// docker.yml tags a release's image with its version, "v" taken off
|
|
y, err := os.ReadFile("../../.github/workflows/docker.yml")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if !regexp.MustCompile(`V="\$\{GITHUB_REF_NAME#v\}"`).Match(y) || !regexp.MustCompile(`TAGS=\(-t "\$IMAGE:\$V"\)`).Match(y) {
|
|
t.Error("docker.yml no longer tags each release's image with its version; Image names a tag that isn't written")
|
|
}
|
|
if !regexp.MustCompile(`IMAGE: ghcr\.io/\$\{\{ github\.repository_owner \}\}/magpie`).Match(y) || ImageRepo != "ghcr.io/yetone/magpie" {
|
|
t.Error("the image docker.yml pushes isn't ImageRepo")
|
|
}
|
|
}
|