Rename the Elsewhen migration so the link repair reaches machines that already ran it

The re-point of a user plugin link stranded by the elsewhen package moving from plugins/ to shell/plugins/ landed in migration 1789581661, which every machine updated between that migration shipping and the package moving had already applied. omarchy-migrate keys completion on the filename alone, so the repair never ran where it was needed. On a dev checkout the shell discovers the packaged plugin only through that link, and a rescan drops a dangling one, so Elsewhen vanished from the bar on the first shell start after the package upgrade.

Renaming the file runs the whole migration again everywhere. Each step is safe to repeat: the package add is a no-op once installed, both link branches are guarded, the rescan is best-effort, and the put keeps an existing placement. The new test holds a state directory with only the old marker and checks the renamed file is still pending, which the old name could not pass.
This commit is contained in:
Spencer Bull committed 2026-09-21 21:14:46 -05:00
1 parent 5364fea467
commit 73b4fc0d8a
2 files changed
+11 -1

No files matched your search

File renamed without changes.
@@ -39,7 +39,8 @@ SH
chmod +x "$test_dir/bin/"*
mkdir -p "$test_dir/packaged/shell/plugins/omacom.elsewhen"
sed "s|/usr/share/omarchy|$test_dir/packaged|g" "$ROOT/migrations/1789581661.sh" >"$test_dir/migration.sh"
migration="$ROOT/migrations/1790042972.sh"
sed "s|/usr/share/omarchy|$test_dir/packaged|g" "$migration" >"$test_dir/migration.sh"
plugin="$test_dir/home/.config/omarchy/plugins/omacom.elsewhen"
run_migration() {
@@ -120,3 +121,12 @@ grep -q "omacom.elsewhen was not put on the bar" "$test_dir/output" || fail "an
[[ $(readlink "$plugin") == "$test_dir/packaged/shell/plugins/omacom.elsewhen" ]] || fail "the package and plugin link land without a shell"
[[ $(cat "$CALL_LOG") == "$expected" ]] || fail "the rescan is best-effort and the put is still asked" "$(cat "$CALL_LOG")"
pass "an absent shell leaves the update running with the package and link in place"
# The first run of this migration was under 1789581661.sh, before the re-point
# existed; that marker must not stop the renamed file from running there.
state="$test_dir/state"
mkdir -p "$state"
touch "$state/1789581661.sh"
OMARCHY_MIGRATION_STATE="$state" OMARCHY_PATH="$ROOT" "$ROOT/bin/omarchy-migrate" --pending >"$test_dir/pending" || true
grep -qx "$(basename "$migration")" "$test_dir/pending" || fail "the old marker must not satisfy the renamed migration" "$(cat "$test_dir/pending")"
pass "a machine that applied the migration under its old name runs it again"