Build/Test Tools: Retry and verify the Gutenberg download on the 7.0 branch - #13374
Build/Test Tools: Retry and verify the Gutenberg download on the 7.0 branch#13374lancewillett wants to merge 1 commit into
Conversation
…branch. [62873] merged [62859] and [62862] to this branch, but carried only the workflow half: it touched a single file, .github/workflows/phpunit-tests.yml. The downloader rewrite from [62859] never landed here. So tools/gutenberg/download.js still streams the archive from the GitHub Container Registry as fetch body, gunzip, then tar stdin in one pipeline, with no temporary file, no size or SHA-256 check, no timeout, and no retries. An early stream close raises Node's ERR_STREAM_PREMATURE_CLOSE and the build fails with "Download/extraction failed: Premature close" before a test runs. tools/gutenberg/utils.js has the same gap in its token and manifest requests. The PHPUnit workflow on this branch is insulated, because [62873] wired it to consume the shared prepare-gutenberg run artifact and it never calls the downloader. Anything else that checks out this branch and runs `npm run build:dev` still hits the raw downloader, once per job. Merge the downloader half of [62859]: stage the blob to a temporary file, verify the manifest size and SHA-256, extract only after verification, and retry interrupted transfers up to three times. Metadata requests get the same bounded retries and a timeout. This also makes the branch honour GUTENBERG_EXPECTED_SHA, which reusable-phpunit-tests-v3.yml already passes it. tools/gutenberg/copy.js also differs between the branches, but that drift is from unrelated work and is left alone. Fixes #66028.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Trac ticket: https://core.trac.wordpress.org/ticket/66028
Summary
Merge the downloader half of r62859 to the
7.0branch:tools/gutenberg/download.jsandtools/gutenberg/utils.jsonly. Both files are byte-identical totrunkafter this change.Why
r62873 merged r62859 and r62862 to
7.0, but carried only the workflow half. It touched a single file,.github/workflows/phpunit-tests.yml(+30/-1). The downloader rewrite never reached the branch.So on
7.0the downloader still streams the 31 MiB archive from the GitHub Container Registry asfetch body,gunzip, thentarstdin in one pipeline, with no temporary file, no size or SHA-256 check, no timeout, and no retries. An early stream close raises Node'sERR_STREAM_PREMATURE_CLOSEand the build fails before a test runs:tools/gutenberg/utils.jshas the same gap in its token and manifest requests.Core's own PHPUnit workflow on
7.0is insulated, because r62873 wired it to consume the sharedprepare-gutenbergrun artifact and it never calls the downloader. Anything else that checks out this branch and runsnpm run build:devstill hits the raw downloader, once per job.7.0is the only affected branch. 6.9 and earlier have notools/gutenbergdirectory and never download the archive; 7.1 and trunk already carry r62859.Scope
Exactly two files.
tools/gutenberg/copy.jsalso differs between the branches, but that drift is from unrelated work and is deliberately left alone. No workflow,package.json, orGruntfile.jschange is needed.Compatibility
download.json trunk imports only Node built-ins and./utils.module.exportsblocks in the old and newutils.jsare identical.tools/gutenberg/utils.json this branch areGruntfile.js, which spawns the file, anddownload.js, which is replaced alongside it. Neither uses a dropped or renamed export.GUTENBERG_EXPECTED_SHAis additive, and closes a latent gap:reusable-phpunit-tests-v3.yml@trunkalready passes it, and this branch'sutils.jscurrently ignores it..jshintrcis identical between the branches,jshintdoes not covertools/, and this branch has noeslint.config.js.Testing
node tools/gutenberg/download.json this branch, against its pinned Gutenberg SHA:Run twice; the extracted
.gutenberg-hashmatches the branch's pinned SHA both times. Note the attempt counter,Content-Length, manifest size, and SHA-256 verification lines, none of which the current downloader emits.Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code, Codex
Model(s): Claude Opus, GPT-5
Used for: Diagnosing the failure from CI logs and branch history, checking export and workflow compatibility, and running the live download verification. The change itself is the two files taken unmodified from trunk. The final diff was reviewed by me.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request.