Commit Graph

565 Commits

Author SHA1 Message Date
Michael Eischer d9d54a505e restic: move Printer interface from internal/ui/progress
Move Printer and NewNoopPrinter to internal/restic so repository does
not have to import the ui packages.
2026-06-20 17:49:20 +02:00
Michael Eischer 0f4236cb39 repository: return unlock func from LockRepo
Drop the Unlocker interface and return the unlock callback directly
from LockRepo, simplifying callers that only need to defer unlock().
2026-06-20 17:48:35 +02:00
Michael Eischer 4d1b9cef63 internal/fileio: extract low-level file I/O from internal/fs
Move TempFile and PreallocateFile into internal/fileio. internal/fs
primarily focuses on converting between data.Node and the actual
filesystem state. Extract the two methods to not pull in unnecessary
dependencies.
2026-06-20 17:48:35 +02:00
Michael Eischer 1a9decf03e repository: show correct error if zstd decoder cannot be initialized 2026-06-14 16:52:40 +02:00
Michael Eischer 82708ff7f7 prune/repair pack: document ignored errors 2026-06-14 16:51:56 +02:00
Michael Eischer 7d36449ea8 repository: change LoadBlob, LookupBlob and LookupBlobSize to BlobHandles (#21857) 2026-06-14 15:30:00 +02:00
Michael Eischer 71f38d266c ensure reliable cleanup of test repository (#21880) 2026-06-14 14:25:00 +02:00
Michael Eischer 650f658244 repository/index: ensure progress bar cancelation on early index load failure (#21881) 2026-06-14 13:56:24 +02:00
Michael Eischer 406dec29a7 repository: remove redundant mutex in checkForOtherLocks
forAllLocks already serializes the callback calls. Still has to create a
copy of checkedIDs to prevent a data race between forAllLocks and the
callback.
2026-06-13 21:37:24 +02:00
Michael Eischer 6fe10a72eb repository: drop mutex from lockHandle 2026-06-13 21:37:06 +02:00
Michael Eischer 1a6d43286a repository: comment cleanups 2026-06-13 21:36:36 +02:00
Michael Eischer 151903d4d4 repository: fix goroutine leak due to delayedCancelContext in tests 2026-06-13 21:35:51 +02:00
Michael Eischer b86568b790 repository: merge Unlocker and lockContext 2026-06-13 21:35:41 +02:00
Michael Eischer a5f3256626 repository: partially deduplicate refresh and refreshStaleLock 2026-06-13 21:33:58 +02:00
Michael Eischer 5989671f87 repository: deduplicate error handling in checkForOtherLocks 2026-06-13 21:33:43 +02:00
Michael Eischer b7f3a1367a repository: add SIGHUP handler only on Unix systems 2026-06-13 21:33:27 +02:00
Michael Eischer 4838b0ae3e repository: cleanup naming of lockCtx 2026-06-13 21:33:19 +02:00
Michael Eischer c87da70af9 repository: separate Lock in-repository from lock handle
Reduce Lock to a pure data transfer object and move the logic to
lockHandle.
2026-06-13 21:33:03 +02:00
Michael Eischer 81b6414c55 repository: hide Lock methods
Unexport lock file methods except String. Lock file operations are only
used within the repository package.
2026-06-13 21:32:13 +02:00
Michael Eischer 637c1cfb66 repository: unexport internal lock file helpers
Unexport UnlockCancelDelay, IsInvalidLock, ErrRemovedLock, NewLock,
StaleLockTimeout and ForAllLocks
2026-06-13 21:31:27 +02:00
Michael Eischer b892b1a150 repository: move lock file handling from restic package 2026-06-13 21:31:23 +02:00
Michael Eischer 3ee465d363 repository: rename Lock function to LockRepo
Rename `Lock()` to `LockRepo()` to make room for the `Lock` struct.
2026-06-13 21:24:37 +02:00
Michael Eischer 8e11f5747d restic: introduce Counter interface to decouple from ui/progress (#21861)
decouple restic and ui/progress packages
2026-06-13 21:08:18 +02:00
Michael Eischer c8a0bc2c5e repository: move crypto package to internal/repository/crypto 2026-06-13 20:05:06 +02:00
Michael Eischer b94ef4831d repository: add PackBlob.UncompressedCiphertextLength() 2026-06-13 20:05:05 +02:00
Michael Eischer 1acc19dac5 repository: unexport SearchKey 2026-06-13 19:49:03 +02:00
Michael Eischer 79e92b3bc6 repository: change Unlocker to interface 2026-06-13 19:48:47 +02:00
Michael Eischer 766d9f9f1e repository: unexport openKey 2026-06-13 19:48:31 +02:00
Michael Eischer 131abbb4f0 repository: unexport WarmupJob 2026-06-13 19:48:15 +02:00
Michael Eischer d62e42e620 repository: unexport NewChecker 2026-06-13 19:48:02 +02:00
Michael Eischer c062a78dcd repository: move Blob, Blobs and PackedBlob to pack package
This removes them from the public interface. The latter now only
provides the PackBlob interface, without being bound to the type used
internally by the pack package.
2026-06-13 18:58:37 +02:00
Michael Eischer 35af104749 restic: change LookupBlob to return []PackBlob 2026-06-13 17:54:58 +02:00
Michael Eischer ccb5ae1592 restic: change ListBlobs to return PackBlob
PackBlob is a limited interface that only exposes a part of the
information provided by PackedBlob. Most of the changes are switches
from direct value lookups to the interface methods, with a few larger
changes to let the tests still work.
2026-06-13 17:54:38 +02:00
Michael Eischer c060c317d3 repository: unexport listPacksFromIndex
`ListPacksFromIndex` only has repository-internal callers left (besides
test code).
2026-06-13 17:54:03 +02:00
Michael Eischer a9e0b46358 restic: list pack header via ListPackHandles
Replace ListPack with ListPackHandles so callers only receive blob
handles from pack headers, not layout fields.
2026-06-13 17:50:21 +02:00
Michael Eischer 8169814b38 restic: switch LoadBlobsFromPack to BlobHandles
LoadBlobsFromPack now resolves the handles to Blobs. Repository internal
code can still use the Blob-based method.

The loader used in the filerestorer test now has to implement sorting
the blobs by offset itself as it no longer has access to the repository-internal
dataypes.
2026-06-13 17:50:21 +02:00
Michael Eischer f186e1e458 repository: require *Repository for CopyBlobs
Prepare `CopyBlobs` to allow access to unexported methods of the
Repository struct. This requires changing the test to inject the number
of backend connections via a wrapped backend instead of a wrapped
repository.
2026-06-13 17:50:21 +02:00
Winfried Plappert 0938f52f38 tests - more test cases for internal/repository/check.go (#21830)
Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2026-06-13 15:35:48 +00:00
Michael Eischer 0bbfb072af ui/progress: unexport NoopPrinter and add New* function 2026-06-13 16:53:57 +02:00
darkdragon-001 e5dba15367 Json prune (#5239)
Co-authored-by: Alexander Weiss <alex@weissfam.de>
Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2026-06-13 10:38:57 +00:00
Michael Eischer abfc9bbdff Merge pull request #21868 from MichaelEischer/fix-zero-sized-blobs
repository: fix zero-sized blobs in v2 repos
2026-06-11 20:43:38 +02:00
Michael Eischer c745f810b3 backend/cache: use backend types not restic types (#21860) 2026-06-10 22:45:39 +02:00
Michael Eischer 119bb9d9a8 repository: require *Repository for ExaminePack
The function wouldn't work with a different Repository implementation
anyways.
2026-06-10 22:20:28 +02:00
Michael Eischer 8c6ee42d17 debug: move DumpPacks into repository package
Processing pack file internals belongs into the repository package.
2026-06-10 22:20:28 +02:00
Michael Eischer ccddc1914d repository: rename PackError to ErrPackMetadata 2026-06-10 22:20:28 +02:00
Michael Eischer 4bc5eca7ea repository: merge check.go into checker.go 2026-06-10 22:20:28 +02:00
Michael Eischer 17ff3aa5f9 Merge pull request #21841 from MichaelEischer/isolate-repository
prevent imports of repository internals
2026-06-10 22:19:24 +02:00
Michael Eischer 0fc7444e32 repository: fix zero-sized blobs in v2 repos 2026-06-10 22:03:40 +02:00
Michael Eischer 522efd1175 downgrade compress library due to regression with zero-sized blobs
while this should only affect test cases better be safe than sorry.
2026-06-08 22:51:47 +02:00
Michael Eischer 7d25ca9d67 repository: omit unused headerSize from ListPack() 2026-05-31 22:53:00 +02:00