From e3f5ce14ed0b8e8f36b54b2d08adfd4c3a40d64e Mon Sep 17 00:00:00 2001 From: manthan Date: Tue, 20 Oct 2026 01:56:01 +0530 Subject: [PATCH] fix: preserve callflow HTML on staging failure --- graphify/callflow_html.py | 12 ++--- tests/test_callflow_html.py | 103 ++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+), 6 deletions(-) diff --git a/graphify/callflow_html.py b/graphify/callflow_html.py index 3c8a34b41f..f2d038e06f 100644 --- a/graphify/callflow_html.py +++ b/graphify/callflow_html.py @@ -30,7 +30,7 @@ from datetime import datetime, timezone from html import escape -from graphify.paths import GRAPHIFY_OUT, GRAPHIFY_OUT_NAME +from graphify.paths import GRAPHIFY_OUT, GRAPHIFY_OUT_NAME, write_text_atomic # ────────────────────────────────────────────── @@ -1991,14 +1991,14 @@ def write_callflow_html( """) # Write output - output = "\n".join(html) + rendered_html = "\n".join(html) output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(output, encoding="utf-8") + write_text_atomic(output_path, rendered_html) # Summary - mermaid_count = output.count('
') - table_count = output.count('') - section_count = output.count('

') + table_count = rendered_html.count('

') + section_count = rendered_html.count('