portainer-deploy: wait for the Swarm rollout before the smoke check (v12) #7

Merged
tth merged 1 commits from agent/dart/portainer-wait-rollout into main 2026-11-03 01:55:02 +01:00
Owner

The smoke check answered from the old task right after the stack PUT, so the deploy went green before anything rolled out:

  • birdnet-go run 58329 (2026-11-03): smoke 200 with uptime 1h38m, then ~1 min of 503 while the new task started;
  • revaj-crm-stage (2026-11-02): new image exited 1 twice, Swarm paused the update, CI green - still paused now.

Now: before the PUT remember each stack service's UpdateStatus.StartedAt; afterwards wait until every service whose value changed is completed, fail on paused / rollback_*, time out after rollout-timeout (600 s, image pulls included). Comparing with the previous value avoids runner/Swarm clock skew; a 20 s grace covers the PUT returning before Swarm registers the update (seen live: 25.908 vs 25.929). Services the deploy did not touch are ignored (a stale paused one does not fail other deploys). wait-rollout: "false" = old behaviour.

Tested against a fake Portainer API running the real step script: normal rollout (smoke only after completion), paused -> rc 1, no change -> passes after grace, stale paused untouched service -> rc 0, stuck -> timeout rc 1, wait-rollout=false. Response shape and label filter checked read-only against the live Portainer.

Release: hand-made change, tag v12 by hand after the merge (README note added).

🤖 Generated with Claude Code

The smoke check answered from the **old** task right after the stack PUT, so the deploy went green before anything rolled out: - birdnet-go run 58329 (2026-11-03): smoke 200 with `uptime 1h38m`, then ~1 min of 503 while the new task started; - revaj-crm-stage (2026-11-02): new image exited 1 twice, Swarm paused the update, CI green - still `paused` now. Now: before the PUT remember each stack service's `UpdateStatus.StartedAt`; afterwards wait until every service whose value changed is `completed`, fail on `paused` / `rollback_*`, time out after `rollout-timeout` (600 s, image pulls included). Comparing with the previous value avoids runner/Swarm clock skew; a 20 s grace covers the PUT returning before Swarm registers the update (seen live: 25.908 vs 25.929). Services the deploy did not touch are ignored (a stale paused one does not fail other deploys). `wait-rollout: "false"` = old behaviour. Tested against a fake Portainer API running the real step script: normal rollout (smoke only after completion), paused -> rc 1, no change -> passes after grace, stale paused untouched service -> rc 0, stuck -> timeout rc 1, wait-rollout=false. Response shape and label filter checked read-only against the live Portainer. Release: hand-made change, tag `v12` by hand after the merge (README note added). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tth added 1 commit 2026-11-03 01:40:24 +01:00
portainer-deploy: wait for the Swarm rollout before the smoke check (v12)
pr-check / docker (pull_request) Successful in 10s
pr-check / binary (pull_request) Successful in 1m14s
94d0ba6b78
The smoke URL answered from the old task right after the stack PUT, so CI
went green before anything was deployed (birdnet-go 2026-11-03: green, then
1 min of 503) and a paused update stayed unnoticed (revaj-crm-stage
2026-11-02, new image exited 1 twice, CI green). Now the step waits until
every service whose UpdateStatus.StartedAt changed is completed and fails
on paused / rollback_*; untouched services are ignored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tth merged commit 7c8359099c into main 2026-11-03 01:55:02 +01:00
tth deleted branch agent/dart/portainer-wait-rollout 2026-11-03 01:55:03 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: tth-pub/ci-actions#7