perf(pipectl): wait on a watch instead of a five-second sleep #2007

Merged
sean merged 1 commit from feat/pipectl-watch-waits into trunk 2026-08-07 18:03:51 +00:00
Owner

Phase C. wait_release and wait_deploy snapshot, decide, then block on a bounded watch slice. Terminal case statements untouched — kubectl wait cannot OR phases, so the watch is only a wake-up.

Ceilings became wall-clock on SECONDS (a watch slice has no fixed duration, so an iteration count bounds nothing).

New guard executes the real functions against a fake kubectl; 2 mutations proved it (dropping --request-timeout, dropping the SIGPIPE || true).

wait_wf deliberately unchanged — it polls the query service, so its long-poll is operator work.

128/128 guards.

Phase C. wait_release and wait_deploy snapshot, decide, then block on a bounded watch slice. Terminal case statements untouched — kubectl wait cannot OR phases, so the watch is only a wake-up. Ceilings became wall-clock on SECONDS (a watch slice has no fixed duration, so an iteration count bounds nothing). New guard executes the real functions against a fake kubectl; 2 mutations proved it (dropping --request-timeout, dropping the SIGPIPE `|| true`). wait_wf deliberately unchanged — it polls the query service, so its long-poll is operator work. 128/128 guards.
perf(pipectl): wait on a watch instead of a five-second sleep
All checks were successful
pipeline/ci CI green @ 683d51d51dd9
683d51d51d
Phase C of RELEASE-TRAIN-AND-EVENT-TRIGGERS.md.

wait_release and wait_deploy now snapshot, decide, then block on a bounded watch
slice. Every terminal case statement is untouched: kubectl wait cannot express
"any one of these phases", so the decision stays in bash and the watch is only a
wake-up. Snapshot-before-watch bounds the race -- a transition inside the gap
costs one slice and the next snapshot sees it.

The ceilings became wall-clock arithmetic on SECONDS. They were an iteration
count times a fixed sleep; a watch slice has no fixed duration, so counting
iterations would no longer bound anything.

tests/pipectl-watch-waits.sh runs the real functions against a fake kubectl and
asserts behaviour rather than strings: a terminal snapshot returns without
opening a watch at all, a pending one blocks on a watch carrying
--request-timeout and still exits at its ceiling, and a Succeeded deploy whose
outcome is not 'deployed' still fails. Two mutations proved it load-bearing --
dropping --request-timeout, and dropping the `|| true` that absorbs the SIGPIPE
head causes under pipefail, which is the trap this file already documents.

wait_wf is deliberately unchanged: it polls the query service, not the API
server, so making it event-driven is operator work (a long-poll parameter on
handleWorkflow), not CLI work.
sean merged commit 683d51d51d into trunk 2026-08-07 18:03:51 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sean/pipelines!2007
No description provided.