Skip to content

feat: add machine-readable JSON output mode#56

Closed
KGFCH2 wants to merge 1 commit into
Rakshat28:mainfrom
KGFCH2:feature/json-output-support
Closed

feat: add machine-readable JSON output mode#56
KGFCH2 wants to merge 1 commit into
Rakshat28:mainfrom
KGFCH2:feature/json-output-support

Conversation

@KGFCH2

@KGFCH2 KGFCH2 commented May 11, 2026

Copy link
Copy Markdown
Contributor

@Rakshat28

Addresses #47.

Summary

This PR introduces a professional JSON output mode for bdstorage, enabling seamless integration with automation pipelines, DevOps workflows, and external reporting systems.

Key Changes

Structured Output

  • Added support for --output-format json.
  • Produces a structured machine-readable summary of the deduplication run.

JSON Schema Support

The JSON output now includes:

  • files_scanned — Total number of files analyzed.
  • duplicate_groups — Number of duplicate file groups detected.
  • bytes_saved — Actual disk space reclaimed during execution.
  • vault_objects_added — Number of new objects added to the content-addressable vault.
  • links_created — Total count of reflinks or hard links created.
  • errors — Structured list of processing failures, including:
    • File path
    • Error reason
    • Relevant operation context

CI/CD Optimization

  • Automatically disables interactive terminal UI elements in JSON mode, including:
    • Progress bars
    • Spinners
    • ANSI control sequences
  • Ensures stdout remains clean and pipe-friendly for tools such as jq, CI runners, and log processors.

Improved Error Capture

  • Refactored path-specific error handling so failures are collected as structured data rather than only printed to the terminal.
  • Improves observability and downstream automation reliability.

Result

These enhancements make bdstorage significantly easier to integrate into larger automation ecosystems, backup workflows, monitoring pipelines, and enterprise storage tooling.

@Rakshat28 Rakshat28 closed this May 13, 2026
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