Skip to content

legacy: extract LegacyArchives into legacy/archives.py, add ArchivesInterface, refs #9556#9639

Closed
mr-raj12 wants to merge 1 commit into
borgbackup:masterfrom
mr-raj12:master
Closed

legacy: extract LegacyArchives into legacy/archives.py, add ArchivesInterface, refs #9556#9639
mr-raj12 wants to merge 1 commit into
borgbackup:masterfrom
mr-raj12:master

Conversation

@mr-raj12
Copy link
Copy Markdown
Contributor

@mr-raj12 mr-raj12 commented May 13, 2026

Moves the Borg 1.x archive list management out of Archives and into LegacyArchives, refs #9556.

  • LegacyArchives extracted from Archives into legacy/archives.py
  • Archives in manifest.py is now 2.x only as all self.legacy branches removed
  • ArchivesInterface added to manifest.py as a @runtime_checkable Protocol as mypy/pyright will catch drift between the two implementations
  • Manifest.__init__ picks LegacyArchives or Archives based on repository type via lazy imports

No logic changes. borg transfer --from-borg1 keeps working through borg.legacy.archives. borg serve for v1 clients is unaffected — it only opens LegacyRepository for raw RPC byte-forwarding and never instantiates LegacyArchives.

Refs #9556

Checklist

  • PR is against master
  • New code has tests
  • Tests pass
  • Commit message references related issue

@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

❌ Patch coverage is 48.07692% with 108 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.97%. Comparing base (de0f7ac) to head (bf756da).
⚠️ Report is 21 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/borg/legacy/archives.py 47.97% 67 Missing and 10 partials ⚠️
src/borg/manifest.py 48.33% 9 Missing and 22 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9639      +/-   ##
==========================================
- Coverage   83.31%   82.97%   -0.35%     
==========================================
  Files          89       90       +1     
  Lines       15549    15673     +124     
  Branches     2343     2374      +31     
==========================================
+ Hits        12955    13005      +50     
- Misses       1838     1889      +51     
- Partials      756      779      +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread src/borg/legacy/archives.py
Comment thread src/borg/manifest.py
Comment thread src/borg/manifest.py
Comment thread src/borg/manifest.py
@ThomasWaldmann
Copy link
Copy Markdown
Member

This is a good first step for the archives list part of the Manifest.

In a further step (not this PR) we could try whether we still need other parts of the Manifest or whether we could get rid of them.

The main reason why this thing was called Manifest in borg 1.x (the manifest as a signed list of archives) is not in the manifest blob anymore in borg2.

@mr-raj12 mr-raj12 deleted the branch borgbackup:master May 14, 2026 14:53
@mr-raj12 mr-raj12 closed this May 14, 2026
@mr-raj12 mr-raj12 deleted the master branch May 14, 2026 14:53
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.

2 participants