<feed xmlns='http://www.w3.org/2005/Atom'>
<title>archsetup/tests/run-task/test_run_task.py, branch main</title>
<subtitle>Builds a full dev workstation from a bare Arch Linux install.
</subtitle>
<id>https://git.cjennings.net/archsetup/atom?h=main</id>
<link rel='self' href='https://git.cjennings.net/archsetup/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/archsetup/'/>
<updated>2026-06-27T17:44:13+00:00</updated>
<entry>
<title>refactor: collapse describe-run-warn idiom into run_task helper</title>
<updated>2026-06-27T17:44:13+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-06-27T17:44:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/archsetup/commit/?id=ba07886525acfb78999d98c4c1a06bc4c08e8d95'/>
<id>urn:sha1:ba07886525acfb78999d98c4c1a06bc4c08e8d95</id>
<content type='text'>
The installer announced, ran, and warned on each operation with a
hand-written two-line pair, repeated ~35 times:

    action="enabling rngd service" &amp;&amp; display "task" "$action"
    systemctl enable rngd &gt;&gt; "$logfile" 2&gt;&amp;1 || error_warn "$action" "$?"

I added a run_task "desc" cmd... helper that does this in one line, plus an
enable_service wrapper for the canonical "enabling &lt;unit&gt; service" case. The
35 single-command sites now call run_task. The three exact-wording service
enables (rngd, upower, fail2ban) use enable_service. Multi-line sites
(heredocs, subshells, intervening logic) keep the explicit form.

Behavior is unchanged: same descriptions, same commands, same logfile
redirection, same non-fatal warning on the real exit code. tests/run-task
covers the helper across Normal/Boundary/Error including exit-code
propagation, and the full unit suite stays green.
</content>
</entry>
</feed>
