Watch the deploy through, instead of exiting at the interesting moment #22
No reviewers
Labels
No labels
⏳in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grey.ooo/someones.computer_agent!22
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/sc-deploy-follow-progress"
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?
The last piece of #293.
#21 gave
sc deployfeedback for the half it does locally — packing, uploading — and then it stopped dead at the
most interesting moment: the upload answers
201 pendingbefore a worker has picked therevision up, so everything a person means by "deploying" happened after
schad alreadyexited, and all it could offer was a URL and an apology.
It now stays and watches.
What it looks like
Off a terminal — a CI log, a pipe — the spinner degrades to one plain line per step and
this is the whole transcript:
On a terminal the bottom line is live — a still frame mid-build, the build output scrolling
above a spinner that is counting:
…and a build that breaks, which exits 1 with the reason on stderr:
Two decisions worth arguing with
A step is coarser than a status.
builtanddeployingare one step — the instantbetween the images existing and the rollout starting, and the rollout itself — so the seam
is a relabel in place rather than a step closed and reopened. Closing there would print
Rolled out in 0sthe moment the images existed, with the actual rollout still to come. Thelabel still tracks the status (
Waiting for the rollout→Rolling out), so a wedged deployworker can't spend four minutes claiming to be rolling out.
Exit zero only if it saw the revision reach
running. Not seeing an outcome is not thesame as a good one: a dropped connection, a full stream pool, a platform too old to have the
route all leave a
sc deploy && notify-the-teamabout to run against a deploy nobodychecked. Every one of those messages names
--detachas the way to opt out on purpose.Ctrl-C is the one exception — a withdrawn question rather than an unanswered one — so it
exits zero saying the deploy carries on without the terminal.
There is a subtle case in there the tests pin down: the platform's tail gives up after an
hour so a wedged revision cannot hold a slot, which arrives as an
endframe with therevision still moving. That closes the step as unfinished (
Building — stopped watching after 2m14s) rather than as done; the first draft cheerfully printedBuilt in 45sfor abuild that was still going.
Flags
--detach,-durl— exactly the behaviour before this PR--no-build-logsservice/lineframes. Purely client-side: the server sends everything, because which half you want is a display choice and not worth a query parameter every server would have to honourBoth work off a terminal.
Verification
go vet ./...clean,gofmtclean,go test -race ./...green — 18 new tests. The steplist is asserted as a whole transcript against a hand-wound clock, so "a build took 1m47s"
costs no wall time and the exact CI output is pinned rather than described.
Beyond the tests, the whole command was run end to end against a throttled stand-in platform
(a small Python server answering the preflight, reading the bundle slowly enough to move the
upload gauge, then streaming a scripted progress tail with real pauses) — every transcript
above is captured from that, including the pty run for the animated frames. Exit codes
checked for each:
0running,1failed,1dropped mid-build,0--detach,0--no-build-logs.Depends on
someones.computer_scclient—FollowDeployment,ProgressFrameandDeploymentStatuslive there so
sc-traygets them too.go.modandvendor/are bumped to the mergedcommit.