From d4ad44c9f660b656bd58e64c75e3188cccc25ee1 Mon Sep 17 00:00:00 2001 From: Emir Beganovic Date: Sat, 10 Oct 2026 00:41:07 +0200 Subject: [PATCH 1/3] Upgrade test: work against rc, and say at once when there is nothing to upgrade to Run against rc, the test stopped at a password prompt and then at a question, each until its 30 minute limit. sudo asked for a password although the test had written a rule that lets it through: sudo takes the last rule that matches and reads its folder in name order, and the rule's name sorted before the install's own. The release's updater also runs "sudo -v", which asks unless every rule for the user lets it through. The rule now sorts last, turns the question off for the user, and the test checks both before going on. rc holds what stable holds today. The release's updater, run with nothing to do, ends at a prompt nobody answers. The test now asks the channel what it offers before it starts, and with nothing newer on offer it stops in seconds and says so. The comment shows the two pictures only when both exist. --- .github/workflows/upgrade-test.yml | 2 +- test/upgrade-test | 25 ++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/upgrade-test.yml b/.github/workflows/upgrade-test.yml index 800f5da..638fc13 100644 --- a/.github/workflows/upgrade-test.yml +++ b/.github/workflows/upgrade-test.yml @@ -195,7 +195,7 @@ jobs: else echo "**The test did not get as far as a report** (job result: $RESULT)." fi - if [ -n "$PICTURES" ]; then + if [ -n "$PICTURES" ] && [ -s evidence/before.png ] && [ -s evidence/after.png ]; then echo echo "| Before, $FROM | After, on $TO |" echo "| --- | --- |" diff --git a/test/upgrade-test b/test/upgrade-test index 2bd9c76..34d4148 100755 --- a/test/upgrade-test +++ b/test/upgrade-test @@ -131,7 +131,13 @@ log "Booting the installed system" wait_ssh 300 || { echo "upgrade-test: the installed system did not come up" >&2; exit 1; } # The overlay is thrown away: let sudo through without asking, so a long # update does not stop at a password prompt nobody is there to answer. -ssh "${ssh_opts[@]}" omarchy@127.0.0.1 "echo $(printf %q "$pw") | sudo -S -p '' sh -c 'echo \"omarchy ALL=(ALL) NOPASSWD: ALL\" >/etc/sudoers.d/99-upgrade-test'" /etc/sudoers.d/zzz-upgrade-test'" &2; exit 1; } guest 'timeout 180 systemctl is-system-running --wait >/dev/null 2>&1 || true' facts "$out/before.txt" desktop_shot "$out/before.png" @@ -142,6 +148,23 @@ for migration in ${EXTRA_MIGRATIONS:-}; do ssh "${ssh_opts[@]}" omarchy@127.0.0.1 "sudo tee /usr/share/omarchy/migrations/$(basename "$migration") >/dev/null" <"$migration" done +# A channel that offers what the machine already has is no upgrade. Say so +# now: the release's own updater, run with nothing to do, ends at a prompt +# nobody is there to answer. +case $channel in edge) package=omarchy-dev ;; *) package=omarchy ;; esac +offered=$(guest "curl -fsSL --retry 3 https://pkgs.omarchy.org/$channel/\$(uname -m)/omarchy.db | bsdtar -xOf - '$package-[0-9]*/desc' | sed -n '/^%VERSION%\$/{n;p;}'" 2>/dev/null | head -n 1) +installed=$(guest "pacman -Q $package 2>/dev/null | cut -d' ' -f2" 2>/dev/null) +log "The $channel channel offers $package ${offered:-nothing}; installed: ${installed:-none}" +if [[ -z $offered || $offered == "$installed" ]]; then + { + echo "**Nothing to upgrade to.** The $channel channel offers \`$package ${offered:-nothing}\`, and the machine has \`$(fact "$out/before.txt" omarchy)\`." + echo + echo "The test did not run: point it at a channel that holds a newer Omarchy." + } >"$out/report.md" + cat "$out/report.md" + exit 1 +fi + log "omarchy-channel-set $channel" update_start=$SECONDS guest "timeout ${UPDATE_TIMEOUT:-1800} omarchy-channel-set $channel" >"$out/update.log" 2>&1 From 40c5fb8e988677119b6a1e0bba651b813990efee Mon Sep 17 00:00:00 2001 From: Emir Beganovic Date: Sat, 10 Oct 2026 00:46:10 +0200 Subject: [PATCH 2/3] Upgrade test: an older offer is nothing to upgrade to either, and show a stuck reboot by itself The early stop compared the offered version with the installed one for equality. Started from a release newer than the channel holds, the test went on to the updater with nothing to install. It now asks pacman's vercmp and stops when the offer is the same or older. The picture of a reboot that stuck was inside the condition that wants both the before and the after picture, so it was left out exactly when there was no after to show. It now has its own condition. --- .github/workflows/upgrade-test.yml | 14 ++++++++------ test/upgrade-test | 11 +++++++---- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/upgrade-test.yml b/.github/workflows/upgrade-test.yml index 638fc13..c86a40c 100644 --- a/.github/workflows/upgrade-test.yml +++ b/.github/workflows/upgrade-test.yml @@ -200,12 +200,14 @@ jobs: echo "| Before, $FROM | After, on $TO |" echo "| --- | --- |" echo "| ![before]($PICTURES/before.png) | ![after]($PICTURES/after.png) |" - if [ -s evidence/stuck.png ]; then - echo - echo "The reboot did not come back by itself. This is what the screen showed:" - echo - echo "![stuck]($PICTURES/stuck.png)" - fi + fi + # The picture of a reboot that stuck stands by itself: it is the + # one worth having when there is no "after" to show. + if [ -n "$PICTURES" ] && [ -s evidence/stuck.png ]; then + echo + echo "The reboot did not come back by itself. This is what the screen showed:" + echo + echo "![stuck]($PICTURES/stuck.png)" fi echo echo "[Run $GITHUB_RUN_ID]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID), attempt $GITHUB_RUN_ATTEMPT, at \`${GITHUB_SHA:0:7}\`." diff --git a/test/upgrade-test b/test/upgrade-test index 34d4148..729127e 100755 --- a/test/upgrade-test +++ b/test/upgrade-test @@ -148,14 +148,17 @@ for migration in ${EXTRA_MIGRATIONS:-}; do ssh "${ssh_opts[@]}" omarchy@127.0.0.1 "sudo tee /usr/share/omarchy/migrations/$(basename "$migration") >/dev/null" <"$migration" done -# A channel that offers what the machine already has is no upgrade. Say so -# now: the release's own updater, run with nothing to do, ends at a prompt -# nobody is there to answer. +# A channel that offers what the machine already has, or something older, is +# no upgrade. Say so now: the release's own updater, run with nothing to do, +# ends at a prompt nobody is there to answer. case $channel in edge) package=omarchy-dev ;; *) package=omarchy ;; esac offered=$(guest "curl -fsSL --retry 3 https://pkgs.omarchy.org/$channel/\$(uname -m)/omarchy.db | bsdtar -xOf - '$package-[0-9]*/desc' | sed -n '/^%VERSION%\$/{n;p;}'" 2>/dev/null | head -n 1) installed=$(guest "pacman -Q $package 2>/dev/null | cut -d' ' -f2" 2>/dev/null) log "The $channel channel offers $package ${offered:-nothing}; installed: ${installed:-none}" -if [[ -z $offered || $offered == "$installed" ]]; then +# pacman's own ordering: 0 for the same version, below 0 for an older offer. +newer=1 +[[ -z $installed ]] || newer=$(guest "vercmp $(printf %q "${offered:-0}") $(printf %q "$installed")" 2>/dev/null) +if [[ -z $offered ]] || (( ${newer:-0} <= 0 )); then { echo "**Nothing to upgrade to.** The $channel channel offers \`$package ${offered:-nothing}\`, and the machine has \`$(fact "$out/before.txt" omarchy)\`." echo From 3e21939b9e24bee064a7cd1b72fbfcba3e254698 Mon Sep 17 00:00:00 2001 From: Emir Beganovic Date: Sat, 10 Oct 2026 00:57:46 +0200 Subject: [PATCH 3/3] Upgrade test: a channel that cannot be asked is a failure of its own The question to the channel had no time limit, and a download that failed gave an empty answer, which the test read as nothing on offer. A server that held the connection open could keep the test until the job's limit, and one that was down made it report "Nothing to upgrade to". The request now has a deadline, a failure anywhere in it counts, and the test stops with its own message and the last lines of what went wrong. --- test/upgrade-test | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/test/upgrade-test b/test/upgrade-test index 729127e..b25360c 100755 --- a/test/upgrade-test +++ b/test/upgrade-test @@ -152,15 +152,27 @@ done # no upgrade. Say so now: the release's own updater, run with nothing to do, # ends at a prompt nobody is there to answer. case $channel in edge) package=omarchy-dev ;; *) package=omarchy ;; esac -offered=$(guest "curl -fsSL --retry 3 https://pkgs.omarchy.org/$channel/\$(uname -m)/omarchy.db | bsdtar -xOf - '$package-[0-9]*/desc' | sed -n '/^%VERSION%\$/{n;p;}'" 2>/dev/null | head -n 1) +# A server that cannot be reached, or does not answer in time, is not a channel +# with nothing on offer: that is a failure of its own, said as one. +if ! offered=$(guest "set -o pipefail; curl -fsSL --connect-timeout 20 --max-time 120 --retry 2 https://pkgs.omarchy.org/$channel/\$(uname -m)/omarchy.db | bsdtar -xOf - '$package-[0-9]*/desc' | sed -n '/^%VERSION%\$/{n;p;}' | head -n 1" 2>"$out/probe.log") || [[ -z $offered ]]; then + { + echo "**The $channel channel could not be asked what it offers.** The test did not run." + echo + echo '```' + tail -n 5 "$out/probe.log" + echo '```' + } >"$out/report.md" + cat "$out/report.md" + exit 1 +fi installed=$(guest "pacman -Q $package 2>/dev/null | cut -d' ' -f2" 2>/dev/null) -log "The $channel channel offers $package ${offered:-nothing}; installed: ${installed:-none}" +log "The $channel channel offers $package $offered; installed: ${installed:-none}" # pacman's own ordering: 0 for the same version, below 0 for an older offer. newer=1 -[[ -z $installed ]] || newer=$(guest "vercmp $(printf %q "${offered:-0}") $(printf %q "$installed")" 2>/dev/null) -if [[ -z $offered ]] || (( ${newer:-0} <= 0 )); then +[[ -z $installed ]] || newer=$(guest "vercmp $(printf %q "$offered") $(printf %q "$installed")" 2>/dev/null) +if (( ${newer:-0} <= 0 )); then { - echo "**Nothing to upgrade to.** The $channel channel offers \`$package ${offered:-nothing}\`, and the machine has \`$(fact "$out/before.txt" omarchy)\`." + echo "**Nothing to upgrade to.** The $channel channel offers \`$package $offered\`, and the machine has \`$(fact "$out/before.txt" omarchy)\`." echo echo "The test did not run: point it at a channel that holds a newer Omarchy." } >"$out/report.md"