WordPress Build: Use stable content hashes when building scripts#74035
WordPress Build: Use stable content hashes when building scripts#74035youknowriad merged 2 commits intotrunkfrom
Conversation
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Flaky tests detected in 936e204. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/20266230281
|
Summary
Replaces
Date.now()timestamps with SHA256 content hashes in build asset versioning to enable reproducible builds.Core has a job that auto-commits on each "diff" discovered and this creates an infinite loop since each commit triggers the job which rebuilds and since we were using timestamps the build was slightly different each time.
This PR ensures wp-build generates the same "version" hashes if the content of the scripts didn't change.
Testing
Verified that:
Example
Before:
'version' => '1765880436119'(timestamp)After:
'version' => 'a5b3a20a3d22575549c7'(content hash)