From b8e8f6ced99761913aed267673e64efff649a962 Mon Sep 17 00:00:00 2001 From: Ben Firestone Date: Sat, 5 Sep 2026 22:08:39 -0700 Subject: [PATCH] fix(self): update go-selfupdate to v0.1.2 --- README.md | 12 +++++++----- cmd/arc/self_test.go | 17 +++++++++++++++++ go.mod | 2 +- go.sum | 4 ++-- 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 11e802f..777e717 100644 --- a/README.md +++ b/README.md @@ -497,11 +497,13 @@ task docker:up ### Release candidates and nightlies Tag release candidates on `main` with the next version and a dotted counter: -`v0.16.0-rc.1`, `v0.16.0-rc.2`. The dot matters from the tenth candidate on. -Semver compares `rc.10` and `rc.9` numerically but `rc10` and `rc9` lexically. -Without the dot, `v0.16.0-rc10` sorts below `v0.16.0-rc9` and the rc channel -never offers it. `arc self update` asks for confirmation before installing. -Pass `-y` or `--yes` to skip the prompt in scripts. +`v0.16.0-rc.1`, `v0.16.0-rc.2`. Arc also compares legacy counters numerically: +`rc9` sorts below `rc10`, and `rc10` compares equal to `rc.10`. The original +release tag is preserved for downloads. Older Arc binaries may need a one-time +`arc self update --force` when switching from undotted to dotted RC tags. + +`arc self update` asks for confirmation before installing. Pass `-y` or `--yes` +to skip the prompt in scripts. Nightlies are tagged automatically as `v-nightly.`. The next patch, not the released version, is what makes a nightly sort above the current diff --git a/cmd/arc/self_test.go b/cmd/arc/self_test.go index 3a32dcb..30b8e32 100644 --- a/cmd/arc/self_test.go +++ b/cmd/arc/self_test.go @@ -55,6 +55,23 @@ func TestSelfUpdaterWiring(t *testing.T) { assert.NotNil(t, u.PreInstall) } +func TestSelfUpdaterRecognizesLegacyRCUpdates(t *testing.T) { + for _, latest := range []string{"v0.16.0-rc10", "v0.16.0-rc.10"} { + t.Run(latest, func(t *testing.T) { + u := newSelfUpdater() + u.Version = "v0.16.0-rc9" + u.Source = fakeSource{tag: latest} + u.Store = &selfupdate.MemStore{Current: selfupdate.ChannelRC} + + result, err := u.Check(t.Context()) + require.NoError(t, err) + assert.Positive(t, result.Cmp, "the next RC must be offered without --force") + assert.Equal(t, "v0.16.0-rc9", result.Current) + assert.Equal(t, latest, result.Latest) + }) + } +} + // channelCmdName is the "channel" subcommand's name. const channelCmdName = "channel" diff --git a/go.mod b/go.mod index d14747a..197813d 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/labstack/echo/v4 v4.15.0 github.com/oapi-codegen/runtime v1.1.2 github.com/pressly/goose/v3 v3.26.0 - github.com/sentiolabs/go-selfupdate v0.1.1 + github.com/sentiolabs/go-selfupdate v0.1.2 github.com/spf13/cobra v1.10.2 github.com/spf13/pflag v1.0.9 github.com/stretchr/testify v1.11.1 diff --git a/go.sum b/go.sum index cc13990..cb666f0 100644 --- a/go.sum +++ b/go.sum @@ -171,8 +171,8 @@ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qq github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sentiolabs/go-selfupdate v0.1.1 h1:76DV5ZJyldwHtDUWD1AMH145QTNOMB7OXzrfq+RIm3E= -github.com/sentiolabs/go-selfupdate v0.1.1/go.mod h1:EWIEmMHrf3qT8mxGo4GkZSlSNvbCrAdPWDthNrgvCiA= +github.com/sentiolabs/go-selfupdate v0.1.2 h1:YU11mxu2YvB8GSQy0Zag+AgpRWkkXn5bovYOFFscbt8= +github.com/sentiolabs/go-selfupdate v0.1.2/go.mod h1:EWIEmMHrf3qT8mxGo4GkZSlSNvbCrAdPWDthNrgvCiA= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sethvargo/go-retry v0.3.0 h1:EEt31A35QhrcRZtrYFDTBg91cqZVnFL2navjDrah2SE=