Repository navigation
Conversation
The checking phase created a transfer bar with a nil reader. That bar has byte counters and an AverageSpeed decorator, but nothing advances them, so a slow dst.Exists call rendered "0 B / <size>" and "0 B/s" under "Checking ...", which is the zero transfer rate this PR removes. Add ProgressBar.Spinner: an indeterminate bar with a spinner filler, the prompt, the total size, and the elapsed time, and no byte or speed decorators. push uses it for the checking phase; Reset then replaces it with the transfer bar once the upload starts. Complete gives a spinner a total so mpb can mark it done. Tests cover creation, replacement by Reset, completion, the disabled path, and the rendered output (no counter, no rate), with a sanity test that a transfer bar does render the rate. Signed-off-by: Zhao Chen <zhaochen.zju@gmail.com> (cherry picked from commit 4382099)
5 of 6 tasks
This branch has not been deployed
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.
Problem
Follow-up to #474. The Copilot review on #474 (#474 (comment)) found that the checking phase still renders a zero transfer rate. #474 was merged before the fix landed on its branch, so this PR carries the fix.
The checking phase created a transfer bar with a nil reader. That bar has byte counters and an
AverageSpeeddecorator, but nothing advances them. A slowdst.Existscall therefore showed0 B / <size>and0 B/sunder "Checking ...".Change
internal/pb: addProgressBar.Spinner(prompt, name, size). It creates an indeterminate bar (total = 0, so mpb never triggers completion on its own) with a spinner filler, the prompt, the total size and the elapsed time. It has no byte counter and no speed decorator.ResetorAddreplace it with a transfer bar once bytes flow.Completegives a spinner a total so mpb can mark it done.pkg/backend/push.go: the checking phase callspb.Spinner(...)instead ofpb.Add(..., nil).TestSpinner_*cover creation, replacement byReset, completion, the disabled path, and the rendered output (no counter, no rate).TestAdd_RendersTransferRateis the sanity check that a transfer bar with no bytes flowing does render0.00 b / N b | 0.00 b/s, so the spinner assertion is not vacuous.Verification
Manual end-to-end check against a local
registry:3.1.2behind a proxy that delaysHEAD /v2/*/blobs/*by 2 s. Rendered output in a 220-column pty:No
Checkingframe containsb/s.