Make WordPress Core

Opened 5 months ago

Closed 3 weeks ago

Last modified 3 weeks ago

#64227 closed task (blessed) (fixed)

GitHub Actions updates and improvements for 7.0

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

Description

This ticket is for various updates and improvements for Core's GitHub Actions workflows.

Previously:

Change History (33)

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


5 months ago
#1

  • Keywords has-patch added

This new post-branching task is meant for any tasks that should be run immediately after creating a new numbered branch. Currently, this only consists of GitHub Actions-related tasks.

In addition to the pre-existing replace:workflow-references-local-to-remote task, a new clean:workflows task is being added that deletes the workflow files that are only intended for trunk.

Trac ticket: Core-64227

@desrosj commented on PR #10511:


5 months ago
#2

Waiting to merge this until the discussions on #10512 are resolved to ensure this task deletes all of the correct files.

#3 @desrosj
5 months ago

In 61286:

Build/Test Tools: Introduce post-branching Grunt task.

In [59673], a Grunt subtask was introduced to convert workflow file references in GitHub Action workflows from local ones to remote ones that target the trunk branch.

The workflow-references-local-to-remote Grunt task should be run after creating a new numbered branch to take advantage of the work started in [58165].

This commit introduces a new target for the clean Grunt task: workflows. Running grunt clean:workflows will delete all workflow files that are not intended to exist outside of trunk.

Another Grunt task (post-branching) has also been added as a way to group all tasks taht should run within a newly created branch. For now, this contains clean:workflows and replace:workflow-references-local-to-remote. But more can be added in the future as more aspects of the branching process are automated.

Props johnbillion.
See #64227.

@desrosj commented on PR #10511:


5 months ago
#4

Fixed in r61286.

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


4 months ago
#5

The main aim here is to reduce the chance of unnecessary workflows running when changes are not made to src files. As an example, a change to a phpunit test file currently triggers the e2e tests, the performance tests, and the build process testing, all of which are unnecessary.

I would appreciate the proposed path changes being double checked in case I've missed something.

Ironically, changing these workflow files triggers the corresponding workflows in this PR.

#6 @desrosj
8 weeks ago

In 61663:

Build/Test Tools: Upgrade third-party GitHub Actions.

This updates the following GitHub Actions to their latest versions:

  • actions/cache from 4.3.0 to 5.0.3
  • actions/checkout from 5.0.0 to 6.0.2
  • actions/download-artifact from 6.0.0 to 7.0.0
  • actions/setup-node from 6.0.0 to 6.2.0
  • actions/upload-artifact from 5.0.0 to 6.0.0
  • codecov/codecov-action from 5.5.1 to 5.5.2
  • shivammathur/setup-php from 2.35.5 to 2.36.0

See #64227.

@desrosj commented on PR #10959:


8 weeks ago
#7

Merged in r61663.

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


7 weeks ago
#8

Trac ticket: https://core.trac.wordpress.org/ticket/64227

This addresses two issues with the e2e test workflow.

## Tricky Trixie

Last night at 01:11 UTC the latest tag for the PHP-based wordpressdevelop Docker images was changed from 8.2 to 8.3. Merging this change causes all the images to be rebuilt in the same way as we saw for Core-63876.

The e2e tests workflow doesn't specify a PHP version, so runs after that point switched from PHP 8.2 to 8.3.

Switching from PHP 8.2 to 8.3 also meant switching from Debian Bullseye using cURL 7.74.0 to Debian Trixie using cURL 8.14.1. In cURL 7.77.0 a change was made that means localhost always resolves to either 127.0.0.1 or ::1 and never consults /etc/hosts.

In the Docker config for the local dev environment, localhost points to the host machine, not to 127.0.0.1. We're not the only ones affected by this.

During installation, WordPress calls wp_install_maybe_enable_pretty_permalinks() which performs a loopback request to check that pretty permalinks work. If they do, they get enabled by default.

Then we finally get to the e2e tests. The e2e tests assume that pretty permalinks are enabled. They don't get enabled explicitly. When a test requests /this-does-not-exist it ironically receives an HTTP 200 response rather than the expected 404 because pretty permalinks are not enabled, causing URL path info to be ignored and the home page to be served.

This is why the the e2e tests that assume pretty permalinks are in place were passing on PHP 8.2 and now fail on the new PHP 8.3 image with cURL 8.

## Awkward apt-get

The e2e tests only run on Chrome.

The e2e workflow installs browsers for Playwright using npx playwright install --with-deps in accordance with to the Playwright documentation for CI. This installs dependencies for running headless Chromium which aren't otherwise included by default on the container images.

By default, Playwright installs Chromium, Firefox, and Webkit, but we only need Chromium. By excluding Firefox and Webkit, a massively reduced set of dependencies are pulled in by apt-get. The affected step goes from ~15 minutes to ~30 seconds.

This fix isn't technically needed to get the e2e tests passing again, but it does mean the workflow run doesn't bump right up against the 20 minute timeout for the workflow.

#9 @johnbillion
7 weeks ago

In 61733:

Build/Test Tools: Explicitly enable pretty permalinks on the local development environment.

The wp_install_maybe_enable_pretty_permalinks() function usually enables pretty permalinks during installation, but it relies on a loopback request that may not work on all development environments.

In temporary lieu of fixing the underlying loopback request on all the container images, this switches to explictly enabling permalinks and removes redundant permalink configuration from GitHub Actions workflow files.

See #64227

@johnbillion commented on PR #11031:


7 weeks ago
#10

I agree that perhaps switching to a different host name in the container is worth investigating, but as per the comments in https://github.com/curl/curl/issues/11104 the reason localhost is used is so there's no need to mess with /etc/hosts on the host machine. Needs some research, maybe bite the bullet and go with dnsmasq.

#12 @desrosj
5 weeks ago

In 61836:

Build/Test Tools: Increase timeout-minutes for PHPUnit workflow.

The GitHub Actions workflow responsible for running the PHPUnit test suite is frequently encountering the default timeout-minutes value of 20 since the changes in [61438]. The result is that the workflow is consistently unable to finish running and ends up being cancelled.

This bumps the default value to 40 until the overall speed of the build script can be improved.

See #64225, #64227, #64393.

#13 @desrosj
5 weeks ago

In 61871:

Build/Test Tools: Explicitly enable pretty permalinks on the local development environment.

The wp_install_maybe_enable_pretty_permalinks() function usually enables pretty permalinks during installation, but it relies on a loopback request that may not work on all development environments.

In temporary lieu of fixing the underlying loopback request on all the container images, this switches to explictly enabling permalinks and removes redundant permalink configuration from GitHub Actions workflow files.

Merges [61733] to the 6.9 branch.

Props johnbillion, jorbin.
See #64227.

#14 @desrosj
5 weeks ago

In 61872:

Build/Test Tools: Explicitly enable pretty permalinks on the local development environment.

The wp_install_maybe_enable_pretty_permalinks() function usually enables pretty permalinks during installation, but it relies on a loopback request that may not work on all development environments.

In temporary lieu of fixing the underlying loopback request on all the container images, this switches to explictly enabling permalinks and removes redundant permalink configuration from GitHub Actions workflow files.

Merges [61733] to the 6.8 branch.

Props johnbillion, jorbin.
See #64227.

#15 @desrosj
5 weeks ago

In 61875:

Build/Test Tools: Test against MySQL 9.6 & MariaDB 12.1.

These are now the latest Innovation and Rolling releases, respectively.

See #64225, #64227.

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


4 weeks ago
#16

The installation tests currently fail for older branches

Trac ticket: Core-64227.

## Use of AI Tools

@desrosj commented on PR #11250:


4 weeks ago
#17

This is ready to go. Since you can't run a workflow_dispatch event from a PR branch, I've pushed the changes to my fork and done so. All looks good.

#18 @desrosj
4 weeks ago

In 62022:

Build/Test Tools: Fix installation tests for PHP <= 7.3.

In MySQL 8.0, the default authentication plugin changed from mysql_native_password to caching_sha2_password, which is not available in PHP 7.3 and earlier. The installation testing workflow currently accounts for this, but only for PHP 7.2 & 7.3.

