Skip to content

Conversation

@a-gn
Copy link
Owner

@a-gn a-gn commented Oct 24, 2025

Merging Claude's fixes, based on reading borg 1.4's actual code creating these outputs, into my own PR to borg upstream.

ThomasWaldmann and others added 30 commits December 17, 2023 18:46
forward port to get code in sync with 1.4-maint.

use "pip install -e ." before invoking pyinstaller, so we have
the _version.py built by setuptools_scm and also it compiled the
extension modules, so pyinstaller can pick them up.

msys2 hack:

https://stackoverflow.com/questions/76079590/error-plat-name-must-be-one-of-win32-win-amd64-win-arm32-win-arm6
todo: clean clean2 build_usage build_man
…empty-paths-master

PATH: do not accept empty strings, fixes borgbackup#4221
there, it will be packaged and installed, so
that when one runs the testsuite after installing
the pypi package, it will find the conftest.py.
…py-master

move conftest.py to src/borg/testsuite, see borgbackup#6386
docs: add example for borg with-lock
…n-key-gen-master

crypto: use a one-step kdf for session keys, fixes borgbackup#7953
there are multiple issues with that box:
- debian 9 is out of support by debian, out of even lts support since 2022
- it has a OpenSSL 1.x natively (and our source based install also used 1.x) - that is also out of support and noone will care for it.

Also, borg2 will still take a while, so it would be
even more outdated at release time as it already
is now.
same as in 1.4-maint branch
the netbsd vagrant machine tends to segfault, guess due to some kernel or virtualbox issue.

 thus, rather only do 1 tox run, so there is less output to review.
…-master

add script for fetching borg binaries from VMs, fixes borgbackup#7989
ThomasWaldmann and others added 26 commits July 19, 2024 14:43
I usually just uploaded that into the GH release assets,
but let's also have it in git.
…es-master

Vagrant machines updates (port to master)
…des-by-default

make BORG_EXIT_CODES="modern" the default, fixes borgbackup#8110
In this case, the export functions output to stdout.

Also: add a note why this code is needed.
export_paperkey also must not get an already existing directory.
it needs to be like this to support a ~/.pypirc like this,
containing a separate upload token for the borgbackup project:

[distutils]
index-servers =
    borgbackup
    ...

[borgbackup]
repository = https://upload.pypi.org/legacy/
username = __token__
password = pypi-...(token)...
test the healing more thoroughly:
- preservation of correct chunks list in .chunks_healthy
- check that .chunks_healthy is removed after healing
- check that doing another borg check --repair run does not find
  something to heal, again.

also did a datatype consistency fix for item.chunks_healthy list
members: they are now post processed in the same way as item.chunks,
so they have type ChunkListEntry rather than simple tuple.
…g-test-master

improve borg check --repair healing tests, see borgbackup#8302
also: reorder
Add Open Collective to FUNDING.yml
docs: align /etc/backups path references in automated backups deployment guide
Adds Pydantic models that accurately parse Borg 1.4-maint JSON output
based on analysis of the actual source code.

Models include:
- Log line models: ArchiveProgressLogLine, ProgressMessage,
  ProgressPercent, FileStatus, LogMessage
- Result models: BorgCreateResult, BorgListResult
- Archive models: _BorgArchive, _BorgDetailedArchive,
  _BorgArchiveStatistics, _BorgLimitUsage

Key implementation details verified against Borg 1.4-maint source:
- All log lines have 'type' discriminator field
- ArchiveProgressLogLine fields are optional (only present when finished=False)
- Path fields use str (from remove_surrogates()) not Path
- chunker_params can be str or List[Union[str, int]]
- Some _BorgDetailedArchive fields only in borg info, not create

Python 3.10 compatible, mypy type-checked.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@a-gn a-gn changed the title Add Pydantic models for Borg 1.4 JSON output Fix Pydantic models for Borg 1.4 JSON output Oct 24, 2025
@a-gn a-gn force-pushed the 8338-pydantic-models branch from 8b2379a to 314ded7 Compare October 28, 2025 21:57
@a-gn a-gn closed this Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.