Skip to content

image-builder: reuse progress bars for upload - #2592

Merged
croissanne merged 3 commits into
osbuild:mainfrom
croissanne:progress-upload
Aug 19, 2026
Merged

image-builder: reuse progress bars for upload#2592
croissanne merged 3 commits into
osbuild:mainfrom
croissanne:progress-upload

Conversation

@croissanne

Copy link
Copy Markdown
Member

Using the proxy reader and the ability to restart progress bars, the
progress bars can be used for uploads as well.

@croissanne
croissanne force-pushed the progress-upload branch 5 times, most recently from f73a84c to 084b213 Compare August 12, 2026 15:46
@croissanne
croissanne marked this pull request as ready for review August 13, 2026 10:31
@croissanne
croissanne requested a review from a team as a code owner August 13, 2026 10:31
achilleas-k
achilleas-k previously approved these changes Aug 13, 2026

@lzap lzap left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tested this.

Comment thread pkg/progress/proxy_reader.go Outdated
@croissanne
croissanne marked this pull request as draft August 17, 2026 08:35
@croissanne

Copy link
Copy Markdown
Member Author

Alright, I changed it a bit to make the bar identical to the upload bar (which is just the default config with bytes true)

old:

progress-original

new:

progress-new

@croissanne
croissanne marked this pull request as ready for review August 17, 2026 10:38
lzap
lzap previously approved these changes Aug 17, 2026

@lzap lzap left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@croissanne

Copy link
Copy Markdown
Member Author

I removed the kinda useless message underneath
image

`Bytes` tells the underlying progress bar to interpret the number of
steps as bytes, switching to more human readable size prefixes
automatically.

`Speed` adds how fast the steps are being processed.

`WithMsg` determines if the message under the progress bar should be
rendered.

These options are required to make the terminal progress bar identical
to the upload progress bar.
This reader keeps a reference to a progress bar, updating it as bytes
are read from the underlying `io.Reader`. This is useful to use our
existing progress bars for uploads.
achilleas-k
achilleas-k previously approved these changes Aug 19, 2026

@achilleas-k achilleas-k left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat

@achilleas-k

Copy link
Copy Markdown
Member

We have unit tests that check for specific parts of the progress bar that changed now it seems.

Using the proxy reader and the ability to restart progress bars, the
progress bars can be used for uploads as well.
@croissanne

Copy link
Copy Markdown
Member Author

We have unit tests that check for specific parts of the progress bar that changed now it seems.

ye, fixed now

@achilleas-k achilleas-k left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat again

@croissanne
croissanne added this pull request to the merge queue Aug 19, 2026
Merged via the queue into osbuild:main with commit 88866a5 Aug 19, 2026
47 of 55 checks passed
@croissanne
croissanne deleted the progress-upload branch August 19, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants