Make WordPress Core

Opened 10 months ago

Closed 5 months ago

#59632 closed task (blessed) (fixed)

Test building Gutenberg plugin in GitHub Actions

Reported by: desrosj's profile desrosj Owned by: desrosj's profile desrosj
Milestone: 6.5 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch
Focuses: Cc:

Description

Every so often a situation comes up where a dependency update in Core causes a problem in the Gutenberg plugin build scripts, or vice versa.

For examples, see #58671, or more recently, an instance where a version of Puppeteer in Core is causing problems within the Gutenberg build process.

Having a wordpress-develop checkout that contains a gutenberg checkout within the src/wp-content/plugins directory is a very common contributor setup. Having a workflow that verifies both build processes continue to work could help catch these situations earlier.

Change History (11)

#1 @swissspidy
10 months ago

https://github.com/WordPress/gutenberg/pull/52993#issuecomment-1764032718 looks like a TypeScript configuration issue. Specifying typeRoots in tsconfig.json should prevent TypeScript from looking in all the parent folders, but somehow it's still doing it.

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


10 months ago
#2

  • Keywords has-patch added

#3 @desrosj
10 months ago

I've started exploring adding some logic to test the Gutenberg plugin's build process in the context of a wordpress-develop checkout.

For testing purposes, I reintroduced the failure caused by grunt-contrib-qunit to confirm the issue is caught in these tests.

Here's a run after re-applying the fix.

However, I was unable to reproduce the issue described in #58671. It's possible that issue has been resolved since the ticket was created, though.

The attached PR also renames the Test npm workflow to be more generic. While we are testing that npm dependencies install correctly, what is actually being tested is that the build process is successful. If this is the road we choose to go down, the changes will either need to be backported, or the Testing old branches workflow will need to be updated to account for the workflow being called two different things in different branches once the 6.4 branch is created.

#4 @desrosj
9 months ago

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

In 56976:

Build/Test Tools: Test the Gutenberg plugin build process.

A very common contributor setup is having a copy of the gutenberg development repository within a checkout of the wordpress-develop repository. On occasion, there are some strange incompatibilities that come up when using this setup. A few examples can be seen in #58671 and #59634.

This changeset helps ensure that these edge cases are not introduced by testing the Gutenberg plugin’s build process within WordPress configured to run from both the src and build directories.

This also renames the “Test npm” workflow to a more general “Test Build Processes”, which more accurately describes what is actually being tested within it and allows these new test jobs to be grouped in.

And finally, the logic within the workflow has been split out into two callable workflows. This helps avoid code duplication within the workflow, and allows for better grouping on the workflow run screen.

Props swissspidy, aferica, SergeyBiryukov, antonvlasenko, desrosj.
Fixes #59632. See #58671, #59634.

#5 @desrosj
9 months ago

  • Keywords fixed-major added
  • Milestone changed from Future Release to 6.5
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening to address a few follow ups from this.

  • At a minimum, the test-old-branches.yml workflow will need to be updated to account for this name change.
  • This may be worth backporting to the 6.4 branch.
  • We could also consider backporting this further to all branches currently supported by the Gutenberg plugin (currently 6.2 and up).
  • If it is backported, there needs to be a way to pin a branch so that the proper version of Gutenberg is tested in the future. For example, after 4 more releases, if a commit is made to the 6.4 branch, the workflow should not test Gutenberg trunk, but rather the wp/6.4 branch.
  • If it's not backported, then the Gutenberg tests should not run on branches older than the current one.

#6 @desrosj
9 months ago

In 56977:

Build/Test Tools: Use the correct path to build process test workflows.

Follow up to [56976].

See #59632.

#7 @swissspidy
6 months ago

  • Type changed from enhancement to task (blessed)

#8 @swissspidy
5 months ago

@desrosj Is this one on your radar to finish up in 6.5?

#9 @desrosj
5 months ago

It is.

I'm thinking it's not worth backporting. But we'll need to update the test-old-branches.yml workflow after the 6.5 branch is created to include this one.

The other questions will need to be answered over time, I think.

#10 @desrosj
5 months ago

  • Keywords fixed-major removed

#11 @desrosj
5 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 57783:

Build/Test Tools: Add build process test workflow to old branches testing.

Now that 6.5 has been branched, the test-build-processes.yml workflow can be added to the list of workflows to run for old branches.

Fixes #59632.

Note: See TracTickets for help on using tickets.