[ci] Skip memory impact analysis when more than 40 components changed (#11741)

This commit is contained in:
J. Nick Koston
2025-11-05 19:31:23 -06:00
committed by GitHub
parent 20b6e0d5c2
commit bdfd88441a
2 changed files with 72 additions and 17 deletions

View File

@@ -94,6 +94,7 @@ class Platform(StrEnum):
# Memory impact analysis constants
MEMORY_IMPACT_FALLBACK_COMPONENT = "api" # Representative component for core changes
MEMORY_IMPACT_FALLBACK_PLATFORM = Platform.ESP32_IDF # Most representative platform
MEMORY_IMPACT_MAX_COMPONENTS = 40 # Max components before results become nonsensical
# Platform-specific components that can only be built on their respective platforms
# These components contain platform-specific code and cannot be cross-compiled
@@ -555,6 +556,17 @@ def detect_memory_impact_config(
if not components_with_tests:
return {"should_run": "false"}
# Skip memory impact analysis if too many components changed
# Building 40+ components at once produces nonsensical memory impact results
# This typically happens with large refactorings or batch updates
if len(components_with_tests) > MEMORY_IMPACT_MAX_COMPONENTS:
print(
f"Memory impact: Skipping analysis for {len(components_with_tests)} components "
f"(limit is {MEMORY_IMPACT_MAX_COMPONENTS}, would give nonsensical results)",
file=sys.stderr,
)
return {"should_run": "false"}
# Find common platforms supported by ALL components
# This ensures we can build all components together in a merged config
common_platforms = set(MEMORY_IMPACT_PLATFORM_PREFERENCE)