Skip to main content

write_context_jsonl

Function write_context_jsonl 

Source
pub fn write_context_jsonl(record: &ReviewContextRecord)
Expand description

Append a PR review context record to the context JSONL file.

Reads the APTU_CONTEXT_FILE environment variable. If not set, this is a no-op. If set, opens the file in append mode (creating it if necessary) and writes a single JSON line followed by a newline.

On any error (file I/O, serialization), logs a warning and returns normally. This function never fails the caller’s operation.

APTU_CONTEXT_FILE is validated to be non-empty when first encountered; an empty value is rejected with a warning so misconfiguration is visible rather than silently dropped. Open/write errors are also warned and discarded so that a bad path never aborts the caller.