Commit graph

10225 commits

Author SHA1 Message Date
TW
5d80b95a12
Merge pull request #9794 from mr-raj12/pack-files-step9-check-repo-readonly-storehash
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OmniOS, false, omnios, r151056) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.8) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
repository: read-only check by hashing pack/index objects
2026-06-19 21:30:05 +02:00
Mrityunjay Raj
27d693c222 repository: read-only check by hashing pack/index objects, refs #8476 #8572
Implement the read-only repository check by hashing pack and index
objects and comparing against the stored hashes, without writing to the
repository.

Report check progress separately for the index and for the packs, each
ending at 100%.
2026-06-19 23:30:33 +05:30
TW
cd91cfdab8
Merge pull request #9793 from ThomasWaldmann/support-msgpack121-master
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OmniOS, false, omnios, r151056) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.8) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
support msgpack 1.2.1
2026-06-18 23:42:00 +02:00
Thomas Waldmann
890da42276
support msgpack 1.2.1
Port of borgbackup/borg#9790 to master.

Note: the PR's second commit (Archive.delete: don't reuse msgpack Unpacker
after an unpacking failure) does not apply here - on master Archive.delete
no longer unpacks item metadata (it just removes the archive and lets
"borg compact" reclaim space), so the reuse-after-failure code path does
not exist. The streaming RobustUnpacker already creates a fresh Unpacker
on resync.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 22:08:48 +02:00
TW
1dce2eba20
Merge pull request #9789 from mr-raj12/pack-files-step8-sha256-pack-id
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OmniOS, false, omnios, r151056) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.8) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
repository: always name packs by sha256(pack)
2026-06-18 17:52:47 +02:00
Mrityunjay Raj
0ece418991 cleanup: drop leftover pack_id==chunk_id references after sha256 naming, refs #8572
Remove the dead BORG_TESTONLY_SHA256_PACK_ID tox env and CI job, fix the packs.rst pack-id docs, and reword comments/tests to describe sha256 pack naming instead of the removed shortcut.
2026-06-18 19:33:50 +05:30
Mrityunjay Raj
fd17753561 repository: always name packs by sha256(pack), refs #8572
Drop the single-chunk shortcut that reused the chunk_id as the pack_id.
A pack is now always named by sha256 of its bytes, even when it holds a
single chunk, so no code can depend on pack_id == chunk_id.
2026-06-18 18:50:46 +05:30
TW
c63435ebc2
Merge pull request #9787 from ThomasWaldmann/cleanup-common-options
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OmniOS, false, omnios, r151056) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.8) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CI / sha256 pack-id (informational) (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
remote: mark legacy cli options for ssh-rpc remoting
2026-06-18 00:44:23 +02:00
Thomas Waldmann
509c90df3b
remote: mark legacy cli options for ssh-rpc remoting 2026-06-18 00:42:21 +02:00
TW
7df216206f
Merge pull request #9783 from mr-raj12/repository-check-delete-sha256-pack-ids
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OmniOS, false, omnios, r151056) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.8) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CI / sha256 pack-id (informational) (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
repository: make check and delete work at N=1 with sha256 pack ids
2026-06-17 17:41:12 +02:00
Mrityunjay Raj
bec9446a45 repository, repoobj, cache: make check/delete/compact work with sha256 pack_ids, refs #8572 2026-06-17 19:16:53 +05:30
TW
47764e2f70
Merge pull request #9785 from ThomasWaldmann/docs-fixes-master
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OmniOS, false, omnios, r151056) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.8) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CI / sha256 pack-id (informational) (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
docs fixes (master)
2026-06-16 15:56:02 +02:00
Thomas Waldmann
912b2c50c8
docs: update structure diagram 2026-06-16 15:51:00 +02:00
Thomas Waldmann
48308f1969
misc docs updates 2026-06-16 15:21:57 +02:00
Thomas Waldmann
a7990c3702
update general docs 2026-06-16 14:46:57 +02:00
Thomas Waldmann
ce19629b34
docs: update repo-create examples for split --encryption/--id-hash
The repo-create.rst examples were not updated after --encryption was
split into --encryption + --id-hash. Use the real mode name (aes256-ocb)
and show --id-hash as an orthogonal option.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 14:28:03 +02:00
TW
2a82eb0b94
Merge pull request #9784 from ThomasWaldmann/build-usage-man-master
build usage / man
2026-06-16 14:20:17 +02:00
Thomas Waldmann
c4347a9dce
build usage / man 2026-06-16 14:17:43 +02:00
TW
8f6d55cafb
Merge pull request #9782 from ThomasWaldmann/remove-repository-wait-async
repository: drop "wait" arg, make put/delete synchronous
2026-06-16 14:08:41 +02:00
TW
972ccabf29
Merge pull request #9781 from borgbackup/dependabot/pip/requirements.d/pip-dependencies-39deabeb19
build(deps-dev): bump the pip-dependencies group in /requirements.d with 2 updates
2026-06-16 11:53:36 +02:00
Thomas Waldmann
06b10043ec
repository: drop the dead "wait" arg, make put/delete always synchronous
The new borgstore-based Repository inherited put(..., wait=) / delete(..., wait=)
and async_response() from the legacy RemoteRepository's pipelined RPC protocol.
In the new architecture these are dead: borgstore's API is strictly synchronous,
so put/delete ignored wait and ran synchronously, and async_response() was an
empty stub always returning None.

Remove wait and async_response() so the synchronous behavior is explicit, and
clean up every caller that still threaded wait=False / drained async_response()
(cache.add_chunk, archive.py, transfer_cmd.py, and the archive_test mock).

The legacy repository/remote keep their real wait/async implementation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 11:38:35 +02:00
dependabot[bot]
a13672fbd7
build(deps-dev): bump the pip-dependencies group
Bumps the pip-dependencies group in /requirements.d with 2 updates: [tox](https://github.com/tox-dev/tox) and [coverage](https://github.com/coveragepy/coveragepy).


Updates `tox` from 4.53.1 to 4.54.0
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.53.1...4.54.0)

Updates `coverage` from 7.13.5 to 7.14.0
- [Release notes](https://github.com/coveragepy/coveragepy/releases)
- [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst)
- [Commits](https://github.com/coveragepy/coveragepy/compare/7.13.5...7.14.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-version: 4.54.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: pip-dependencies
- dependency-name: coverage
  dependency-version: 7.14.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: pip-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-16 05:43:04 +00:00
TW
b483c9ee11
Merge pull request #9779 from ThomasWaldmann/split-encryption-id-hash-9168
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OmniOS, false, omnios, r151056) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.8) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CI / sha256 pack-id (informational) (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
repo-create: split --encryption into --encryption + --id-hash (#9168)
2026-06-15 20:19:12 +02:00
TW
ebfe0a1855
Merge pull request #9778 from mr-raj12/chunks-index-storage
index: move chunk index to index/ namespace, drop hash seed
2026-06-15 20:17:41 +02:00
Thomas Waldmann
2eef6c8035
crypto: drop the NAME attribute; repo-info builds the suite string from ENC_NAME/IDHASH_NAME
NAME was only read by "borg repo-info" to show the crypto suite. Remove it from
all (current and legacy) key classes and let repo-info assemble the display from
the two real dimensions instead: "<mode>, <ENC_NAME>, <IDHASH_NAME>", e.g.
"Encrypted: Yes (repokey, aes256-ocb, sha256)" or
"Encrypted: No (repokey, authenticated, blake3)".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 19:38:32 +02:00
Mrityunjay Raj
eb30123614 index: move chunk index to index/ namespace, drop hash seed
Name objects by pure sha256 so borgstore can verify them. closes #9758
2026-06-15 23:04:23 +05:30
Thomas Waldmann
98b428b146
repo-create: gate key/passphrase warning on ENC_NAME, not the NAME display string
The "you need KEY AND PASSPHRASE" warning was gated on key.NAME != "plaintext",
a brittle dependency on a human-readable display string. Use the cipher dimension
instead: only plaintext has ENC_NAME == "none"; every key-bearing suite (including
the authenticated ones, which should warn) differs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 19:32:13 +02:00
Thomas Waldmann
ee2aee0a31
repo-info/list --json: emit encryption.keyfile based on key storage, not NAME
The keyfile detection used `key.NAME.startswith("key file")`, but since the
keyfile/repokey unification no key class has such a NAME, so encryption.keyfile
was never emitted (even for keyfile repos). Decide it from the key storage
(KeyBlobStorage.KEYFILE), matching the text repo-info output. Add a test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 19:31:35 +02:00
Thomas Waldmann
2f59abe205
crypto: drop dead ARG_NAME; give legacy key classes ENC_NAME/IDHASH_NAME
ARG_NAME had no readers left after the JSON output switched to ENC_NAME/IDHASH_NAME,
so remove it from all (current and legacy) key classes.

Give the legacy (borg 1.x, read-only) key classes the two dimensions so that
repo-info/list --json reports a meaningful crypto suite for legacy repos instead
of null/null:
- AESCTRKey:            encryption=aes256-ctr, id_hash=sha256
- Blake2AESCTRKey:      encryption=aes256-ctr, id_hash=blake2
- Blake2AuthenticatedKey: encryption=authenticated, id_hash=blake2

IDHASH_NAME="blake2" is set on the ID_BLAKE2b_256 mix-in (parallel to the
ID_HMAC_SHA_256 / ID_BLAKE3_256 mix-ins). These legacy values never become CLI
choices: encryption_argument_names()/id_hash_argument_names() only iterate
AVAILABLE_KEY_TYPES, not LEGACY_KEY_TYPES.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 18:39:41 +02:00
Thomas Waldmann
479a77b512
repo-info/list --json: report encryption + id_hash separately, #9168
Stop using key.ARG_NAME (the combined crypto-suite name) for the JSON output.
The "encryption" object now mirrors the split CLI options: the "mode" field is
replaced by "encryption" (cipher / AE algorithm, key.ENC_NAME) and "id_hash"
(id hash function, key.IDHASH_NAME).

This is a breaking change to the documented JSON API.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 18:31:27 +02:00
Thomas Waldmann
29a760e2b3
repo-create: split --encryption into --encryption + --id-hash, #9168
The combined --encryption value packed two orthogonal dimensions (cipher / AE
algorithm and id hash function) into a single string, causing a combinatorial
explosion of mode names. Key location was already split out into --key-location.

Now:
- --encryption selects only the cipher / AE algorithm:
  none, authenticated, aes256-ocb, chacha20-poly1305
- --id-hash selects the id hash function: sha256 (default) or blake3
- --key-location (unchanged) selects key storage: repokey (default) or keyfile

The old combined names were removed (clean break): select a BLAKE3 suite via
--encryption ... --id-hash blake3 instead of blake3-*. aes-ocb was renamed to
aes256-ocb (key NAME shown by repo-info and ARG_NAME in JSON updated to match).
"none" has no key, so it only supports the sha256 id hash.

No on-disk format, key-type byte, or crypto behavior changes: the existing key
classes form a clean cross-product of {cipher} x {id-hash}, selected via the new
ENC_NAME / IDHASH_NAME class attributes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 17:44:38 +02:00
TW
dbc38ab66c
Merge pull request #9740 from borgbackup/dependabot/github_actions/actions-484570b1b1
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OmniOS, false, omnios, r151056) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.8) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CI / sha256 pack-id (informational) (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
build(deps): bump codecov/codecov-action from 6 to 7 in the actions group
2026-06-15 01:54:28 +02:00
TW
a671dd9b44
Merge pull request #9776 from ThomasWaldmann/py37-modernize
modernize: use Python 3.7+ features
2026-06-15 00:08:51 +02:00
Thomas Waldmann
9ba7241a6e
modernize: use Python 3.7+ features
Follow-up to the py38-modernize work, covering features available
since Python 3.7 (the minimum supported version is 3.11):

- replace collections.OrderedDict with plain dict where no OrderedDict-
  specific API is used: dict preserves insertion order since 3.7, so
  OrderedDict is only needed for move_to_end()/popitem(last=...):
  - archive.compare_archives: orphans_archive1/2 (annotation + value)
  - prune_cmd.PRUNING_PATTERNS (now a plain dict literal)
  - help_cmd.HelpMixIn.helptext
  - parseformat prepare_dump_dict.decode

  helpers.lrucache keeps OrderedDict (uses move_to_end/popitem(last)).

Most other Python 3.7 features are already in use (time_ns/monotonic_ns,
datetime.fromisoformat, namedtuple defaults), so this pass is small.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 20:50:50 +02:00
TW
f31ee4cf4d
Merge pull request #9775 from ThomasWaldmann/py38-modernize
modernize: use Python 3.8+ features
2026-06-14 20:42:36 +02:00
TW
b7870ff44e
Merge pull request #9774 from ThomasWaldmann/py39-modernize
modernize: use Python 3.9+ features
2026-06-14 17:50:01 +02:00
Thomas Waldmann
d5b3ffa980 modernize: use Python 3.8+ features
Follow-up to the py39-modernize work, covering features available
since Python 3.8 (the minimum supported version is 3.11):

- use the walrus operator (PEP 572) for assignment expressions where
  it removes a separate assign-then-test line and reads more clearly:
  - version.parse_version: inline the re.match result into the test
  - nanorst.rst_to_text: while char := text.read(1)
  - cockpit.runner read_stream: while line := await stream.readline()
  - tar_cmds._import_tar: while tarinfo := tar.next()

Most other Python 3.8 features are already in use (shlex.join, bare
@lru_cache, typing.Protocol/Literal), so this pass is small.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 17:35:20 +02:00
Thomas Waldmann
f5e5aa59f0
modernize: use Python 3.9+ features
Follow-up to the py310-modernize work, covering features available
since Python 3.9 (the minimum supported version is 3.11):

- functools.cache instead of lru_cache(maxsize=None) (posix_ug, windows_ug)
- str.removeprefix() instead of slicing by len() (serve_cmd)
- PEP 585 built-in generics (list/dict/tuple/set/type) in the .pyi stubs
- collections.abc instead of typing for Callable/Iterator/Mapping/...
  in the .pyi stubs and runtime modules (chunkers, cockpit)
- PEP 604 union types (X | None) in crypto/low_level.pyi, which the
  py310-modernize pass had missed

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 16:55:18 +02:00
TW
350ec8bc36
Merge pull request #9744 from mr-raj12/pack-files-step6-range-load
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OmniOS, false, omnios, r151056) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.8) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CI / sha256 pack-id (informational) (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
repository: ChunkIndex-based pack routing with range-load support
2026-06-14 16:47:10 +02:00
TW
46d5c96cb4
Merge pull request #9773 from ThomasWaldmann/py310-modernize
use Python 3.10 features: match statements and PEP 604 unions
2026-06-14 15:36:29 +02:00
Mrityunjay Raj
ea4be4d2c4 repository: make failing-store test helper fail only pack writes
Lets one store both fail the pack write and persist the index, matching production.
2026-06-14 18:36:13 +05:30
Thomas Waldmann
b46bfdab18 use structural pattern matching (match/case, Python 3.10)
Convert if/elif chains that dispatch on a single value to match
statements: repository.borg_permissions (permission preset),
CompressionSpec.__init__/compressor/__str__ (compression name),
calculate_relative_offset (relative ts unit) and the cockpit widget
file-status counter. Membership checks like 'in ("none", "lz4")'
become alternative patterns ('none' | 'lz4').

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 14:04:25 +02:00
Thomas Waldmann
f25c580ec4 use PEP 604 union types (X | None) instead of typing.Optional
Replace the remaining typing.Optional[...] annotations with the
X | None syntax (PEP 604, Python 3.10) and drop the now-unused
Optional/List imports; List[str] -> list[str] in cockpit/runner.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 14:02:33 +02:00
TW
70226f0a5a
Merge pull request #9772 from ThomasWaldmann/py311-modernize
Use some Python 3.11 features (StrEnum, datetime.UTC, contextlib.chdir)
2026-06-14 13:55:27 +02:00
Thomas Waldmann
fe1f0c7d76 use contextlib.chdir (Python 3.11) in tests
Replace the hand-rolled changedir() context manager with stdlib
contextlib.chdir (kept under the changedir name for importers), and
use it in the archiver fixture so the cwd is restored even if the
test body raises.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 12:20:40 +02:00
Thomas Waldmann
0ebfb55df0 use Python 3.11 features: StrEnum and datetime.UTC
Manifest.Operation now derives from enum.StrEnum, so its members are
real str instances; drop the .value indirection in the feature-flag
lookups.

Replace timezone.utc with the datetime.UTC alias (3.11) across the
non-test modules and drop the now-unused timezone imports.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 12:20:29 +02:00
Mrityunjay Raj
f917c90256 repository: roll back chunk index on failed pack store
flush() drops the entries add() pre-marked when store.store() raises, so a never-stored chunk is not left indexed for dedup. adds rollback tests, bumps large-meta test to 5KB, drops security wording from the read_data=False clamp comments.
2026-06-14 15:40:43 +05:30
TW
ff3133edc6
Merge pull request #9771 from ThomasWaldmann/fix-spoofed-archive-flaky
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OmniOS, false, omnios, r151056) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.8) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
testsuite: fix flaky byte-corruption in check_cmd tests
2026-06-14 00:41:40 +02:00
TW
5e2da157be
Merge pull request #9769 from ThomasWaldmann/docs-key-subcommands
docs: add docs for "key add", "key list" and "key remove"
2026-06-13 23:47:58 +02:00
Thomas Waldmann
27401aa02c testsuite: fix flaky byte-corruption in check_cmd tests
Several check_cmd tests corrupted a repo object by overwriting a byte at
a fixed position with a fixed value, e.g.:

    manifest[:250] + b"x" + manifest[251:]

Manifests/chunks are stored as AEAD-encrypted repo objects, so their
bytes are ~random. When the target byte already happened to hold the
overwrite value (~1/256), the "corruption" was a no-op: the object
stayed valid, "check" returned 0 instead of 1, and the test failed
intermittently (observed in test_spoofed_archive).

Introduce a corrupt(data, position) helper that flips the byte (XOR
0xFF), so the result is guaranteed to differ, and use it in all the
byte-overwrite corruption sites: test_corrupted_manifest,
test_spoofed_manifest, test_manifest_rebuild_corrupted_chunk,
test_spoofed_archive, test_verify_data and test_corrupted_file_chunk.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 23:14:11 +02:00