Files
cozystack/test/check-readiness
Aleksei Sviridkin 05818aa3b2 fix(cli): fail cozypkg and check-readiness on unwritable output
For the commands this change touches (cozypkg list, the validation
report of validate, push and tap, tap's summary, and check-readiness),
a write error the process observes is a failure: the command exits
non-zero and says whether the action it reports on already happened.
Progress lines printed before the decisive step stay best-effort. A
closed pipe ends the process with SIGPIPE, as for other Unix tools.

`cozypkg list` and the validation report dropped write errors, and the
list deferred its tabwriter flush, so a closed or full stdout still
reported success with nothing printed. The list now writes to the
command's writer and returns the flush error, and the report returns
its write error. When validation refuses a push or a tap, or fails a
validate run, the refusal stays the reported reason and the report's
write error is joined to it. A push whose report cannot be written
stops before flux runs and says "nothing was pushed"; a tap whose
summary cannot be written fails with "tap applied, but writing its
summary failed".

check-readiness fails --help, --version and its readiness result the
same way, in one-shot, --wait and --watch mode, with exit 1 as for a
result that is not ready, which its help now lists among the exit
statuses along with SIGPIPE for a closed pipe; the watch loop stops at
the first frame it cannot write, and a timed-out wait still ends with
its verdict.

push writes its "Pushing" line before it runs flux and stops with
"nothing was pushed" when that line cannot be written, with validation
skipped or after the report.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-13 12:34:56 +03:00
..