Make WordPress Core

Opened 4 weeks ago

Last modified 12 days ago

#65224 reopened enhancement

Add support for testing unmerged changes from Gutenberg

Reported by: desrosj's profile desrosj Owned by: desrosj's profile desrosj
Milestone: 7.1 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch fixed-major commit dev-feedback
Focuses: Cc:

Description

It's currently impossible to test unmerged changes from the Gutenberg repository because changes are published to the GitHub Container Registry only when trunk, wp/*, or release/* branches are updated.

Publishing built assets for pull requests and introducing new mutable tags is being explored upstream.

This ticket is to track the necessary changes for wordpress-develop to support these.

Change History (5)

This ticket was mentioned in PR #11809 on WordPress/wordpress-develop by @desrosj.


4 weeks ago
#1

Allows the value of gutenberg.sha in package.json to be either a Git SHA (current behavior) or a mutable tag (trunk, release-X.Y, wp-X.Y, pr-<N>) published by the Gutenberg build-plugin-zip workflow.

While the committed value should always remain a SHA, the mutable-tag form is intended for use by contributors when needing to test an unmerged pull request from https://github.com/wordpress/gutenberg, or looking to always track the latest changes from a given stream.

Note: the changes in src can be ignored, they were committed by the workflow that ensures all built file changes are included because the upstream PR was created from trunk and this repo is currently pinned to the wp/7.0 branch.

Trac ticket: Core-65224.

## Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Opus 4.7
Used for: Initial analysis and PR.

@westonruter commented on PR #11809:


4 weeks ago
#2

I'm going to push up a commit that adds the JS files to what is checked by TypeScript.

#3 @manhar
4 weeks ago

Tested on: Ubuntu 24.04, Node v20.19.5, npm 10.8.2

  • Set gutenberg.sha to pr-78211 and ran npm run gutenberg:download
  • Mutable tag resolved correctly, downloaded and built without any errors. blocks generated, all files copied successfully.

#4 @desrosj
12 days ago

  • Owner set to desrosj
  • Resolution set to fixed
  • Status changed from new to closed

In 62422:

Build/Test Tools: Support testing unmerged changes from Gutenberg.

The gutenberg.sha property in the package.json file expects a full-length SHA value to be specified in order to download the built assets from the Gutenberg repository and include the files through the build script.

After https://github.com/WordPress/gutenberg/pull/78211, assets are now published for pull_request events in addition to push so long as the HEAD branch of the pull request exists in the repository and not in a fork. This makes the built assets for pull requests available for testing within wordpress-develop before they are merged through a pr-### tag on the GHCR package.

To test a given pull request, just set the gutenberg.sha value to the corresponding pr-### tag. In addition to pull request-specific tags, each wp/X.Y, release/X.Y, and trunk now have a tag that can be used to test the latest changes. Each time build or build:dev is called the script will attempt to confirm the latest version of the assets are present locally, pulling down the latest changes when an update is available.

All of the tags described in this changeset are mutable, so they should never be committed. Only immutable SHA values should be used for gutenberg.sha in commits to this repository.

This commit also adds the related JavaScript files to the TypeScript configuration file.

Props westonruter, jorbin, manhar.
Fixes #65224.

#5 @desrosj
12 days ago

  • Keywords fixed-major commit dev-feedback added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for backport consideration and any necessary follow up adjustments required.

Note: See TracTickets for help on using tickets.