a73x

ea6a7dcc

ship: the tag probe asks the package that now owns ordering

a73x   2026-09-05 17:59

Commit message
ship: the tag probe asks the package that now owns ordering

Version ordering moved to internal/version so the agent could reach it
without importing the server, and the ship script's own probe was left
compiling against internal/server/release.Less. It failed at stage 1 —
before anything was published — with an undefined symbol, which is the
right time to find out but the wrong reason to stop a release.

scripts/ship.sh
Old New
@@ -245,8 +245,8 @@ if [[ "$FROM" -le 1 ]]; then
245 # The version must be parsable by the SAME code the fleet orders versions 245 # The version must be parsable by the SAME code the fleet orders versions
246 # with, because an unparsable one silently disables the upgrade button 246 # with, because an unparsable one silently disables the upgrade button
247 # everywhere at once. Ask that code rather than re-deriving its rule here: 247 # everywhere at once. Ask that code rather than re-deriving its rule here:
248 # any parsable version sorts below an absurdly high one, and an unparsable 248 # internal/version owns the ordering both the server and the agent use, and
249 # version sorts below nothing. 249 # Ordered is that package's own name for "this string has a place in it".
250 probe="$(mktemp -d "$REPO_ROOT/.shipcheck.XXXXXX")" 250 probe="$(mktemp -d "$REPO_ROOT/.shipcheck.XXXXXX")"
251 trap 'rm -rf "$probe"' EXIT 251 trap 'rm -rf "$probe"' EXIT
252 cat >"$probe/main.go" <<-'PROBE' 252 cat >"$probe/main.go" <<-'PROBE'
@@ -256,11 +256,11 @@ if [[ "$FROM" -le 1 ]]; then
256 "fmt" 256 "fmt"
257 "os" 257 "os"
258 258
259 "github.com/a73x/eitri/internal/server/release" 259 "github.com/a73x/eitri/internal/version"
260 ) 260 )
261 261
262 func main() { 262 func main() {
263 if !release.Less(os.Args[1], "v9999.0.0") { 263 if !version.Ordered(os.Args[1]) {
264 fmt.Println("unparsable") 264 fmt.Println("unparsable")
265 return 265 return
266 } 266 }
@@ -271,7 +271,7 @@ if [[ "$FROM" -le 1 ]]; then
271 rm -rf "$probe" 271 rm -rf "$probe"
272 trap - EXIT 272 trap - EXIT
273 if [[ "$parsable" != "parsable" ]]; then 273 if [[ "$parsable" != "parsable" ]]; then
274 fail "$TAG is unparsable to internal/server/release.Less. 274 fail "$TAG is unparsable to internal/version.Ordered.
275 Every agent orders versions with that code, so shipping this tag would 275 Every agent orders versions with that code, so shipping this tag would
276 disable the upgrade button fleet-wide. Releases are vX.Y.Z and 276 disable the upgrade button fleet-wide. Releases are vX.Y.Z and
277 pre-releases are vX.Y.Z-pre.N." 277 pre-releases are vX.Y.Z-pre.N."