Skip to content

debug format-obj: support all repo object types, fixes #9391#9393

Merged
ThomasWaldmann merged 1 commit intoborgbackup:masterfrom
mr-raj12:fix-debug-format-obj-robj-type
Feb 28, 2026
Merged

debug format-obj: support all repo object types, fixes #9391#9393
ThomasWaldmann merged 1 commit intoborgbackup:masterfrom
mr-raj12:fix-debug-format-obj-robj-type

Conversation

@mr-raj12
Copy link
Contributor

Description

  • do_debug_format_obj hardcodes ro_type=ROBJ_FILE_STREAM, ignoring the "type" field in the metadata JSON

  • This 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-obj already outputs the "type" field in metadata JSON, and RepoObj.format() is fully generic
    • Fix: extract ro_type from metadata dict, matching the existing pattern in repo_compress_cmd.py:46

    Fixes borg debug format-obj hardcodes ROBJ_FILE_STREAM, should support all repo object types #9391

    Changes

    File Change
    src/borg/archiver/debug_cmd.py Replace hardcoded ROBJ_FILE_STREAM with meta.pop("type", ROBJ_FILE_STREAM)
    src/borg/testsuite/archiver/debug_cmds_test.py Add test_debug_format_obj_respects_type — round-trip test with ROBJ_ARCHIVE_STREAM

    Checklist

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

@codecov
Copy link

codecov bot commented Feb 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.48%. Comparing base (0b05b44) to head (be42fdf).
⚠️ Report is 5 commits behind head on master.
✅ All tests successful. No failed tests found.

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.
📢 Have feedback on the report? Share it here.

@mr-raj12 mr-raj12 force-pushed the fix-debug-format-obj-robj-type branch from de71daa to be42fdf Compare February 28, 2026 01:46
Copy link
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 ThomasWaldmann merged commit c181845 into borgbackup:master Feb 28, 2026
19 checks passed
@ThomasWaldmann
Copy link
Member

Thanks!

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.

borg debug format-obj hardcodes ROBJ_FILE_STREAM, should support all repo object types

2 participants