Add --ignore-collisions flag to cache restore#526
Open
cchristous wants to merge 4 commits intosemaphoreci:masterfrom
Open
Add --ignore-collisions flag to cache restore#526cchristous wants to merge 4 commits intosemaphoreci:masterfrom
cchristous wants to merge 4 commits intosemaphoreci:masterfrom
Conversation
Contributor
|
/sem-approve |
Contributor
|
/sem-approve |
This adds an opt-in flag to silently ignore file collisions during cache restore. When enabled, existing files are preserved rather than overwritten, and no error is raised. The implementation handles platform differences: - GNU tar: uses --skip-old-files (silent, exit 0) - BSD tar: uses -k (silent, exit 0) - Native archiver: checks file existence and skips
- Cache isGNUTar() result using sync.Once to avoid repeated subprocess calls - Align internal naming: SkipExisting → IgnoreCollisions - Add assertion for restored file content in test Co-Authored-By: Claude <noreply@anthropic.com>
9ca0802 to
64a7771
Compare
Author
|
@dexyk I don't think any of the failures are related to my changes. Could you confirm? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an opt-in
--ignore-collisionsflag tocache restorethat silently ignores file collisions.When enabled:
Implementation
Handles platform differences in tar behavior:
--skip-old-files(silent, exit 0)-k(silent, exit 0)Test plan
cache restore --ignore-collisions