debug format-obj: support all repo object types, fixes #9391#9393
Merged
ThomasWaldmann merged 1 commit intoborgbackup:masterfrom Feb 28, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9393 +/- ##
=======================================
Coverage 76.47% 76.48%
=======================================
Files 85 85
Lines 14803 14804 +1
Branches 2213 2213
=======================================
+ Hits 11321 11323 +2
Misses 2803 2803
+ Partials 679 678 -1 ☔ View full report in Codecov by Sentry. |
de71daa to
be42fdf
Compare
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
do_debug_format_objhardcodesro_type=ROBJ_FILE_STREAM, ignoring the"type"field in the metadata JSONThis breaks the debug round-trip (
get-obj → parse-obj → [edit] → format-obj → put-obj) for non-file-stream objects (manifest, archive metadata, archive chunkids, archive stream)parse-objalready outputs the"type"field in metadata JSON, andRepoObj.format()is fully genericro_typefrom metadata dict, matching the existing pattern inrepo_compress_cmd.py:46Fixes borg debug format-obj hardcodes ROBJ_FILE_STREAM, should support all repo object types #9391
Changes
src/borg/archiver/debug_cmd.pyROBJ_FILE_STREAMwithmeta.pop("type", ROBJ_FILE_STREAM)src/borg/testsuite/archiver/debug_cmds_test.pytest_debug_format_obj_respects_type— round-trip test withROBJ_ARCHIVE_STREAMChecklist
master