Repository navigation
fix: finish pull batches while reporting per-file failures - #36
Conversation
|
Hi @OndrejDrapalik, when you get a chance, could you take a look at this one? It prevents a single unreadable or removed file from aborting the whole |
OndrejDrapalik
left a comment
There was a problem hiding this comment.
The CLI JSON validation is useful, but the new error handling needs two changes before this can merge. Both issues below were reproduced with the real download.js entrypoint, an isolated git fixture, and a stubbed SDK connection. Please also add behavior tests for failed reads/writes and continuation into subsequent batches; the current added tests cover only argument parsing.
OndrejDrapalik
left a comment
There was a problem hiding this comment.
Both previously requested changes are fixed in 8778808. Failed safety checks remain conservative; ordinary file failures allow subsequent batches to finish, preserve error reasons, return exit 1, and never count failed writes as successful downloads. The real-CLI regressions cover both blockers and the batch/summary behavior. All 17 targeted tests passed, and fresh CI passed on Node 22/24 across Ubuntu/macOS plus Rust, version and CLA checks.
A single unreadable remote file or failed local write could abort the pull batch and prevent later files from downloading. Handle preparation, read and write failures per file so the remaining files and batches finish, while reporting the actual errors and returning exit 1 for an incomplete pull.
Only successful writes count as new or overwritten. Unsafe-path/symlink skips retain their existing meaning. An all-failed pull no longer claims that the local tree matches the box.
The overwrite safety check remains conservative: a failed remote read causes a failed check, so the CLI aborts or prompts rather than treating an unreadable dirty file as safe. Invalid CLI JSON exits cleanly with code 2.
Validation: 17 targeted download tests pass, including five real-CLI scenarios with an isolated temporary git/filesystem fixture and stubbed SDK. Four new regressions failed against the original PR before the correction. Coverage includes transient safety-check failure and retry, explicit force, remote reads and local writes failing across batches, destination preparation errors, all-failed reporting, and normal success/unchanged/unsafe-skip behavior. The full local JavaScript suite passes all 306 tests; the CLI suite has the same two credential-discovery failures reproduced on unchanged main.