Skip to content

Commit fcf3cee

Browse files
committed
fix(ci): emit single pre-alloc entry for --fork= release features
`pre_alloc_matrix` returned an empty list whenever `fill-params` contained `--fork=X` instead of `--until=X`, so the `generate-pre-alloc` job was skipped for the `benchmark` feature. The fill jobs then failed with `Pre-allocation hash not found` because no pre-alloc artifacts were available to download. Emit a single matrix entry with empty `from_fork`/`until_fork` for `--fork=` features; the workflow step now conditionally adds `--from`/`--until` only when the range is populated, since `fill` rejects those flags alongside `--fork`. One pre-alloc runner generates groups for the feature's fork, and every fill runner downloads that single `pre-alloc-groups__<fork>` artifact. Also gate `pre_alloc_matrix` on `splits >= 2` to match the phase-1 contract: unsplit features handle pre-allocs inline in the fill job.
1 parent 5b62f65 commit fcf3cee

3 files changed

Lines changed: 46 additions & 9 deletions

File tree

.github/scripts/generate_build_matrix.py

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ def parse_until_fork(fill_params: str) -> str | None:
7676
return m.group(1) if m else None
7777

7878

79+
def parse_fork_arg(fill_params: str) -> str | None:
80+
"""Extract the ``--fork`` value from fill-params."""
81+
m = re.search(r"--fork[=\s]+(\S+)", fill_params)
82+
return m.group(1) if m else None
83+
84+
7985
def applicable_ranges(fork_ranges: list[dict], until_fork: str) -> list[dict]:
8086
"""
8187
Return fork ranges whose ``from`` is at or before *until_fork*.
@@ -131,12 +137,31 @@ def pre_alloc_matrix(
131137
fork_ranges: list[dict],
132138
) -> list[dict]:
133139
"""
134-
Build the fork-range matrix for pre-alloc generation (phase 1).
140+
Build the matrix for pre-alloc generation (phase 1).
135141
136-
Pre-alloc groups must be generated with complete per-fork coverage,
137-
so they are split by fork range rather than by pytest-split groups.
138-
Returns an empty list for unsplit features.
142+
``--until=`` features split pre-alloc generation across fork ranges
143+
so each range runs in parallel. ``--fork=`` features emit a single
144+
entry with empty ``from_fork``/``until_fork``; the feature's own
145+
``--fork=`` already scopes the run, and passing ``--from``/
146+
``--until`` alongside ``--fork`` is rejected by ``fill``.
147+
148+
Returns an empty list for features without splits or without a
149+
usable fork boundary.
139150
"""
151+
if feature.get("splits", 0) < 2:
152+
return []
153+
154+
fork_arg = parse_fork_arg(feature["fill-params"])
155+
if fork_arg:
156+
return [
157+
{
158+
"feature": name,
159+
"label": fork_arg.lower(),
160+
"from_fork": "",
161+
"until_fork": "",
162+
}
163+
]
164+
140165
until = parse_until_fork(feature["fill-params"])
141166
if not until or not fork_ranges:
142167
return []

.github/scripts/tests/test_release_scripts.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,16 @@ def test_split_feature_with_fork_param(self):
9494
assert out["combine_labels"] == " ".join(
9595
str(i) for i in range(1, splits + 1)
9696
)
97-
# --fork features should not generate a pre-alloc matrix.
98-
assert json.loads(out["pre_alloc_matrix"]) == []
97+
# --fork features emit a single pre-alloc entry with empty fork
98+
# range so the workflow step omits --from/--until (which would
99+
# otherwise conflict with --fork in fill-params).
100+
pa_matrix = json.loads(out["pre_alloc_matrix"])
101+
assert len(pa_matrix) == 1
102+
assert pa_matrix[0]["feature"] == "benchmark"
103+
assert pa_matrix[0]["label"] == "osaka"
104+
assert pa_matrix[0]["from_fork"] == ""
105+
assert pa_matrix[0]["until_fork"] == ""
106+
assert out["pre_alloc_labels"] == "osaka"
99107

100108
def test_feature_only_can_be_requested_explicitly(self):
101109
"""Verify feature_only entries work when named directly."""

.github/workflows/release_fixture_feature.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,19 @@ jobs:
9292
with:
9393
type: ${{ steps.properties.outputs.evm-type }}
9494

95-
- name: Generate pre-alloc groups (phase 1, fork range)
95+
- name: Generate pre-alloc groups (phase 1)
9696
shell: bash
9797
run: |
9898
FEATURE_NAME="${{ needs.setup.outputs.feature_name }}"
99+
RANGE_ARGS=""
100+
if [ -n "${{ matrix.from_fork }}" ]; then
101+
RANGE_ARGS="--from=${{ matrix.from_fork }} --until=${{ matrix.until_fork }}"
102+
fi
99103
EXIT_CODE=0
100104
if [ "${{ steps.evm-builder.outputs.impl }}" = "eels" ]; then
101-
uv run fill -n ${{ steps.evm-builder.outputs.x-dist }} ${{ steps.properties.outputs.fill-params }} --generate-pre-alloc-groups --from=${{ matrix.from_fork }} --until=${{ matrix.until_fork }} --output=fixtures_${FEATURE_NAME} --build-name ${FEATURE_NAME} --no-html -qq || EXIT_CODE=$?
105+
uv run fill -n ${{ steps.evm-builder.outputs.x-dist }} ${{ steps.properties.outputs.fill-params }} --generate-pre-alloc-groups $RANGE_ARGS --output=fixtures_${FEATURE_NAME} --build-name ${FEATURE_NAME} --no-html -qq || EXIT_CODE=$?
102106
else
103-
uv run fill -n ${{ steps.evm-builder.outputs.x-dist }} --evm-bin=${{ steps.evm-builder.outputs.evm-bin }} ${{ steps.properties.outputs.fill-params }} --generate-pre-alloc-groups --from=${{ matrix.from_fork }} --until=${{ matrix.until_fork }} --output=fixtures_${FEATURE_NAME} --build-name ${FEATURE_NAME} --no-html -qq || EXIT_CODE=$?
107+
uv run fill -n ${{ steps.evm-builder.outputs.x-dist }} --evm-bin=${{ steps.evm-builder.outputs.evm-bin }} ${{ steps.properties.outputs.fill-params }} --generate-pre-alloc-groups $RANGE_ARGS --output=fixtures_${FEATURE_NAME} --build-name ${FEATURE_NAME} --no-html -qq || EXIT_CODE=$?
104108
fi
105109
if [ "$EXIT_CODE" -ne 0 ] && [ "$EXIT_CODE" -ne 5 ]; then
106110
exit "$EXIT_CODE"

0 commit comments

Comments
 (0)