Make WordPress Core

Opened 7 weeks ago

Closed 4 weeks ago

Last modified 4 weeks ago

#64716 closed defect (bug) (fixed)

`grunt clean` does not clean block editor-related files copied in new build process

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

Description

Follow up to #64393.

I noticed today while working on a PR that the unit tests were failing on GitHub despite passing locally.

This seems to be due to the fact that grunt clean is unaware of the new file locations after [61438]. The files are not being cleaned before a fresh run of the build script, so the files from a previous build remained.

Change History (5)

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


7 weeks ago
#1

  • Keywords has-patch added

This updates the grunt clean task to clean up properly after the changes in r61438.

Trac ticket: Core-64716.

## Use of AI Tools

Claude Code was used to confirm the changes were accurate.

@desrosj commented on PR #11036:


4 weeks ago
#2

@adamsilverstein I haven't gotten to test after refreshing just yet. But I added you as a reviewer because your work on #11281 will be a good way to test this.

To test, run npm run build:dev in your PR's branch, then run npm run grunt clean -- --dev with this one cloned. Repeat for npm run build and npm run grunt clean.

@desrosj commented on PR #11036:


4 weeks ago
#3

This is testing well for me. Here's how I tested:

  • I cloned https://github.com/WordPress/wordpress.
  • Copied the contents of that clone into build in my wordpress-develop fork.
  • Ran diff -rq --exclude=".git" /path/to/fork/wordpress-develop/build /path/to/build/repo/WordPress/wordpress/
  • Observer no differences.
  • Run npm run grunt clean && npm run build
  • Rerun the diff command.

You should see something like this:

Only in /path/to/build/server/checkoutWordPress/wordpress/wp-includes/build/pages: connectors
Only in /path/to/build/server/checkoutWordPress/wordpress/wp-includes/build/pages: site-editor
Only in /path/to/build/server/checkoutWordPress/wordpress/wp-includes/build/pages: site-editor-v2
Only in /path/to/build/server/checkoutWordPress/wordpress/wp-includes/build/routes/font-list: package.json
Only in /path/to/build/server/checkoutWordPress/wordpress/wp-includes/build/routes/fonts-home: package.json
Only in /path/to/build/server/checkoutWordPress/wordpress/wp-includes/build/routes/home: package.json
Only in /path/to/build/server/checkoutWordPress/wordpress/wp-includes/build/routes: index.php
Only in /path/to/build/server/checkoutWordPress/wordpress/wp-includes/build/routes/navigation: package.json
Only in /path/to/build/server/checkoutWordPress/wordpress/wp-includes/build/routes/navigation-edit: package.json
Only in /path/to/build/server/checkoutWordPress/wordpress/wp-includes/build/routes/navigation-list: package.json
Only in /path/to/build/server/checkoutWordPress/wordpress/wp-includes/build/routes/pattern: package.json
Only in /path/to/build/server/checkoutWordPress/wordpress/wp-includes/build/routes/pattern-list: package.json
Only in /path/to/build/server/checkoutWordPress/wordpress/wp-includes/build/routes/post: package.json
Only in /path/to/build/server/checkoutWordPress/wordpress/wp-includes/build/routes/post-edit: package.json
Only in /path/to/build/server/checkoutWordPress/wordpress/wp-includes/build/routes/post-list: package.json
Only in /path/to/build/server/checkoutWordPress/wordpress/wp-includes/build/routes/post-new: package.json
Only in /path/to/build/server/checkoutWordPress/wordpress/wp-includes/build/routes/styles: package.json
Only in /path/to/build/server/checkoutWordPress/wordpress/wp-includes/build/routes/template: package.json
Only in /path/to/build/server/checkoutWordPress/wordpress/wp-includes/build/routes/template-list: package.json
Only in /path/to/build/server/checkoutWordPress/wordpress/wp-includes/build/routes/template-part: package.json
Only in /path/to/build/server/checkoutWordPress/wordpress/wp-includes/build/routes/template-part-list: package.json
Only in /path/to/build/server/checkoutWordPress/wordpress/wp-includes/icons/library: resize-corner-n-e.svg

#4 @desrosj
4 weeks ago

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

In 62051:

Build/Test Tools: Update the grunt clean task after [61438].

The list of files cleaned through grunt clean was not updated as part of [61438]. This results in files persisting within src/wp-includes even after= they are removed.

Props jorbin.
Fixes #64716. See #64393.

#5 @desrosj
4 weeks ago

In 62052:

Build/Test Tools: Copy block editor files to src after download.

The block editor-related files were previously present in the src directory and subject to version control. However, [61439] removed them from version control and has broken some workflows and testing setups that run the PHPUnit tests from src.

There is work ongoing to restore those files to version control with their respective change history. But until that happens, this updates the download.js script and gutenberg:download Grunt task to run build:gutenberg —dev every time the build asset is downloaded to ensure the files are present in src.

Props mywp459, amykamala, jorbin.
Fixes #64716. See #64393.

Note: See TracTickets for help on using tickets.