Add phase field to file_status JSON output (start/end lifecycle events)#9532
Add phase field to file_status JSON output (start/end lifecycle events)#9532YK-03 wants to merge 2 commits intoborgbackup:masterfrom
Conversation
ThomasWaldmann
left a comment
There was a problem hiding this comment.
Had a quick look: this does not look correct:
- for file types where there is basically nothing to do (because they have no content data), it emits start and end.
- for some file types and processing modes (--read-special) where there is a lot to do (processing chunks of content data), it does not emit start/end.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9532 +/- ##
==========================================
- Coverage 83.36% 83.33% -0.04%
==========================================
Files 87 87
Lines 15447 15496 +49
Branches 2311 2332 +21
==========================================
+ Hits 12878 12913 +35
- Misses 1818 1823 +5
- Partials 751 760 +9 ☔ View full report in Codecov by Sentry. |
|
I’ll update the implementation to ensure start and end events are emitted consistently for all files, including --read-special, by wrapping the entire processing lifecycle (including chunk-based processing). I’ll also add tests to cover these scenarios and ensure consistent behavior. |
|
The lifecycle emission logic has been verified:
All related tests pass: This has been validated across regular files, symlinks, and --read-special paths. |
Description
This PR adds an optional
"phase"field to"type": "file_status"JSON output to indicate lifecycle stages of file processing."phase": "start"is emitted when processing of a file begins"phase": "end"is emitted for final file status events (default if not explicitly provided)Implementation details
Archiver.print_file_statusCreateMixIn._process_anybefore dispatching tofso.process_*retry == 0to avoid duplicate events"phase"defaulting to"end"Behavior
JSON mode (
--log-json --list)Non-JSON mode (
--list)None pathoutputCompatibility
type,status,path) unchanged"phase"is additive and optionalChecklist
master