Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
2cc4934
Remove the Gutenberg build script.
desrosj Feb 23, 2026
956f1e2
Remove Sync Gutenberg script
desrosj Feb 23, 2026
26f36c6
Remove the need to clone the Gutenberg repository.
desrosj Feb 23, 2026
a696ca7
Rename `checkout` related scripts to `download`.
desrosj Feb 23, 2026
b66772e
Rename `ref` to `sha`.
desrosj Feb 23, 2026
1b63326
Move the container registry reference out of code.
desrosj Feb 23, 2026
aed9824
Don't redownload without `--force`
desrosj Feb 23, 2026
f120d19
Add verification of the SHA value in hash file.
desrosj Feb 23, 2026
2e3f506
Use the most recent hash from test packages.
desrosj Feb 23, 2026
6dba1aa
Switch to using the GHCR package from `gutenberg`.
desrosj Feb 24, 2026
afdc71b
Merge branch 'trunk' into try/remove-gutenberg-git-checkout-and-build
desrosj Feb 24, 2026
de7eb2d
Update hash value.
desrosj Feb 24, 2026
6ed7de6
Merge branch 'try/remove-gutenberg-git-checkout-and-build' of https:/…
desrosj Feb 24, 2026
d21381f
Apply suggestions from code review.
desrosj Feb 24, 2026
6b06b35
Replace remaining instances of `exec( 'curl' )`.
desrosj Feb 24, 2026
af95bac
Merge branch 'trunk' into try/remove-gutenberg-git-checkout-and-build
desrosj Feb 25, 2026
a8b88fc
Merge remote-tracking branch 'upstream/trunk' into try/remove-gutenbe…
desrosj Feb 25, 2026
9f7604a
Merge remote-tracking branch 'upstream/trunk' into try/remove-gutenbe…
desrosj Feb 25, 2026
1589ee0
Correctly include block PHP files.
desrosj Feb 25, 2026
63f97bd
Merge remote-tracking branch 'upstream/trunk' into try/remove-gutenbe…
desrosj Feb 25, 2026
8ffc312
Update upstream package details.
desrosj Feb 26, 2026
1df2afb
Change package name.
desrosj Feb 26, 2026
cf25013
Update pinned hash.
desrosj Feb 27, 2026
bc11a38
Merge branch 'trunk' into try/remove-gutenberg-git-checkout-and-build
desrosj Feb 27, 2026
adad173
Update commit hash.
desrosj Feb 27, 2026
9849e91
Revert changes no longer necessary.
desrosj Feb 27, 2026
13946e5
A few more reverts.
desrosj Feb 27, 2026
59e3cb2
Built block files are different.
desrosj Feb 27, 2026
218d38d
Correctly point to the nested block directories.
desrosj Feb 27, 2026
2741dbd
Merge remote-tracking branch 'upstream/trunk' into try/remove-gutenbe…
desrosj Feb 27, 2026
15cc9bc
Correct the destination path for blocks.
desrosj Feb 27, 2026
0702c40
Bug fixes.
desrosj Feb 28, 2026
ab96de1
Merge remote-tracking branch 'upstream/trunk' into try/remove-gutenbe…
desrosj Feb 28, 2026
346e4df
Update Gutenberg hash.
desrosj Feb 28, 2026
fdd1bc3
Address some review feedback.
desrosj Feb 28, 2026
6a9acf8
Merge remote-tracking branch 'upstream/trunk' into try/remove-gutenbe…
desrosj Mar 2, 2026
dd6dfb4
Extract the verification logic out of download.
desrosj Mar 2, 2026
9a9a604
Detect local changes to `gutenberg` directory
desrosj Mar 2, 2026
cfbad94
Change hyphenated grunt tasks to use colons.
desrosj Mar 2, 2026
161f90c
Update inline comment within `base.neon`
desrosj Mar 2, 2026
8890631
Test approach to support git and zip
desrosj Mar 2, 2026
26133cd
Test building from Gutenberg in GHA.
desrosj Mar 2, 2026
f9dc688
Allow forcing of build.
desrosj Mar 2, 2026
267ac37
Only upload artifact once.
desrosj Mar 2, 2026
e52a38f
Avoid manipulating package.json directly.
desrosj Mar 2, 2026
04b93b9
Always copy after build.
desrosj Mar 2, 2026
6ca82f6
Remove `gutenberg` from `tools/gutenberg` names.
desrosj Mar 2, 2026
ad5fc07
Run PHPUnit tests once using Gutenberg repo.
desrosj Mar 2, 2026
cf071c8
Add `php `version.
desrosj Mar 2, 2026
bc1f3bc
Pass input correctly.
desrosj Mar 2, 2026
758df2c
Re-aadd old file to do a proper copy.
desrosj Mar 2, 2026
f29c40f
Delete new file to do proper copy.
desrosj Mar 2, 2026
42c0b64
Perform a proper rename.
desrosj Mar 2, 2026
4bc399f
Ensure a value is always present so matrix parses.
desrosj Mar 2, 2026
e1011e9
Improve documentation in `.env.example`.
desrosj Mar 2, 2026
3532a54
Improvements to change tracking.
desrosj Mar 2, 2026
623f43d
Merge remote-tracking branch 'upstream/trunk' into try/remove-gutenbe…
desrosj Mar 2, 2026
47e133d
Remove unused function.
desrosj Mar 2, 2026
74b18c7
Fix some JShint warnings.
desrosj Mar 2, 2026
b93a4e5
Add `gutenberg:sync` task to Grunt.
desrosj Mar 2, 2026
e5a5262
Convert to using a `.tar.gz` file.
desrosj Mar 3, 2026
0da3f5e
Addressing code review feedback.
desrosj Mar 3, 2026
22a24fa
Prevent race conditions.
desrosj Mar 3, 2026
b7a909f
Use correct multi-line inline comment format.
desrosj Mar 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@
# - '{version}': any major.minor PHP version from 5.2 onwards.
##