It also does not account for a change in MySQL 8.4 which changed the related flag for controlling this from --default-authentication-plugin to --authentication-policy.

This adjusts the flags and surrounding conditions to ensure the correct ones are passed for the right combinations.

Props johnbillion.
See #64225, #64227.

#19 @desrosj
4 weeks ago

In 62023:

Build/Test Tools: Add additional innovation release excludes.

This excludes MySQL 9.5 jobs for the installation testing workflow. Only the most recent innovation release of MySQL should be tested.

Follow up to [61875].

See #64225, #64227.

@desrosj commented on PR #11250:


4 weeks ago
#20

Merged in r62022.

#21 @desrosj
4 weeks ago

In 62033:

Build/Test Tools: Update third-party GitHub Actions.

This updates the following GitHub Actions:

  • actions/cache from 4.3.0 to 5.0.3.
  • actions/checkout from 5.0.0 to 6.0.2.
  • actions/download-artifact from 7.0.0 to 8.0.1.
  • actions/setup-node from 6.0.0 to 6.3.0.
  • actions/upload-artifact from 6.0.0 to 7.0.0.
  • ramsey/composer-install from 3.1.1 to 4.0.0.
  • shivammathur/setup-php from 2.35.3 to 2.37.0.
  • slackapi/slack-github-action from 2.1.1 to 3.0.1.

See #64227.

@desrosj commented on PR #11268:


4 weeks ago
#22

Merged in r62033.

#23 @desrosj
4 weeks ago

In 62035:

Build/Test Tools: Trim performance workflow from 6.7-6.4.

[61736], [61801], [61082], and [61083] removed the performance.yml workflow from the 6.7-6.4 branches as part of #64083.

The workflow also needs to be removed from the workflow responsible for testing old branches to avoid failures when attempting to trigger a workflow_dispatch event on a non-existent workflow file.

See #64227, #64083.

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


4 weeks ago
#24

Trac ticket: Core-64227

#25 @desrosj
4 weeks ago

In 62042:

Build/Test Tools: Test 6.9 in upgrade testing workflows.

This sets 6.9 as the most recent branch of WordPress in the upgrade testing workflows.

Props jorbin.
See #64227, #64235.

@desrosj commented on PR #10583:


4 weeks ago
#26

Merged in r62042.

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


4 weeks ago
#27

This makes several improvements to path filtering within GitHub Actions workflows to account for recent changes to the build script and a few other minor improvements.

Trac ticket: Core-64227.

## Use of AI Tools

None.

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


4 weeks ago
#28

This simplifies Composer-related caching by eliminating the need for an extra step to create a date-based value to use in cache keys.

Trac ticket: Core-64227.

## Use of AI Tools

Used Claude to create the initial draft of these changes.

#29 @desrosj
3 weeks ago

In 62053:

Build/Test Tools: Update some third-party GitHub Actions.

This updates the following GitHub Actions:

  • actions/cache from 5.0.3 to 5.0.4
  • codecov/codecov-action from 5.5.2 to 5.5.3

This resolves the final node20-related deprecation notices being triggered by GitHub Actions.

See #64227.

#30 @desrosj
3 weeks ago

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

With RC1 later today, going to close this out. This can be reopened or referenced if more changes are required for 7.0.

Created #64893 for the 7.1 release cycle.

Last edited 3 weeks ago by johnbillion (previous) (diff)

#31 @desrosj
3 weeks ago

In 62083:

Build/Test Tools: Exclude MySQL 9.5 in Local Docker test workflow.

Only the most recent innovation release should be tested.

Follow up to [61875].

See #64227.

#32 @desrosj
3 weeks ago

In 62095:

Build/Test Tools: Improve GitHub Actions path filtering rules.

This adjusts the path filtering rules for several GitHub Actions workflows to account for new and missed file paths.

Props westonruter.
See #64227.

@desrosj commented on PR #11278:


3 weeks ago
#33

Merged in r62095.

Note: See TracTickets for help on using tickets.