pipeline: remove staging files when cache publication fails #161
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/161"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by lordon1a on 2026-11-24T01:01:53Z.
Summary
When
Cache::get_or_convert()(crates/victory-pipeline/src/cache.rs) fails to write or rename its staging file into the final cache path, the orphaned temporary file was left behind in the cache directory.This change:
OpenOptions::new().write(true).create_new(true)instead ofstd::fs::write, drops the file handle beforerename(required on Windows), and removes the staging file if writing or publishing fails.failed_publication_removes_the_staging_file) that creates a directory at the target cache path to forcerenamefailure and verifies no staging file remains.Verification
Tested on Windows 11 (
rustc 1.100.0,x86_64-pc-windows-gnullvm):cargo test -p victory-pipeline: 4 passed, 0 failed (the new test fails onmain@9aef3d9where the staging file is left behind).cargo clippy -p victory-pipeline --all-targets: 0 warnings.cargo xtask policy: 151 files ok (zero game data).AI-assisted.
Imported from Marvisak/VIctory. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-24T01:02:01Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T01:21:39Z.
The test target does not compile, so the GPU suite cannot run:
The library builds; only
cargo testfails, on every platform. The new test module needs to go into the existingmod testsinhost.rsafter a rebase (the same failure as #134/#135/#175).No game data used.