##
# Local Gutenberg repository mode.
#
# When set to true, the build system will clone the Gutenberg git repository at
# the commit SHA specified in package.json instead of downloading a pre-built
# zip artifact. The repository will be built from source during `npm install`
# and before each `grunt build`.
#
# This is intended for contributors who need to work across both wordpress-develop
# and the Gutenberg repository simultaneously.
#
# Note: The initial build can take several minutes.
##
GUTENBERG_LOCAL_REPO=false

# The site will be available at http://localhost:LOCAL_PORT
LOCAL_PORT=8889

Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/phpunit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ jobs:
tests-domain: [ 'example.org' ]
multisite: [ false, true ]
memcached: [ false ]
build-from-gutenberg: [ false ]

include:
# Include jobs that test with memcached.
Expand Down Expand Up @@ -118,6 +119,15 @@ jobs:
multisite: false
memcached: false
report: true
# Build directly using the Gutenberg repository.
- os: 'ubuntu-24.04'
php: '8.4'
db-type: 'mysql'
db-version: '8.4'
tests-domain: 'example.org'
multisite: false
memcached: false
build-from-gutenberg: true
with:
os: ${{ matrix.os }}
php: ${{ matrix.php }}
Expand All @@ -128,6 +138,7 @@ jobs:
phpunit-config: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }}
tests-domain: ${{ matrix.tests-domain }}
report: ${{ matrix.report || false }}
build-from-gutenberg-repo: ${{ matrix.build-from-gutenberg || false }}

#
# Creates a PHPUnit test job for each PHP/MariaDB combination.
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/reusable-phpunit-tests-v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ on:
required: false
type: boolean
default: false
build-from-gutenberg-repo:
description: 'Whether to build directly from the Gutenberg repository.'
required: false
type: 'boolean'
default: false

