version: add --json output - #9997
Draft
Bondo2-1 wants to merge 1 commit into
Draft
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9997 +/- ##
==========================================
- Coverage 85.88% 85.81% -0.08%
==========================================
Files 95 95
Lines 17088 17095 +7
Branches 2616 2617 +1
==========================================
- Hits 14676 14670 -6
- Misses 1674 1685 +11
- Partials 738 740 +2 ☔ View full report in Codecov by Harness. |
Member
|
@Bondo2-1 Thanks for the PR! CI tests are failing on windows still due to the line endings: Other than that, it looks pretty good, so guess you could click "Ready for review" after fixing this (and when you think you are finished with it). |
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
Add a
--jsonoption toborg versionthat emits the formatted client and server versions as named fields:{ "client": "2.0.0b23", "server": "2.0.0b23" }The existing text output remains unchanged when
--jsonis not supplied. This gives tooling a stable, machine-readable format and makesborg versionconsistent with Borg's other status commands.Focused command tests cover both the existing text format and the new JSON format. The generated usage documentation now includes the new option.
Fixes #9993.
Validation
python -m pytest -q src/borg/testsuite/archiver/version_cmd_test.py(2 passed)pre-commit run --files src/borg/archiver/version_cmd.py src/borg/testsuite/archiver/version_cmd_test.py(Black and Ruff passed)python scripts/make.py build_usageborg version --jsonsmoke testChecklist
master(or maintenance branch if only applicable there)