rustic_core icon indicating copy to clipboard operation
rustic_core copied to clipboard

feat: Improve summary handling and error reporting in repository checks

Open simonsan opened this issue 1 year ago • 2 comments

Enhance the check_repository and check_cache_files functions to return a Summary, improve concurrency handling, and strengthen error logging for better reporting. Refactor summary handling in related functions for consistency.

Based on #365

simonsan avatar Nov 25 '24 13:11 simonsan

Codecov Report

Attention: Patch coverage is 33.05785% with 81 lines in your changes missing coverage. Please review.

Project coverage is 42.0%. Comparing base (4b3d073) to head (a2aee81). Report is 2 commits behind head on feat/summary.

Files with missing lines Patch % Lines
crates/core/src/commands/check.rs 30.4% 73 Missing :warning:
crates/core/src/commands/merge.rs 0.0% 5 Missing :warning:
crates/core/src/archiver.rs 75.0% 2 Missing :warning:
crates/core/src/repository.rs 66.6% 1 Missing :warning:
Additional details and impacted files
Files with missing lines Coverage Δ
crates/core/tests/integration.rs 84.0% <ø> (+4.0%) :arrow_up:
crates/core/src/repository.rs 42.4% <66.6%> (+0.1%) :arrow_up:
crates/core/src/archiver.rs 58.9% <75.0%> (-0.8%) :arrow_down:
crates/core/src/commands/merge.rs 0.0% <0.0%> (ø)
crates/core/src/commands/check.rs 57.4% <30.4%> (-4.8%) :arrow_down:

... and 5 files with indirect coverage changes

---- 🚨 Try these New Features:

codecov[bot] avatar Nov 25 '24 13:11 codecov[bot]

I'm still debating with myself, if passing in a summary: Arc<Mutex<Summary>> into the check functions would be better, instead of returning the Summary and initializing it at the beginning of the functions, calling complete at the end. For now, we have clearer contexts and timings due to that. But we could also add that functionality based on passing in a summary. We could impl start/stop on Summary, for timing purposes.

I do think it's a bit cleaner separation, to return a Summary and then merge it with the Summary up in the call stack.

simonsan avatar Nov 25 '24 17:11 simonsan