Skip to content

refactor(docs): replace docs-spec-parallel bash with a Python planner#24

Open
danceratopz wants to merge 3 commits into
spencer-tb:ci/docs-build-speedupfrom
danceratopz:ci/docs-spec-parallel-python
Open

refactor(docs): replace docs-spec-parallel bash with a Python planner#24
danceratopz wants to merge 3 commits into
spencer-tb:ci/docs-build-speedupfrom
danceratopz:ci/docs-spec-parallel-python

Conversation

@danceratopz

@danceratopz danceratopz commented Jul 6, 2026

Copy link
Copy Markdown

🗒️ Description

Follow-up to the docs-spec-parallel recipe added in ethereum#3101. It moves the shard math and process fan-out out of the inline bash block into ethereum_spec_tools.docc_shards, invoked via python -m, leaving the recipe a one-line delegation. The integer sharding, array slicing, and subprocess handling read far more clearly in Python, and the shard planner (compute_shards) is now unit tested. A successful build is unchanged: Identical shards, identical per-shard output under docs-spec-parallel/shard-N.

The move also resolves three review points at no extra cost. It exits non-zero when fork discovery returns nothing, where the bash form exited 0 having validated nothing (a false green on a validation gate); it unit tests the coverage and one-fork-overlap invariants that were previously only eyeballed in bash; and it runs as a module rather than a console script, so nothing new lands on local users' PATH.

🔗 Related Issues or PRs

Builds on ethereum#3101.

✅ Checklist

  • All: Ran fast static checks to avoid unnecessary CI fails, see also Code Standards and Verifying Changes:
    just static
  • All: PR title have the form <type>(<area>):, where <type> and <area> come from an approrpriate C-<type>, respectively A-<area>, label. The title should match the a target squash commit message.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).

Cute Animal Picture

cat

Move the `docs-spec-parallel` shard math and process fan-out from an
inline bash block into `ethereum_spec_tools.docc_shards`, run via
`python -m`; the recipe is now a one-line delegation. The integer
sharding and subprocess handling read more clearly as Python.

Three review points the move resolves for free:
- Fail loudly on empty fork discovery instead of exiting 0 having
  validated nothing.
- Unit test `compute_shards` for full coverage and one-fork overlap.
- Invoke as a module, so no console script lands on local users' PATH.

A successful build is unchanged: same shards, same per-shard output.
Comment thread Justfile
# Build spec docs in parallel shards of consecutive forks (PR validation).
# Each shard overlaps its predecessor fork by one so every previous-fork
# reference is validated in some shard; outputs are per-shard and not merged.
# Build spec docs in parallel shards for fast PR validation

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the recipe documentation; it should be a single-line comment for clean shell output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant