https://github.com/kopia/kopia/runs/8243012442?check_suite_focus=true
This is caused by weird permissions set on files by `go install`
which makes it hard to remove the entire directory using `rm -rf`.
The solution is to clean (local) module cache after `go install` which
makes subsequent `rm -rf` work without a problem.
* feat(cli): Allow restore from snapshoted path
* Find files in multiple snapshots
* Added --snapshot-time to restore
* Added restore by path test
* More timespec formats
* Test for snapshot list with a file in multiple snapshots
* Handle restore without target path
* Fix for tests
* Made changes requested in PR and rebased
* implemented format blob cache abstraction
* moved upgrade lock logic to repo/format
* moved set parameters logic to repo/format
* moved change password functionality to repo/format
* mechanical changes
* mechanical changes to react to format manager interface
* get current repository format bytes instead of static
* implemented format.Manager which dynamically fetches and caches latest format blob
* repo changes to use format.Manager
* fixed failing unit test due to different timings
* reduced lock contention by using RWMutex
* serve immutable parts of format without any locks
* increase test timeout
* fixed handling of negative validDuration
The new rules are:
- validDuration < 0 - ignore initial cached file, refresh every 15min
- validDuration > 15min - refresh every 15 minutes
- validDuration > 0 && validDuration <= 15min - refresh using provided
interval (mostly used for testing)
* Move upgrade repository test function
* Delete test for deleted function
* Move upgrade repository test function
* Resolve conflicts
* Check for error in status function
* Add unit test
* Make callback for upload file completion
Callback does not indicate that a file will be reachable immediately in
the resulting snapshot, but does indicate that the uploader is done
processing the file in some way (either via uploading data or finding a
previous version in the repo) and whether there was an error processing
the file.
* Tests for new FinishedFile callback
Ensure hadErr is properly populated and FinishedFile is called even if
the file was considered cached.
* Refine comment on interface function slightly
* Give callback error instead of bool about error
* Add locks around concurrent accesses in test
Unlike on other OSes it appears that on Windows time.Now() called twice
in quick succession can return the same value.
Switched logic using `time.After()` to `!time.Before()`
* Allow setting mod time on StreamingFiles
Only set during struct creation. Default the old constructor to using
the current time as the mod time.
* Change how mod time is handled for StreamingFiles
Don't set StreamingFile mod time in the uploader, instead use the value
in the file's metadata. Also allows StreamingFiles to be recognized as
cached files (previously uploaded). StreamingFiles don't know their file
size until they've been completely uploaded so leaving that out makes
them eligible for being marked as "cached".
This commit combined with the previous commit slightly changes how
timestamps on StreamingFiles are handled. It will result in them having
slightly earlier timestamps because they are now set on struct creation
instead of when the file was uploaded.
As timestamps are fairly fine-grained and the default is to use the
current time as the mod time it seems unlikely this patch will result in
incorrectly thinking a StreamingFile is cached even though it has
changed size.
* Uploader test for StreamingFile caching
* Encryptor pipeline
* Added ECC related options to repository create cli command
* Fix for lint errors
* Fixing comments from the PR
* Fixed lint errors
* Changes requested in PR
* Created e2e test
* Initial implementation of ecc using Encryptor interface
* Created benchmark ecc command
* Fixing the order inside the wrapper
* Removed rs_bw because it is always worse
* Fixing naming and adding more comments
* Different approaches depending of file size/space overhead
* Fixes requested in PR
* Fixed lint errors
* Fixes requested in the PR
* Fixed import order
* Fixed more lint errors