secrets:
CODECOV_TOKEN:
description: 'The Codecov token required for uploading reports.'
Expand Down Expand Up @@ -118,11 +124,13 @@ jobs:
# - Checks out the WordPress Test reporter repository.
# - Submit the test results to the WordPress.org host test results.
phpunit-tests:
name: ${{ ( inputs.phpunit-test-groups || inputs.coverage-report ) && format( 'PHP {0} with ', inputs.php ) || '' }} ${{ 'mariadb' == inputs.db-type && 'MariaDB' || 'MySQL' }} ${{ inputs.db-version }}${{ inputs.multisite && ' multisite' || '' }}${{ inputs.db-innovation && ' (innovation release)' || '' }}${{ inputs.memcached && ' with memcached' || '' }}${{ inputs.report && ' (test reporting enabled)' || '' }} ${{ 'example.org' != inputs.tests-domain && inputs.tests-domain || '' }}
name: ${{ ( inputs.phpunit-test-groups || inputs.coverage-report ) && format( 'PHP {0} with ', inputs.php ) || '' }} ${{ 'mariadb' == inputs.db-type && 'MariaDB' || 'MySQL' }} ${{ inputs.db-version }}${{ inputs.multisite && ' multisite' || '' }}${{ inputs.db-innovation && ' (innovation release)' || '' }}${{ inputs.memcached && ' with memcached' || '' }}${{ inputs.report && ' (test reporting enabled)' || '' }} ${{ 'example.org' != inputs.tests-domain && inputs.tests-domain || '' }}${{ inputs.build-from-gutenberg-repo && ' built from Gutenberg repo' || '' }}
runs-on: ${{ inputs.os }}
timeout-minutes: ${{ inputs.coverage-report && 120 || inputs.php == '8.4' && 30 || 20 }}
permissions:
contents: read
env:
GUTENBERG_LOCAL_REPO: ${{ inputs.build-from-gutenberg-repo }}

steps:
- name: Configure environment variables
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/reusable-test-core-build-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ on:
required: false
type: 'boolean'
default: false
build-from-gutenberg-repo:
description: 'Whether to build directly from the Gutenberg repository.'
required: false
type: 'boolean'
default: false

env:
PUPPETEER_SKIP_DOWNLOAD: ${{ true }}
Expand All @@ -62,11 +67,13 @@ jobs:
# - Saves the pull request number to a text file.
# - Uploads the pull request number as an artifact.
build-process-tests:
name: ${{ contains( inputs.os, 'macos-' ) && 'MacOS' || contains( inputs.os, 'windows-' ) && 'Windows' || 'Linux' }}
name: ${{ contains( inputs.os, 'macos-' ) && 'MacOS' || contains( inputs.os, 'windows-' ) && 'Windows' || 'Linux' }}${{ inputs.build-from-gutenberg-repo && ' built from Gutenberg repo' || '' }}
permissions:
contents: read
runs-on: ${{ inputs.os }}
timeout-minutes: 20
env:
GUTENBERG_LOCAL_REPO: ${{ inputs.build-from-gutenberg-repo }}

steps:
- name: Checkout repository
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/test-build-processes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,23 @@ jobs:
os: [ 'ubuntu-24.04' ]
directory: [ 'src', 'build' ]
test-certificates: [ true ]
build-from-gutenberg: [ true, false ]

include:
# Only prepare artifacts for Playground once.
- os: 'ubuntu-24.04'
directory: 'build'
save-build: true
prepare-playground: ${{ github.event_name == 'pull_request' && true || '' }}
build-from-gutenberg: false

with:
os: ${{ matrix.os }}
directory: ${{ matrix.directory }}
test-certificates: ${{ matrix.test-certificates && true || false }}
save-build: ${{ matrix.save-build && matrix.save-build || false }}
prepare-playground: ${{ matrix.prepare-playground && matrix.prepare-playground || false }}
build-from-gutenberg-repo: ${{ matrix.build-from-gutenberg && matrix.build-from-gutenberg || false }}

