From 95a0c9594f3f94bdcb57ac173f6b6ffb49ed8d2b Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 17 Oct 2025 15:12:36 -1000 Subject: [PATCH] tweak --- script/ci_memory_impact_comment.py | 6 +++--- script/ci_memory_impact_extract.py | 10 ++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/script/ci_memory_impact_comment.py b/script/ci_memory_impact_comment.py index c5eb9e701f..140bd2f08e 100755 --- a/script/ci_memory_impact_comment.py +++ b/script/ci_memory_impact_comment.py @@ -238,7 +238,7 @@ def create_detailed_breakdown_table( # Combine all components from both analyses all_components = set(target_analysis.keys()) | set(pr_analysis.keys()) - # Filter to components that have changed or are significant + # Filter to components that have changed changed_components = [] for comp in all_components: target_mem = target_analysis.get(comp, {}) @@ -247,8 +247,8 @@ def create_detailed_breakdown_table( target_flash = target_mem.get("flash_total", 0) pr_flash = pr_mem.get("flash_total", 0) - # Include if component has changed or is significant (> 1KB) - if target_flash != pr_flash or target_flash > 1024 or pr_flash > 1024: + # Only include if component has changed + if target_flash != pr_flash: delta = pr_flash - target_flash changed_components.append((comp, target_flash, pr_flash, delta)) diff --git a/script/ci_memory_impact_extract.py b/script/ci_memory_impact_extract.py index 7b722fcfd4..96f947e12a 100755 --- a/script/ci_memory_impact_extract.py +++ b/script/ci_memory_impact_extract.py @@ -67,6 +67,7 @@ def extract_from_compile_output( # Extract build directory from ESPHome's explicit build path output # Look for: INFO Compiling app... Build path: /path/to/build + # Note: Multiple builds reuse the same build path (each overwrites the previous) build_dir = None if match := re.search(r"Build path: (.+)", output_text): build_dir = match.group(1).strip() @@ -226,6 +227,10 @@ def main() -> int: f"Found {num_builds} builds - summing memory usage across all builds", file=sys.stderr, ) + print( + "WARNING: Detailed analysis will only cover the last build", + file=sys.stderr, + ) print(f"Total RAM: {ram_bytes} bytes", file=sys.stderr) print(f"Total Flash: {flash_bytes} bytes", file=sys.stderr) @@ -235,6 +240,11 @@ def main() -> int: if detected_build_dir: print(f"Detected build directory: {detected_build_dir}", file=sys.stderr) + if num_builds > 1: + print( + f" (using last of {num_builds} builds for detailed analysis)", + file=sys.stderr, + ) # Write build directory to file if requested if args.output_build_dir and build_dir: