Skip to content

fix(cli): check bundle pull --hash --dry-run filters against the cached manifest - #2360

Merged
thiras merged 1 commit into
mainfrom
fix/2327-dry-run-cached-manifest
Oct 7, 2026
Merged

thiras merged 1 commit into
mainfrom
fix/2327-dry-run-cached-manifest

Conversation

@thiras

@thiras thiras commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

What

#2327 reported that decdn bundle pull --exclude "metal/*" silently matched nothing in a bundle whose paths start with openai-gpt-oss-20b/.

The live-run warning for that case already ships in #2244 (merged 2026-09-30, before the issue): warning: --exclude 'metal/*' matched no entries (… did you mean '**/metal/*'?) prints before any fetch. The 2026-10-06 testnet run most likely used an older binary.

The one gap left was the issue's own repro, --hash <H> --dry-run, which never read the manifest. This PR closes it:

  • --hash --dry-run reads the manifest from the output root's .decdn-bundles/ cache when an earlier pull stored it (local, unpaid, hash-verified, so read even under --overwrite). It prints the filtered plan and the unmatched-pattern warnings, as -i --dry-run does.
  • With no cached manifest it prints the bundle and output root, and under --json it prints {"output", "hash", "count": null, "entries": null} instead of prose.
  • A malformed --hash now fails the dry run, as it fails a real pull. A cached manifest that does not parse names its cache file in the error.
  • Docs: adr/appendix-bundles.md --dry-run bullet, bundle_cache.rs module doc, --dry-run help, CHANGELOG.

Closes #2327

Reviewer notes

  • Start at dry_run_manifest / dry_run in crates/cli/src/commands/bundle_pull.rs.
  • The real pull's manifest path (obtain_manifest) is unchanged and still skips the cache under --overwrite.
  • Not in this PR: bundle_cache::load still folds "missing", "unreadable" and "hash mismatch" into None, so an unreadable cache file falls back to the no-cache line with no reason given. A subprocess test asserting the stderr warning is also left for later.

Verification

  • cargo fmt -- --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo nextest run -p decdn-cli -p decdn-common: 1394 passed. The new cache-read tests fail when the dry run skips the cache (mutation-checked).
  • RUSTDOCFLAGS="-D warnings" cargo doc -p decdn-cli -p decdn-common --no-deps --document-private-items
  • Manual: built decdn and ran the repro against an empty output dir (no-cache line, JSON null form) and a dir with a cached prefixed manifest (warning: --exclude 'metal/*' matched no entries (… did you mean '**/metal/*'?) plus the 2-entry plan).
  • User-visible change: CHANGELOG.md entry added
  • Design change: ADR in adr/ added or updated (appendix-bundles.md --dry-run bullet)
  • PR title uses an allowed type with a lowercase subject

🤖 Generated with Claude Code

…ed manifest

`bundle pull --hash <H> --dry-run` never read the manifest, so an
`--include`/`--exclude` pattern that matches no entry went unreported:
the repro in #2327. The live-run warning already exists (#2244).

The dry run now reads the manifest from the output root's
`.decdn-bundles/` cache when an earlier pull stored it. The read is
local, unpaid, and verified against the hash, so it happens even under
`--overwrite`. It then prints the filtered plan and the unmatched-pattern
warnings, as `-i --dry-run` does. With no cached manifest it prints the
bundle and output root, with `count`/`entries` null under `--json`. A
malformed `--hash` fails the dry run, as it fails a real pull, and a
cached manifest that does not parse names its cache file.

Closes #2327

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 15:29
@thiras thiras self-assigned this Oct 7, 2026
@github-code-quality

Copy link
Copy Markdown

Code Coverage Overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

The overall line coverage in commit e6e5221 in the fix/2327-dry-run-cac... branch remains at 75%, unchanged from commit 5a846d4 in the main branch.

@thiras
thiras merged commit 20db95e into main Oct 7, 2026
31 checks passed
@thiras
thiras deleted the fix/2327-dry-run-cached-manifest branch October 7, 2026 15:41
@thiras
thiras removed the request for review from Copilot October 7, 2026 16:03
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.

fix(cli): bundle pull --exclude/--include pattern that matches no entry is silently ignored

1 participant