# Tests the WordPress Core build process on additional operating systems.
#
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ wp-tests-config.php
/src/wp-includes/build
/src/wp-includes/theme.json
/packagehash.txt
/.gutenberg-hash
/.gutenberg-dir-hash
/.gutenberg-repo-hash
/artifacts
/setup.log
/coverage
Expand Down
63 changes: 49 additions & 14 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ module.exports = function(grunt) {
webpackFiles = [
'wp-includes/assets/*',
'wp-includes/css/dist',
'wp-includes/blocks/**/*.css',
'!wp-includes/assets/script-loader-packages.min.php',
'!wp-includes/assets/script-modules-packages.min.php',
],
Expand Down Expand Up @@ -1468,45 +1467,81 @@ module.exports = function(grunt) {
} );

// Gutenberg integration tasks.
grunt.registerTask( 'gutenberg-checkout', 'Checks out the Gutenberg repository.', function() {
grunt.registerTask( 'gutenberg:verify', 'Verifies the installed Gutenberg version matches the expected SHA.', function() {
const done = this.async();
grunt.util.spawn( {
cmd: 'node',
args: [ 'tools/gutenberg/checkout-gutenberg.js' ],
args: [ 'tools/gutenberg/utils.js' ],
opts: { stdio: 'inherit' }
}, function( error ) {
done( ! error );
} );
} );

grunt.registerTask( 'gutenberg-build', 'Builds the Gutenberg repository.', function() {
grunt.registerTask( 'gutenberg:download', 'Downloads the built Gutenberg artifact.', function() {
const done = this.async();
const args = [ 'tools/gutenberg/download.js' ];
if ( grunt.option( 'force' ) ) {
args.push( '--force' );
}
grunt.util.spawn( {
cmd: 'node',
args: [ 'tools/gutenberg/build-gutenberg.js' ],
args,
opts: { stdio: 'inherit' }
}, function( error ) {
done( ! error );
} );
} );

grunt.registerTask( 'gutenberg-copy', 'Copies Gutenberg build output to WordPress Core.', function() {
grunt.registerTask( 'gutenberg:checkout', 'Clones the Gutenberg git repository at the SHA specified in package.json (local repository mode only).', function() {
const done = this.async();
const args = [ 'tools/gutenberg/checkout.js' ];
if ( grunt.option( 'force' ) ) {
args.push( '--force' );
}
grunt.util.spawn( {
cmd: 'node',
args,
opts: { stdio: 'inherit' }
}, function( error ) {
done( ! error );
} );
} );

grunt.registerTask( 'gutenberg:build:run', 'Builds Gutenberg from source for WordPress Core (local repository mode only).', function() {
const done = this.async();
const args = [ 'tools/gutenberg/build.js' ];
if ( grunt.option( 'force' ) ) {
args.push( '--force' );
}
grunt.util.spawn( {
cmd: 'node',
args,
opts: { stdio: 'inherit' }
}, function( error ) {
done( ! error );
} );
} );

grunt.registerTask( 'gutenberg:build', 'Builds Gutenberg from source and copies the result to WordPress Core.', [ 'gutenberg:build:run', 'gutenberg:copy' ] );

grunt.registerTask( 'gutenberg:sync', 'Downloads or checks out Gutenberg at the expected SHA, builds if needed, and copies to WordPress Core.', function() {
const done = this.async();
const buildDir = grunt.option( 'dev' ) ? 'src' : 'build';
grunt.util.spawn( {
cmd: 'node',
args: [ 'tools/gutenberg/copy-gutenberg-build.js', `--build-dir=${ buildDir }` ],
args: [ 'tools/gutenberg/sync.js' ],
opts: { stdio: 'inherit' }
}, function( error ) {
done( ! error );
} );
} );

grunt.registerTask( 'gutenberg-sync', 'Syncs Gutenberg checkout and build if ref has changed.', function() {
grunt.registerTask( 'gutenberg:copy', 'Copies Gutenberg build output to WordPress Core.', function() {
const done = this.async();
const buildDir = grunt.option( 'dev' ) ? 'src' : 'build';
grunt.util.spawn( {
cmd: 'node',
args: [ 'tools/gutenberg/sync-gutenberg.js' ],
args: [ 'tools/gutenberg/copy.js', `--build-dir=${ buildDir }` ],
opts: { stdio: 'inherit' }
}, function( error ) {
done( ! error );
Expand Down Expand Up @@ -1951,23 +1986,23 @@ module.exports = function(grunt) {
grunt.registerTask( 'build', function() {
if ( grunt.option( 'dev' ) ) {
grunt.task.run( [
'gutenberg:verify',
'build:js',
'build:css',
'build:codemirror',
'gutenberg-sync',
'gutenberg-copy',
'gutenberg:build',
'copy-vendor-scripts',
'build:certificates'
] );
} else {
grunt.task.run( [
'gutenberg:verify',
'build:certificates',
'build:files',
'build:js',
'build:css',
'build:codemirror',
'gutenberg-sync',
'gutenberg-copy',
'gutenberg:build',
'copy-vendor-scripts',
'replace:source-maps',
'verify:build'
Expand Down
16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"url": "https://develop.svn.wordpress.org/trunk"
},
"gutenberg": {
"ref": "022d8dd3d461f91b15c1f0410649d3ebb027207f"
"sha": "1ed7da329cc9ffb27cbe5d373ea15db309a135b7",
"ghcrRepo": "WordPress/gutenberg/gutenberg-wp-develop-build"
},
"engines": {
"node": ">=20.10.0",
Expand Down Expand Up @@ -106,7 +107,7 @@
"wicg-inert": "3.1.3"
},
"scripts": {
"postinstall": "npm run gutenberg:sync && npm run gutenberg:copy -- --dev",
"postinstall": "npm run gutenberg:sync",
"build": "grunt build",
"build:dev": "grunt build --dev",
"dev": "grunt watch --dev",
Expand All @@ -131,12 +132,13 @@
"test:e2e": "wp-scripts test-playwright --config tests/e2e/playwright.config.js",
"test:visual": "wp-scripts test-playwright --config tests/visual-regression/playwright.config.js",
"typecheck:php": "node ./tools/local-env/scripts/docker.js run --rm php composer phpstan",
"gutenberg:checkout": "node tools/gutenberg/checkout-gutenberg.js",
"gutenberg:build": "node tools/gutenberg/build-gutenberg.js",
"gutenberg:copy": "node tools/gutenberg/copy-gutenberg-build.js",
"gutenberg:sync": "node tools/gutenberg/sync-gutenberg.js",
"gutenberg:build": "node tools/gutenberg/build.js",
"gutenberg:checkout": "node tools/gutenberg/checkout.js",
"gutenberg:copy": "node tools/gutenberg/copy.js",
"gutenberg:download": "node tools/gutenberg/download.js",
"gutenberg:sync": "node tools/gutenberg/sync.js",
"vendor:copy": "node tools/vendors/copy-vendors.js",
"sync-gutenberg-packages": "grunt sync-gutenberg-packages",
"postsync-gutenberg-packages": "grunt wp-packages:sync-stable-blocks && grunt build --dev && grunt build"
}
}
}
2 changes: 1 addition & 1 deletion tests/phpstan/base.neon
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ parameters:
- ../../src/wp-includes/deprecated.php
- ../../src/wp-includes/ms-deprecated.php
- ../../src/wp-includes/pluggable-deprecated.php
# These files are sourced by wordpress/gutenberg in `tools/release/sync-stable-blocks.js`.
# These files are autogenerated by tools/gutenberg/copy.js.
- ../../src/wp-includes/blocks
# Third-party libraries.
- ../../src/wp-admin/includes/class-ftp-pure.php
Expand Down
Loading
Loading