Skip to content

fix/pull-compose-error-image-review#50

Merged
PolarBearEs merged 8 commits into
masterfrom
fix/pull-compose-error-image-review
May 23, 2026
Merged

fix/pull-compose-error-image-review#50
PolarBearEs merged 8 commits into
masterfrom
fix/pull-compose-error-image-review

Conversation

@PolarBearEs
Copy link
Copy Markdown
Owner

No description provided.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 23, 2026

Greptile Summary

This PR addresses a set of related bugs and refactors: removing the redundant digest field from DigestMismatch, adding a depth-limit guard to compose variable interpolation, refactoring PullArgs/ComposePullArgs to share a PullCommonArgs struct, extracting a DownloadProgress helper (also adding retry logic for premature-EOF streams), and consolidating the format_units logic into a single shared module.

  • PullCommonArgs extraction (src/cli.rs, src/pull/orchestrator.rs): the eight shared flags previously duplicated between PullArgs and ComposePullArgs are now grouped into a single PullCommonArgs, which both structs flatten.
  • DownloadProgress struct (src/pull/download.rs): encapsulates offset, checkpoint bytes, and checkpoint timer; adds a new premature_eof_detail path so streams that end early without a transport error are now properly retried under the same retry budget as other failures.
  • Compose interpolation depth limit (crates/pocker-compose/src/interpolate.rs): a recursive-interpolation cycle now returns a ComposeError at depth ≥ 32 instead of overflowing the stack; the helper is also plumbed through resolve_variable_with_operator so nested default values respect the limit.

Confidence Score: 5/5

Safe to merge — all changed paths are logically consistent and the new premature-EOF retry handling is a straightforward addition with no observable regression risk.

The changes are well-scoped refactors and targeted bug fixes. The DownloadProgress struct encapsulates state correctly, the premature-EOF path integrates cleanly with the existing retry budget, the PullCommonArgs extraction is a pure structural rename, and the compose project refactoring preserves all lookup semantics. No correctness issues were found across any of the 14 changed files.

No files require special attention.

Important Files Changed

Filename Overview
src/pull/download.rs Adds DownloadProgress struct to encapsulate offset/checkpoint state, and new premature-EOF detection that registers a proper retry with backoff instead of silently looping.
crates/pocker-compose/src/project.rs Replaces the synthetic PathBuf with an in-memory merged_services vec; ServiceKey.file is now Option and extends_key correctly falls back to merged_services when no explicit file is given.
crates/pocker-compose/src/interpolate.rs Adds depth-tracking to prevent stack overflow on deeply nested compose variable interpolation; depth limit enforced consistently across both braced and unbraced variable paths.
src/cli.rs Extracts PullCommonArgs from the previously duplicated fields in PullArgs and ComposePullArgs; all test assertions updated to the new path via .common.*.
src/error.rs Removes the redundant digest field from DigestMismatch (it was always identical to expected); call sites in layers.rs and store/mod.rs updated accordingly.
src/units.rs New shared format_units utility, consolidating identical byte-formatting logic from src/ui.rs and src/image_view.rs into one tested function.
src/pull/orchestrator.rs Removes the local PullOptionArgs intermediate struct and unique_references; pull_references now calls pocker_compose::unique_images and from_args accepts PullCommonArgs directly.
src/runtime.rs Minor update to access quiet and output flags through the new pull_args.common path.
src/store/mod.rs Removes the redundant digest field from two DigestMismatch construction sites to match the simplified error variant.
src/image_view.rs format_size now delegates to the shared format_units helper instead of duplicating the scaling loop.
src/ui.rs format_bytes now delegates to the shared format_units helper instead of duplicating the scaling loop.
crates/pocker-compose/src/lib.rs Adds two unit tests for interpolation depth limiting (below-limit succeeds, at-limit fails) and a helper to construct deeply-nested interpolation strings.

Reviews (2): Last reviewed commit: "Address Greptile review follow-ups" | Re-trigger Greptile

Comment thread src/units.rs
Comment thread crates/pocker-compose/src/interpolate.rs Outdated
@PolarBearEs PolarBearEs merged commit 6cf8f49 into master May 23, 2026
11 checks passed
@PolarBearEs PolarBearEs deleted the fix/pull-compose-error-image-review branch May 23, 2026 14:42
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.

1 participant