The PR changed the code that builds the text report from events and updates the service counters. A review of the changes is required.
Context:
fail=true, the operation must end with an error, without updating the service state and without leaving a new/overwritten report file on disk;exported counter must increase only after a successful file write;last_report_path must point to the path of the last successfully written report.What to check:
Assumptions and run:
cargo test;export_audit_report with a temporary path that points to a file that does not yet exist, and with different sets of events.Rust 1.85.0 (stable), edition 2021. No external crates. OS: any with access to std::fs and writing to a temporary directory. The check assumes running cargo test or equivalent integration calls to the library API.
Use line comments to explain the problem, its impact, the fix and how to test it.