mirror of
https://github.com/esphome/esphome.git
synced 2025-10-12 14:53:49 +01:00
fix merge
This commit is contained in:
@@ -83,27 +83,21 @@ def create_intelligent_batches(
|
|||||||
|
|
||||||
sorted_groups = sorted(signature_groups.items(), key=sort_key)
|
sorted_groups = sorted(signature_groups.items(), key=sort_key)
|
||||||
|
|
||||||
# Strategy: Keep all components with the same bus signature together
|
# Strategy: Sort all components by signature group, then take batch_size at a time
|
||||||
# Each signature group becomes ONE batch that will be merged into a single build
|
# - Components with the same signature stay together (sorted first by signature)
|
||||||
# Only ungroupable components (signature "none") get split into multiple batches
|
# - Simply split into batches of batch_size for CI parallelization
|
||||||
|
# - Natural grouping occurs because components with same signature are consecutive
|
||||||
|
|
||||||
|
# Flatten all groups in signature-sorted order
|
||||||
|
# Components within each signature group stay in their natural order
|
||||||
|
all_components = []
|
||||||
for signature, group_components in sorted_groups:
|
for signature, group_components in sorted_groups:
|
||||||
sorted_components = sorted(group_components)
|
all_components.extend(group_components)
|
||||||
|
|
||||||
# Check if this is the ungroupable "none" signature
|
# Split into batches of batch_size
|
||||||
is_ungroupable = signature == "none"
|
for i in range(0, len(all_components), batch_size):
|
||||||
|
batch = all_components[i : i + batch_size]
|
||||||
if is_ungroupable:
|
batches.append(batch)
|
||||||
# Split ungroupable components into batches of batch_size
|
|
||||||
# These can't benefit from grouping anyway
|
|
||||||
for i in range(0, len(sorted_components), batch_size):
|
|
||||||
batch = sorted_components[i : i + batch_size]
|
|
||||||
batches.append(batch)
|
|
||||||
else:
|
|
||||||
# Keep the entire signature group together in ONE batch
|
|
||||||
# All components will be merged into a single build by test_build_components.py
|
|
||||||
# This maximizes grouping efficiency even if the batch is large
|
|
||||||
batches.append(sorted_components)
|
|
||||||
|
|
||||||
return batches
|
return batches
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user