Repository navigation
fix(progress): append unknown steps instead of dropping them silently (#739) - #743
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
An audit of every prog.Start/Complete/Error/Skip name passed from cmd/ found 32 distinct names, of which 24 matched nothing in the tracker's fixed nine-step list. All four methods scanned the list and `return`ed SILENTLY on no match, so all 24 calls were no-ops. The 24 were not a random sample. They were spawn's longest operations: "Verifying spored agent" (5 min), "Waiting for Windows (password available)" (12 min), every FSx step, cohort reconciliation, "Registering DNS", and the entire Windows ISO->AMI import. The eight that DID match all belong to the fast pre-launch phase — which is exactly why nobody noticed: everything that printed finished in seconds and everything slow was invisible. It is also why the #740/#741 stall showed no output at all. A fixed registry was the wrong shape. Several steps are conditional (FSx, MPI, Windows, cohort), and cmd/image.go builds labels in variables, so no static list can enumerate them. stepIndex now find-or-appends, and the step list describes what this launch actually did. Error() also prints its message outside the lookup. It used to sit INSIDE the matched-step branch, so an unregistered name swallowed the error text as well as the step line — a failure reported nowhere at all unless the caller independently returned it. Second half: displayPlain skipped any step not already complete/error, so a RUNNING step emitted zero bytes on a non-TTY (measured) and announced itself only once finished. Piping, capturing or CI therefore made a long wait and a wedged process identical — backwards, since knowing what is in flight is the whole value of progress output on a non-interactive stream. Starts are now logged once each, and `skipped` is reported rather than dropped. The two longest waits state their ceiling ("up to 5 min"). A bounded wait that says so is a wait; one that does not is a hang. Gates confirmed to fail on revert: dropping unknown names, and skipping running steps in displayPlain. Also records, without fixing, five pre-existing mismatched pairs — names passed to Complete/Error/Skip but never to Start, all in FSx/cohort paths. Find-or-append makes those render as a second never-started step rather than vanishing, so they are now visible; a test flags any increase.
scttfrdmn
force-pushed
the
fix/739-progress-step-registration
branch
from
October 8, 2026 03:22
ce6a3c6 to
035c645
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #739. This is why the #740/#741 stall was invisible; #742 is why it was
long.
24 of 32 step names were no-ops
Start/Complete/Error/Skipscanned a fixed nine-step list andreturnedsilently on no match. An audit of every name passed from
cmd/, with i18ninitialized the way
cmd/root.godoes it:And the 24 were not a random sample:
Every one of spawn's long operations, and nothing else. The eight names that
did match all belong to the fast pre-launch phase — which is exactly why this
survived: everything that printed finished in seconds, and everything slow was
invisible. A reporter watching a launch for five minutes with no output was
watching three consecutive no-op calls.
Appending, not registering
The issue suggested registering the missing names. I went with find-or-append
instead, because a fixed list is the wrong shape for this data:
only happen on some launches, so a static list is either incomplete or lists
steps that will never run;
cmd/image.gobuilds labels in variables (waitLabel,ssmLabel), so nostatic registry could enumerate them even in principle.
With find-or-append the step list describes what this launch actually did, and
the failure mode of a new call site is a visible extra line rather than silence.
Erroralso now prints its message outside the lookup. It used to sit insidethe matched-step branch, so an unregistered name swallowed the error text as well
as the step line — a failure reported nowhere at all unless the caller
independently returned it.
Second half: a running step was 0 bytes on a non-TTY
displayPlainskipped anything not alreadycompleteorerror. Measured:So on a pipe, a capture, or in CI, a step announced itself only once it had
finished — which is backwards. Knowing what is in flight is the entire value
of progress output on a non-interactive stream, and without it a long wait and a
wedged process are identical. Starts are now logged once each, and
skippedisreported rather than dropped.
The two longest waits also state their ceiling —
Verifying spored agent (up to 5 min). A bounded wait that says so is a wait; one that doesn't is a hang.Verification
stepIndexStart on an unregistered name printed " ? spawn.progress.detecting_ami..."+step count 9 -> 9, want one appendeddisplayPlainskipsrunningStart emitted nothing on a non-TTY — a step in flight is invisible (#739)Also asserted: quiet mode (which exists so
-o jsonstays parseable) stayssilent for appended steps too, and a running step is announced once however
many times
display()is driven.gofmt,go vet ./...,go test -short ./...,make check-docs, changeloggate,
semgrep scan --config=auto --error(0 findings).Found but not fixed
Five names are passed to
Complete/Error/Skipbut never toStart—mismatched pairs, all in FSx/cohort paths:
Before this change they vanished; with find-or-append they render as a second,
never-started step, so they are at least visible now. Fixing them means
reading five call sites in code this PR doesn't otherwise touch, so it is left
alone — but
TestReportMismatchedStepPairspins the count at five and fails if acaller adds another.