compose/pkg
Deniss Solnce f8ed846e4d fix(hooks): include hook output in the error when a hook fails
A failing service hook returns only its exit code:

    dependency failed to start: db hook exited with status 1

The output that explains why is not there, and for a hook running without a
listener it does not exist anywhere: runHook created the exec with
AttachStdout/AttachStderr false, so the daemon discarded both streams and
runWaitExec only polled for the exit code. There was nothing left to look at
afterwards.

Now stdout and stderr are always attached, and the last lines of them are kept
in a bounded buffer. On non-zero exit that tail goes into the error:

    db hook exited with status 1: SQLSTATE[42S02]: Base table or view not found

A successful hook is unchanged - output goes to the listener as before, nothing
is added anywhere. With a listener the lines still stream out, the buffer just
tees them.

The buffer keeps the last 10 lines and 2 KiB, drops the oldest content and never
short-writes, so a chatty hook cannot block on it and cannot grow it.

runWaitExec is removed: it existed only for the unattached branch, and that
branch is what threw the output away.

Signed-off-by: Deniss Solnce <dennis.lapchenko@gmail.com>
2026-08-19 15:08:25 +02:00
..
api feat(ps): add ENGINE column gated on label presence 2026-08-17 10:34:46 +02:00
bridge refactor: last gocognit candidates — bridge resources and TestViz 2026-08-18 13:37:48 +02:00
compose fix(hooks): include hook output in the error when a hook fails 2026-08-19 15:08:25 +02:00
dryrun fix(cp): return non-nil Content from dry-run CopyFromContainer 2026-07-30 11:37:49 +02:00
e2e fix(watch): sync into a symlinked directory instead of failing 2026-08-18 17:25:13 +02:00
mocks
remote refactor: split ociRemoteLoader.Load pull and index resolution 2026-08-18 13:37:48 +02:00
utils
watch test(watch): cover the permission branches as root 2026-08-11 14:10:40 +02:00