debug format-obj: support all repo object types, fixes #9391#9393
Open
mr-raj12 wants to merge 1 commit intoborgbackup:masterfrom
Open
debug format-obj: support all repo object types, fixes #9391#9393mr-raj12 wants to merge 1 commit intoborgbackup:masterfrom
mr-raj12 wants to merge 1 commit intoborgbackup:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9393 +/- ##
=======================================
Coverage 76.43% 76.44%
=======================================
Files 85 85
Lines 14800 14801 +1
Branches 2212 2212
=======================================
+ Hits 11313 11314 +1
Misses 2809 2809
Partials 678 678 ☔ View full report in Codecov by Sentry. |
| create_regular_file(archiver.input_path, "meta.json", contents=meta) | ||
| output = cmd(archiver, "debug", "id-hash", "input/plain.bin") | ||
| id_hash = output.strip() | ||
| cmd(archiver, "debug", "format-obj", id_hash, "input/plain.bin", "input/meta.json", "output/data.bin") |
Member
There was a problem hiding this comment.
maybe rather rename for more clarity:
input/plain.bin -> input/data.bin
output/data.bin -> output/repoobj.bin
Member
There was a problem hiding this comment.
or even better: input/repoobj.bin (it is input for the put-object you do next)
also rename the other places accordingly.
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