Skip to content

Json check#5194

Merged
MichaelEischer merged 4 commits intorestic:masterfrom
darkdragon-001:json-check
Feb 5, 2025
Merged

Json check#5194
MichaelEischer merged 4 commits intorestic:masterfrom
darkdragon-001:json-check

Conversation

@darkdragon-001
Copy link
Copy Markdown
Contributor

@darkdragon-001 darkdragon-001 commented Dec 30, 2024

What does this PR change? What problem does it solve?

Add JSON output to the check command.

Was the change previously discussed in an issue or on the forum?

Fixes #1378
Closes #4581

Checklist

  • I have added tests for all code changes.
  • I have added documentation for relevant changes (in the manual).
  • There's a new file in changelog/unreleased/ that describes the changes for our users (see template).
  • I'm done! This pull request is ready for review.

@darkdragon-001 darkdragon-001 force-pushed the json-check branch 5 times, most recently from 02ec0db to 956e354 Compare December 30, 2024 22:53
@darkdragon-001
Copy link
Copy Markdown
Contributor Author

I am not sure about the last commit: Do we want to assemble such an extensive summary or are we fine with just wrapping the errors into JSON?

@darkdragon-001 darkdragon-001 force-pushed the json-check branch 5 times, most recently from f86484e to 4f6773f Compare December 30, 2024 23:46
@darkdragon-001 darkdragon-001 marked this pull request as ready for review December 30, 2024 23:49
Copy link
Copy Markdown
Member

@MichaelEischer MichaelEischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Letting the check command only print a summary just works if a repository is not damaged. For a damaged repository, all error messages must also be available in the JSON output, otherwise we'll end up in a situation where all relevant information is missing. The summary by itself is mostly useless when it comes to debug what is wrong with a repository.

I wouldn't be terribly opposed to having an error and warning output message that for now just includes the formatted text output. If necessary, we could introduce an "error_code" field in the future to allow for more automation.

@darkdragon-001 darkdragon-001 force-pushed the json-check branch 5 times, most recently from 6456bdb to b713938 Compare February 2, 2025 12:26
@darkdragon-001
Copy link
Copy Markdown
Contributor Author

@MichaelEischer Thanks for your review! I acted upon all threads. Please take another look.

Copy link
Copy Markdown
Member

@MichaelEischer MichaelEischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes so far! I have a few more comments.

@darkdragon-001 darkdragon-001 force-pushed the json-check branch 9 times, most recently from b013f55 to d4404b2 Compare February 2, 2025 17:30
@darkdragon-001 darkdragon-001 force-pushed the json-check branch 3 times, most recently from 3566e90 to 1aa98fb Compare February 2, 2025 17:40
@darkdragon-001
Copy link
Copy Markdown
Contributor Author

@MichaelEischer I addressed all remaining comments. Could you please take another look?

Copy link
Copy Markdown
Member

@MichaelEischer MichaelEischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few more small nits, but then we should be done.

@darkdragon-001
Copy link
Copy Markdown
Contributor Author

@MichaelEischer Thanks for your thorough review! I acted upon your review comments. Could you please take another look?

Copy link
Copy Markdown
Member

@MichaelEischer MichaelEischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@MichaelEischer MichaelEischer merged commit da47967 into restic:master Feb 5, 2025
11 checks passed
@darkdragon-001 darkdragon-001 deleted the json-check branch February 5, 2025 21:15
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.

JSON Output for restic check command

2 participants