Repository navigation
refactor(cli): route bundle pull through the gap-driven driver + delete the legacy fetch loop (P4 of #1621) - #1633
Conversation
|
Warning Review limit reached
Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (2)
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR consolidates decdn fetch and bundle pull onto the shared gap-driven fetch driver by extracting a reusable drive_fetch core and removing the legacy streaming fetch path.
Changes:
- Removed the legacy
fetch_blob_streamingimplementation (and its helpers/tests) fromfetch.rs. - Introduced
DriveFetchDeps+drive_fetchas the shared fetch core for bothfetchandbundle pull. - Updated bundle staging paths/cleanup to align with
drive_fetch’s finalize-to-plain-file behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| crates/cli/src/commands/fetch.rs | Removes streaming fetch path; adds shared DriveFetchDeps + drive_fetch and wires fetch() through it. |
| crates/cli/src/commands/bundle_pull.rs | Switches bundle entry fetches to fetch::drive_fetch, updates staging path semantics, and expands staging cleanup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c1eafd7 to
f4d12b2
Compare
…le pull Pulls the gap-driven driver core (header-probe -> ClientRangedStore -> PeerSource -> drive -> watermark) out of fetch() into fetch::drive_fetch(deps, ctx, ...) so bundle pull can share it (P4.2). Behavior-preserving for decdn fetch. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Restores the pre-extraction ordering: persist_watermark's rare non-advance warning must print after the indicatif bar is cleared, not while it's active. drive_fetch now takes a finish_progress hook called right after drive() returns. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…cy fetch loop decdn bundle pull now fetches each blob through the shared gap-driven drive_fetch (range-minimized, resumable via sidecars) instead of the single-cursor fetch_blob_streaming loop. Staging files become plain finalized blobs (drive_fetch owns the .partial + outboard sidecars). Deletes fetch_blob_streaming, verify_resumed_prefix, combine_pull_and_flush, existing_partial_len, watermark_after, and the fetch-local resume_may_be_stale — the two parallel fetch paths are now one. Co-Authored-By: Claude Opus 4.8 <[email protected]>
The plain <hex> (no .partial) naming is now load-bearing: drive_fetch derives the .partial/.obao4/.ranges sidecar names from the staging stem. Co-Authored-By: Claude Opus 4.8 <[email protected]>
… nits Extracts drive_fetch's money-critical watermark-reader selection (committed on success/voucher-reject, settlement on ambiguous failure) into a pure helper with a unit test for the three cases — restoring coverage lost with the legacy watermark_after. Binds the staging hex name to a local and renames remove_staging's cleanup array to paths_to_remove. Co-Authored-By: Claude Opus 4.8 <[email protected]>
f4d12b2 to
0689370
Compare
Coverage reportTotal: 80.74% (was 80.46%, ▲ +0.27%) — 59289/73435 lines
History
|
What
P4 (Phase A') of #1621 — finishes the CLIENT side of range-minimized fetch and removes the "two parallel fetch paths" smell.
Stacked on #1631 (Phase A / P3-client) — base is
feat/1621-p3-client-blobsource; this PR shows only P4's diff. It'll retarget tomainonce #1631 merges.Four commits:
refactor: extract drive_fetch— pulldecdn fetch's gap-driven driver core (header-probe →ClientRangedStore→PeerSource/BudgetPacer→drive→ watermark) into a reusablefetch::drive_fetch(deps, ctx, target, hash, output, progress, finish_progress). Behavior-preserving fordecdn fetch.fix: bar-clear ordering— restore the pre-extraction ordering (a rarepersist_watermarkwarning must print after the progress bar is cleared, not during) via afinish_progresshook.refactor: route bundle pull + delete legacy loop—decdn bundle pullnow fetches each blob through the samedrive_fetch(range-minimized, resumable via sidecars). Staging files become plain finalized blobs (drive_fetchowns the.partial/.obao4/.ranges). Deletesfetch_blob_streaming,verify_resumed_prefix,combine_pull_and_flush,existing_partial_len,watermark_after, and the fetch-localresume_may_be_stale(the driver's own copy stays). Net −856 lines infetch.rs.test: staging_path naming guard— the plain-<hex>staging name is now load-bearing (sidecar names derive from it).Why it's safe
decdn fetchandbundle pullnow run the one gap-driven path — same resume/top-up/pacing, same per-byte bao verification +finalizevalid_rangessweep. The old whole-file re-hash (verify_resumed_prefix) is subsumed, so no unverified byte reaches a materialized output.bundle pullgains range-minimized resume + reactive top-up for free (it inherited neither before)..partial+sidecars are the resume state.Verification
cargo build && cargo clippy --all-targets --all-features -- -D warnings— cleancargo nextest run -p decdn-cli— 415/415 (incl. the newstaging_pathguard)cargo fmt -- --check— cleancargo test --no-run -p decdn-e2e --features anvil-e2e— compilescli_bundle_pull_adopts_one_channel_for_the_whole_bundleanvil e2e ran locally and passedcargo tree -p decdn-cli -e normal -i iroh-blobs— nothing (CLI binary-split regression: publisher links cache crate (iroh-blobs/AWS SDK) #578 holds)🤖 Generated with Claude Code