Skip the orphan prompt when omarchy update runs with -y - #8894
Skip the orphan prompt when omarchy update runs with -y#8894Chessing234 wants to merge 2 commits into
Conversation
-y sets OMARCHY_UPDATE_UNATTENDED but still has a TTY, so the orphan step waited on gum confirm forever after the upgrade finished.
There was a problem hiding this comment.
Pull request overview
Prevents unattended updates from blocking on orphan-package confirmation.
Changes:
- Skips orphan prompts when
OMARCHY_UPDATE_UNATTENDED=1. - Adds regression coverage for unattended execution.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
bin/omarchy-update-orphan-pkgs |
Treats unattended updates as non-interactive. |
test/shell.d/update-orphan-test.sh |
Adds an unattended-mode test. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # has to be checked explicitly or gum confirm blocks forever. | ||
| write_stub pacman 'if [[ $1 == "-Qtdq" ]]; then printf "old-lib\n"; exit 0; fi; exit 1' | ||
| write_stub gum 'echo "gum should not be called under -y" >&2; exit 99' | ||
| OMARCHY_UPDATE_UNATTENDED=1 run_orphan_checker >"$test_tmp/unattended.out" 2>"$test_tmp/unattended.err" |
|
Reviewed on the merits, with a second opinion from codex at xhigh reasoning. The production change is correct; the test that ships with it does not guard it. The fix itself is right. The new test passes against the unfixed code. That matters because of what the bug actually is. As #8780 sets out, Tests run, on a throwaway VM rather than locally: Codex reached the same conclusion about the test independently, including the file-descriptor reasoning, and found nothing else; its independence is not currently guaranteed, since its sandbox restricts writes and not reads. It did add one thing I had not traced myself, confirming that One gap neither fix for this issue covers: Waiting on the maintainer. A second pull request, #8824, fixes the same issue with the same two files, and the two conflict textually — whichever lands, the other needs a rebase rather than a merge. Which one to take is the maintainer's call, not mine, so I have deliberately not pushed a test fix to your branch: doing that would flatten a difference between the two submissions right as someone has to weigh them. If you would like to fix it yourself, the |
|
@dhh @ryanrhughes ready for review |
Summary
omarchy update -ysetsOMARCHY_UPDATE_UNATTENDEDbut still has a TTY, so the orphan step waited ongum confirmforever after the upgrade finished.Fixes #8780.
Test plan
bash test/shell.d/update-orphan-test.sh(bash 5)omarchy update -ywith orphans present; confirm it exits without prompting