Skip to content

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

Merged
ThomasWaldmann merged 2 commits into
borgbackup:masterfrom
mr-raj12:legacy-archives-extract
May 14, 2026
Merged

legacy: extract LegacyArchives into legacy/archives.py, add ArchivesInterface, refs #9556#9644
ThomasWaldmann merged 2 commits into
borgbackup:masterfrom
mr-raj12:legacy-archives-extract

Conversation

@mr-raj12
Copy link
Copy Markdown
Contributor

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 14, 2026

Codecov Report

❌ Patch coverage is 53.19149% with 88 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.08%. Comparing base (de0f7ac) to head (6659bd9).
⚠️ 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 72.50% 8 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9644      +/-   ##
==========================================
- Coverage   83.31%   83.08%   -0.23%     
==========================================
  Files          89       90       +1     
  Lines       15549    15653     +104     
  Branches     2343     2356      +13     
==========================================
+ Hits        12955    13006      +51     
- Misses       1838     1887      +49     
- Partials      756      760       +4     

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

@mr-raj12 mr-raj12 force-pushed the legacy-archives-extract branch from e18556c to 6659bd9 Compare May 14, 2026 15:18
@mr-raj12
Copy link
Copy Markdown
Contributor Author

i have made a file for legacy archive tests which i m thinking to put as a follow up pr to this
https://gist.github.com/mr-raj12/6ba355afa30eea74985a2a5025c2e929

Copy link
Copy Markdown
Member

@ThomasWaldmann ThomasWaldmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ThomasWaldmann
Copy link
Copy Markdown
Member

@mr-raj12 Merge or do you have anything pending for this?

@mr-raj12
Copy link
Copy Markdown
Contributor Author

mr-raj12 commented May 14, 2026

@mr-raj12 Merge or do you have anything pending for this?

this PR can be merged , as mentioned will raise different PR for legacy_archives_tests

@ThomasWaldmann ThomasWaldmann merged commit 0a1570f into borgbackup:master May 14, 2026
18 of 20 checks passed
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