Live-stream builder-live.log instead of post-mortem dump #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Current behaviour
scripts/copr-build.shsubmits the build, runscopr-cli watch-buildto block until completion, then uses
copr-cli download-buildtofetch each chroot's
builder-live.logand emits them as::group::blocks.
This means the logs only appear in CI output after the build
finishes. For a long-running COPR build (tens of minutes on larger
projects), that's a long blind spot — you see status transitions but
not the actual compiler/linker output until the build is done.
Proposed behaviour
Stream each chroot's
builder-live.loginto the CI output as it iswritten by the COPR builder. The log file is continuously updated on
the mirror at a predictable URL:
Implementation sketch
--nowait(same as today), capture build ID.chrootsarray.Range: bytes=N-request to fetch only new bytes since the last poll.
[<chroot>]so interleaved outputfrom parallel chroots is still decipherable.
API) and the final read returns no new bytes, or (b) the mirror
returns a 416 (Range Not Satisfiable) plus a closed builder-live
endpoint.
copr-cli watch-build <id>for overall status (astoday) — exits non-zero on failure.
waitfor all tailers to drain before exiting.Edge cases to handle
pending/importingstate. Initial polls will 404. Retry with backoff untilthe URL appears, or give up after N minutes.
chroot ever runs. Fall back to the current post-mortem
download-buildbehaviour.
builder-live.logmay truncate whenthe builder is killed. Accept it; emit what exists.
"try again next poll", don't abort the stream.
stream should continue for still-running chroots even after one
finishes.
Interleaving
Parallel tailers writing to the same stdout will interleave lines.
The
[<chroot>]prefix is the minimum disambiguation. For clearerreading, could buffer per-chroot and flush on line boundaries.
::group::per chroot doesn't work during live streaming becausegroups must be opened and closed contiguously — we'd have to drop
grouping or open one group per line (ugly). Line prefix is the
pragmatic choice.
Scope
Implement inside
scripts/copr-build.sh(bash +curl+jq).Keep the existing post-mortem
download-builddump as a fallbackpath for when streaming fails or the build errors before any log
appears — the current code can be wrapped in a
finally-style traprather than being the primary path.
Bump the action to
v2since this changes output timing behaviourenough that consumers may want to opt in. Keep
v1as the stablepost-mortem variant.
Context
The post-mortem approach was chosen initially because it is simple
and reliable — see the discussion that led to v1 in helexa/cortex
commit history. Streaming was deferred as a follow-up when and if
post-mortem visibility turns out to be insufficient in practice.