feat: pull images with layer progress, and pull again to update a tag #24

Merged
jfro merged 1 commit from feat/17-image-pull into main 2026-11-30 17:41:52 +00:00
Owner

Closes #17

What

  • Images page: a Pull Image… button (download icon) opens a name field (name, name:tag, registry/owner/app:tag or name@sha256:…). While the pull runs, the dialog shows a progress bar and "n of m layers · X MB of Y MB". Hide keeps the pull running; the button then spins and reopens the progress. Stop drops the stream.
  • Pull Again on a tagged image, in the detail toolbar and the context menu. The toast says "Pulled X" or "X is up to date", from Docker's final Status: line.
  • Errors show the engine's message as it is, for example "manifest for busybox:no-such-tag not found" or "pull access denied … docker login".
  • The list refreshes when the pull ends, and image events refresh it as well.

How (following Nye's notes on #17)

  • src/pull.rs: parse_ref always sends a tag (default latest), because with no tag the engine pulls every tag of the repo. A : only starts a tag after the last /, so localhost:5000/app keeps its port. Digests go in fromImage with no tag.
  • Progress is tracked per layer (id), and done/current/total are summed. Podman sends no byte counts and no final Status: line, so the bar becomes indeterminate and a clean end of the stream counts as success. Progress signals go out at most every 150 ms.
  • Only one pull runs per reference; pulling a reference that is already running just shows its progress. Pulls run on the tokio runtime, never on the UI thread.
  • Private registry credentials are left out (Nye's must-do 6); the engine's error already tells the user to docker login.
  • --mock: a made-up three-layer pull. New screenshot scene pull. Screenshots now grab the root item, so open dialogs show up in them.
  • README features list and layout updated; screenshots regenerated.

Tests

  • Unit: reference parsing (tags, registry ports, digests, bad input), progress sums and the final status, and Podman-style lines with no sizes.
  • pulls_one_tag_and_reports_errors (ignored; it needs an engine and a registry, so run it with cargo test -- --ignored) passed on Docker 26 (dind). It checks "Pulled busybox:1.36", then "is up to date", that only that one tag came down, and that a missing tag gives a "not found" error.
  • Local CI run passed: fmt, clippy with and without mock, build, and tests (14 + 17 pass).

Stacked on #23 (feat/12-networks).

Pulling Light Images
pull pull light images
Closes #17 **What** - Images page: a **Pull Image…** button (download icon) opens a name field (`name`, `name:tag`, `registry/owner/app:tag` or `name@sha256:…`). While the pull runs, the dialog shows a progress bar and "n of m layers · X MB of Y MB". **Hide** keeps the pull running; the button then spins and reopens the progress. **Stop** drops the stream. - **Pull Again** on a tagged image, in the detail toolbar and the context menu. The toast says "Pulled X" or "X is up to date", from Docker's final `Status:` line. - Errors show the engine's message as it is, for example "manifest for busybox:no-such-tag not found" or "pull access denied … docker login". - The list refreshes when the pull ends, and image events refresh it as well. **How** (following Nye's notes on #17) - `src/pull.rs`: `parse_ref` always sends a tag (default `latest`), because with no tag the engine pulls every tag of the repo. A `:` only starts a tag after the last `/`, so `localhost:5000/app` keeps its port. Digests go in `fromImage` with no tag. - Progress is tracked per layer (`id`), and done/current/total are summed. Podman sends no byte counts and no final `Status:` line, so the bar becomes indeterminate and a clean end of the stream counts as success. Progress signals go out at most every 150 ms. - Only one pull runs per reference; pulling a reference that is already running just shows its progress. Pulls run on the tokio runtime, never on the UI thread. - Private registry credentials are left out (Nye's must-do 6); the engine's error already tells the user to `docker login`. - `--mock`: a made-up three-layer pull. New screenshot scene `pull`. Screenshots now grab the root item, so open dialogs show up in them. - README features list and layout updated; screenshots regenerated. **Tests** - Unit: reference parsing (tags, registry ports, digests, bad input), progress sums and the final status, and Podman-style lines with no sizes. - `pulls_one_tag_and_reports_errors` (ignored; it needs an engine and a registry, so run it with `cargo test -- --ignored`) passed on Docker 26 (dind). It checks "Pulled busybox:1.36", then "is up to date", that only that one tag came down, and that a missing tag gives a "not found" error. - Local CI run passed: fmt, clippy with and without `mock`, build, and tests (14 + 17 pass). Stacked on #23 (`feat/12-networks`). | Pulling | Light | Images | | --- | --- | --- | | ![pull](https://git.knope.dev/attachments/9b5714b1-ed06-491f-8b2c-d479273eed4b) | ![pull light](https://git.knope.dev/attachments/f26a3ed8-72ef-4738-a25a-8d894ea144d7) | ![images](https://git.knope.dev/attachments/94c000f1-d50c-4214-ba35-e5aca2bf99c8) |
feat: pull images with layer progress, and pull again to update a tag
All checks were successful
CI / test (pull_request) Successful in 4m40s
04746bbed6
jfro left a comment

PR #24 (#17 image pull) review — Nye, at 04746bb — CHANGES REQUESTED (1 medium, 2 low)

CI: green on the forge (run 949). Local check C4 passes: fmt, clippy -D warnings (with and without mock), 14 tests, mock build.

Findings (each has a proof script; it must pass after the fix)

  • F4 (medium) — bar drawn offset after it turns determinate. Every pull starts indeterminate ("Waiting");
    once sizes arrive, the fill keeps the NumberAnimation's last x, so it starts part-way and overshoots.
    Seen live on Podman 5.4: "305 MB of 407 MB" drawn from ~22% to ~97% (pr24/bar-offset.png).
    Fix (verified passing with the proof): on the ProgressBar, add
    onIndeterminateChanged: if (!indeterminate) contentItem.children[0].x = 0 (or give the fill an id and reset it).
    Proof: bash notes/pr24-f5-proof.sh <repo dir> (runs the PR's ProgressBar block in qml offscreen).
  • F3 (low) — Stop pops "Docker Reported an Error: Pull cancelled" (Docker and Podman; pr24/stop-alert.png).
    The generic "Volume/image actions report back here" handler in Main.qml also receives every pull:* result:
    it alerts on the cancel, and on success the toast fires twice. Real errors end up OK only because the pull
    handler's alert happens to come last. Fix: if (key.startsWith("pull:")) return at the top of the generic handler.
    Proof: bash notes/pr24-f4-proof.sh <repo dir>.
  • F5 (low) — real-engine test is environment-fragile. cargo test pulls_one_tag -- --ignored fails on a
    Docker that already has busybox:latest and busybox:1.37 (asserts <=2 busybox tags total), and on Podman the
    re-pull says "Pulled busybox:1.36" (no Status line). Also it removes the dev's own busybox:1.36 first.
    Fix: list busybox tags before, assert exactly {busybox:1.36} is new after; accept either outcome text on the
    re-pull (or only assert "up to date" when the engine is Docker). Proof: bash notes/pr24-f3-proof.sh.

Checked and fine

  • Only one tag comes down: Docker added just busybox:1.36; Podman compat with no tag pulled only latest.
  • Error text through Krane's code (Docker 26): bad tag "manifest for busybox:no-such-tag-krane not found: manifest
    unknown…"; private/missing repo "pull access denied for …, may require 'docker login'…"; ghcr "…denied".
    Podman bad tag: "manifest unknown: manifest unknown" (title names the ref, so OK).
  • Stop really stops: closing the stream cancels the pull server-side on both Docker 26 (rust:1-bookworm, aborted
    at 35 MB, nothing left) and Podman 5.4 (node:22-bookworm aborted, no image). The "engine may finish it anyway"
    comment on cancelPull is overcautious; fine to keep.
  • --mock: dialog, Enter to submit, Hide then reopen via the spinning toolbar button, toast on finish, Stop.
  • Podman 5.4 does send byte sizes for real downloads (determinate bar, "6 of 8 layers · 283 MB of 407 MB");
    indeterminate only while nothing is known. parse_ref handles registry ports, digests, bad input.

Non-blocking

  • Pull Again uses tags[0]; untagged/ images correctly hide it.
  • On Podman a re-pull of an up-to-date image says "Pulled x" (no Status line to tell). Fine for v1.0.
  • Total bytes grow as layers start, so the bar can step back briefly on Docker; normal for pull UIs.
  • pull() makes its own engine client: #16 must switch it to the shared client too (like stats).

Screenshots: bar offset on Podman, Stop alert

Posted by Upper Wolfjaw for Nye (Nye can't comment here).

# PR #24 (#17 image pull) review — Nye, at 04746bb — CHANGES REQUESTED (1 medium, 2 low) CI: green on the forge (run 949). Local check C4 passes: fmt, clippy -D warnings (with and without mock), 14 tests, mock build. ## Findings (each has a proof script; it must pass after the fix) - **F4 (medium) — bar drawn offset after it turns determinate.** Every pull starts indeterminate ("Waiting"); once sizes arrive, the fill keeps the NumberAnimation's last x, so it starts part-way and overshoots. Seen live on Podman 5.4: "305 MB of 407 MB" drawn from ~22% to ~97% (pr24/bar-offset.png). Fix (verified passing with the proof): on the ProgressBar, add `onIndeterminateChanged: if (!indeterminate) contentItem.children[0].x = 0` (or give the fill an id and reset it). Proof: `bash notes/pr24-f5-proof.sh <repo dir>` (runs the PR's ProgressBar block in qml offscreen). - **F3 (low) — Stop pops "Docker Reported an Error: Pull cancelled"** (Docker and Podman; pr24/stop-alert.png). The generic "Volume/image actions report back here" handler in Main.qml also receives every pull:* result: it alerts on the cancel, and on success the toast fires twice. Real errors end up OK only because the pull handler's alert happens to come last. Fix: `if (key.startsWith("pull:")) return` at the top of the generic handler. Proof: `bash notes/pr24-f4-proof.sh <repo dir>`. - **F5 (low) — real-engine test is environment-fragile.** `cargo test pulls_one_tag -- --ignored` fails on a Docker that already has busybox:latest and busybox:1.37 (asserts <=2 busybox tags total), and on Podman the re-pull says "Pulled busybox:1.36" (no Status line). Also it removes the dev's own busybox:1.36 first. Fix: list busybox tags before, assert exactly {busybox:1.36} is new after; accept either outcome text on the re-pull (or only assert "up to date" when the engine is Docker). Proof: `bash notes/pr24-f3-proof.sh`. ## Checked and fine - Only one tag comes down: Docker added just busybox:1.36; Podman compat with no tag pulled only latest. - Error text through Krane's code (Docker 26): bad tag "manifest for busybox:no-such-tag-krane not found: manifest unknown…"; private/missing repo "pull access denied for …, may require 'docker login'…"; ghcr "…denied". Podman bad tag: "manifest unknown: manifest unknown" (title names the ref, so OK). - Stop really stops: closing the stream cancels the pull server-side on both Docker 26 (rust:1-bookworm, aborted at 35 MB, nothing left) and Podman 5.4 (node:22-bookworm aborted, no image). The "engine may finish it anyway" comment on cancelPull is overcautious; fine to keep. - --mock: dialog, Enter to submit, Hide then reopen via the spinning toolbar button, toast on finish, Stop. - Podman 5.4 does send byte sizes for real downloads (determinate bar, "6 of 8 layers · 283 MB of 407 MB"); indeterminate only while nothing is known. parse_ref handles registry ports, digests, bad input. ## Non-blocking - Pull Again uses tags[0]; untagged/<none> images correctly hide it. - On Podman a re-pull of an up-to-date image says "Pulled x" (no Status line to tell). Fine for v1.0. - Total bytes grow as layers start, so the bar can step back briefly on Docker; normal for pull UIs. - pull() makes its own engine client: #16 must switch it to the shared client too (like stats). Screenshots: [bar offset on Podman](https://git.knope.dev/attachments/0f72ad36-b234-4637-a738-71d0513f5747), [Stop alert](https://git.knope.dev/attachments/caae3ed8-5458-48da-90d2-ab596d978253) _Posted by Upper Wolfjaw for Nye (Nye can't comment here)._
jfro force-pushed feat/17-image-pull from 04746bbed6
All checks were successful
CI / test (pull_request) Successful in 4m40s
to 1848c376d7
All checks were successful
CI / test (pull_request) Successful in 5m40s
2026-11-30 16:31:28 +00:00
Compare
Author
Owner

Fixed in 1848c37 (amended, rebased on #23 at e40fcdb):

  • F4: the bar's fill resets to x = 0 when the bar turns determinate (onIndeterminateChanged), so it draws from the left.
  • F3: the generic volume/image result handler in Main.qml returns early for pull: keys, so Stop shows no alert and success toasts once.
  • F5: pulls_one_tag_and_reports_errors compares busybox tags before and after (exactly one new tag), no longer deletes a developer's own busybox:1.36, and accepts Podman's "Pulled …" on the re-pull.
    Local CI (fmt, clippy both, build, tests both) green; all three proofs pass.
Fixed in 1848c37 (amended, rebased on #23 at e40fcdb): - F4: the bar's fill resets to x = 0 when the bar turns determinate (`onIndeterminateChanged`), so it draws from the left. - F3: the generic volume/image result handler in Main.qml returns early for `pull:` keys, so Stop shows no alert and success toasts once. - F5: `pulls_one_tag_and_reports_errors` compares busybox tags before and after (exactly one new tag), no longer deletes a developer's own busybox:1.36, and accepts Podman's "Pulled …" on the re-pull. Local CI (fmt, clippy both, build, tests both) green; all three proofs pass.
jfro force-pushed feat/17-image-pull from 1848c376d7
All checks were successful
CI / test (pull_request) Successful in 5m40s
to 71201e8e4c
All checks were successful
CI / test (pull_request) Successful in 5m10s
CI / test (push) Successful in 5m0s
2026-11-30 17:10:06 +00:00
Compare
jfro changed target branch from feat/12-networks to main 2026-11-30 17:25:02 +00:00
jfro merged commit 71201e8e4c into main 2026-11-30 17:41:52 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfro/krane!24
No description provided.