Make WordPress Core

Opened 5 weeks ago

Last modified 9 days ago

#61213 reopened enhancement

Convert GitHub Action workflows into reusable ones

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

Description

In trunk, Core's GitHub Action workflows are a mix of standard and reusable workflows. While each have pros and cons, the advantages of reusable workflows outweigh the shortcomings, primarily because it makes maintaining the workflows within the 25 (and growing) old branches that can still receive security updates significantly easier.

The PHPUnit and build process testing workflows have been callable for a few release cycles now and there have been no major problems. Here is a quick breakdown of the pros and cons:

Benefits

  • All branches receiving security updates immediately receive the benefits of performance improvements to the callable workflow file used from trunk.
  • All branches receive the 3rd-party action updates updated when updated in trunk.
  • Any changes required at the platform level only need to be applied in trunk (changes to the versions of Node.js found on images or removal of save-state/set-output as examples).

Disadvantages

  • Because a repository and branch is specified when using the workflow, the version of the file found in trunk is always used, even within PRs. The best way around this is to change the uses: path to the PR's fork repository/branch.
  • Truly using one reusable workflow for all branches would result in a large number of inputs and steps that are skipped. There will likely need to be 2 versions of a few workflows to account for major updates to how a workflow works (see #45863).

This ticket proposes the following:

  • Extract the actual testing/building logic in all workflows to reusable ones that accept inputs to configure the environment.
  • Establish a naming practice and standardize all reusable workflows so it's clear which files are reusable and which ones contain the strategy matrix/permission configuration.
  • Update old branches to use the workflow file in trunk.

Attachments (1)

61213.diff (64.8 KB) - added by desrosj 5 weeks ago.

Download all attachments as: .zip

Change History (35)

@desrosj
5 weeks ago

#2 @desrosj
5 weeks ago

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

In 58165:

Build/Test Tools: Convert GitHub action workflows into reusable ones.

With a few exceptions, GitHub Actions workflows run using the version of the workflow file present in the commit SHA or Git ref for the triggering event. This is useful for maintaining different versions of a workflow file.

In the case of WordPress where there are currently 25+ branches that could potentially receive a security fix, it creates a huge maintenance burden. When 3rd party actions are updated or features are deprecated on GitHub Actions, the required changes need to be backported to all of those branches. This takes considerable time and effort.

This change converts Core’s workflow files to reusable ones. This allows the same workflow to be used for all (or most) branches, allowing the described maintenance updates to be made once in trunk.

To keep track of which files are reusable vs. those that are responsible for holding the strategy matrix for that branch, reusable workflows are now prefixed with reusable-.

Props johnbillion, swissspidy, jorbin, desrosj.
Fixes #61213.

#4 @desrosj
5 weeks ago

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

Reopening to handle the necessary backporting.

#5 @desrosj
5 weeks ago

In 58166:

Build/Test Tools: Use new reusable workflows in the 6.5 branch.

This updates the 6.5 branch to utilize the new reusable workflows in trunk introduced in [58165].

Props johnbillion, swissspidy, jorbin.
See #61213.

#6 @desrosj
5 weeks ago

I'm going to stop here for today and see how these two branches go. I'll update the other PR branches and plan to go back further later next week.

This ticket was mentioned in Slack in #core-performance by johnbillion. View the logs.


4 weeks ago

#8 @desrosj
3 weeks ago

In 58269:

Build/Test Tools: Add input for PHP version to the performance workflow.

This adds a new input to the reusable performance testing workflow for accepting a PHP version. This allows the workflow to be reused in older branches when the PHP version currently tagged latest was not supported.

Props swissspidy, joemcgill.
See #60127, #61213.

#9 @desrosj
3 weeks ago

In 58270:

Build/Test Tools: Correct conditional logic in [58269].

See #60127, #61213.

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


3 weeks ago
#10

This updates the logic around generating the necessary parts for playground comments to be more reusable, making it possible for old branches to use this feature without added maintenance burden.

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

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


3 weeks ago
#12

This updates the 6.4 branch to make use of the reusable workflows introduced in [58165].

In addition, several Build Tool related maintenance and convenience changes are being included.

Docker related:

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

  • Removing the version property from docker-compose.yml (Trac-61101)
  • Fixing the MySQL container properties to work correctly with newer releases of Docker/containers that don't support ARM (MySQL < 8.0) (Trac-60822).

#13 @desrosj
3 weeks ago

In 58276:

Build/Test Tools: Make use of new reusable workflows.

This updates the 6.4 branch to utilize the new reusable workflows in trunk introduced in [58165].

This also includes backports for a some additional improvements and bug fixes that are necessary for the local development environment to continue working long term:

  • Migrating to Docker Compose V2 (#60901).
  • Removing the version property from docker-compose.yml (#59416).
  • Improvements to how artifacts and comments for Playground testing are generated.
  • Removing SVN related commands causing failures (#61216).
  • Updating the actions/github-scripts action to the latest version.

Merges [57918], [58157], [57124], [57125], [57249] to the 6.4 branch.

Props johnbillion, joemcgill, swissspidy, thelovekesh, narenin, mukesh27, JeffPaul, peterwilsoncc, zieladam, ockham, SergeyBiryukov, jorbin.
Fixes #61216. See #60901, #61101, #59416, #59805, #61213.

#15 @desrosj
2 weeks ago

In 58300:

Build/Test Tools: Make use of new reusable workflows for 6.3.

This updates the 6.3 branch to utilize the new reusable workflows in trunk introduced in [58165].

This also includes backports for a some additional improvements and bug fixes that are necessary for the local development environment to continue working long term:

  • The image and platform properties for the mysql container have been updated to always prefer amd64 containers (#60822).
  • macos-13 is now pinned for MacOS jobs instead of macos-latest (#61340).
  • Removes the performance testing workflow. This workflow was overhauled in 6.4 to use Playwright. Continuing to support Puppeteer-based performance testing in 6.1-6.3 (which was historically very flaky) in a reusable workflow outweighs the benefit.
  • Migrating to Docker Compose V2 (#60901).
  • Removing the version property from docker-compose.yml (#59416).
  • Improvements to how artifacts and comments for Playground testing are generated.
  • Removing SVN related commands causing failures (#61216).
  • Updating the actions/github-scripts action to the latest version.

Merges [57918], [58157], [57124], [57125], [57249] to the 6.3 branch.

Props johnbillion, joemcgill, swissspidy, thelovekesh, narenin, mukesh27, JeffPaul, peterwilsoncc, zieladam, ockham, SergeyBiryukov, jorbin.
Fixes #61340, #60822. See #61216, #60901, #61101, #59416, #59805, #61213.

#16 @desrosj
2 weeks ago

In 58301:

Build/Test Tools: Make use of new reusable workflows for 6.2.

This updates the 6.2 branch to utilize the new reusable workflows in trunk introduced in [58165].

This also includes backports for a some additional improvements and bug fixes that are necessary for the local development environment to continue working long term:

  • The image and platform properties for the mysql container have been updated to always prefer amd64 containers (#60822).
  • macos-13 is now pinned for MacOS jobs instead of macos-latest (#61340).
  • Removes the performance testing workflow. This workflow was overhauled in 6.4 to use Playwright. Continuing to support Puppeteer-based performance testing in 6.1-6.3 (which was historically very flaky) in a reusable workflow outweighs the benefit.
  • Migrating to Docker Compose V2 (#60901).
  • Removing the version property from docker-compose.yml (#59416).
  • Improvements to how artifacts and comments for Playground testing are generated.
  • Removing SVN related commands causing failures (#61216).
  • Updating the actions/github-scripts action to the latest version.

Merges [57918], [58157], [57124], [57125], [57249] to the 6.2 branch.

Props johnbillion, joemcgill, swissspidy, thelovekesh, narenin, mukesh27, JeffPaul, peterwilsoncc, zieladam, ockham, SergeyBiryukov, jorbin.
See #61340, #60822, #61216, #60901, #61101, #59416, #59805, #61213.

#17 @desrosj
2 weeks ago

In 58302:

Build/Test Tools: Include files missed in [58301].

Unprops desrosj.
See #61340, #60822, #61216, #60901, #61101, #59416, #59805, #61213.

#18 @desrosj
2 weeks ago

In 58329:

Build/Test Tools: Add a PHP version input for E2E workflow.

This allows a specific version of PHP to be used when calling the reusable end-to-end testing workflow, which is particularly useful in older branches.

Follow up to [58165], [58269], [58270].

See #61213.

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


2 weeks ago
#19

This adds an input to prevent test errors from failing the workflow. This is useful for older branches where support for a specific version of PHP was not 100%.

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

#20 @desrosj
2 weeks ago

In 58330:

Build/Test Tools: Make use of new reusable workflows for 6.1.

This updates the 6.1 branch to utilize the new reusable workflows in trunk introduced in [58165].

This also includes backports for a some additional improvements and bug fixes that are necessary for the local development environment to continue working long term:

  • The image and platform properties for the mysql container have been updated to always prefer amd64 containers (#60822).
  • macos-13 is now pinned for MacOS jobs instead of macos-latest (#61340).
  • Removes the performance testing workflow. This workflow was overhauled in 6.4 to use Playwright. Continuing to support Puppeteer-based performance testing in 6.1-6.3 (which was historically very flaky) in a reusable workflow outweighs the benefit.
  • Run E2E tests with and without SCRIPT_DEBUG (#58661).
  • Migrating to Docker Compose V2 (#60901).
  • Removing the version property from docker-compose.yml (#59416).
  • Improvements to how artifacts and comments for Playground testing are generated.
  • Removing SVN related commands causing failures (#61216).
  • Updating the actions/github-scripts action to the latest version.

Merges [56113], [56114], [57918], [58157], [57124], [57125], [57249] to the 6.1 branch.

Props johnbillion, joemcgill, swissspidy, thelovekesh, narenin, mukesh27, JeffPaul, peterwilsoncc, zieladam, ockham, SergeyBiryukov, jorbin.
See #61340, #60822, #61216, #60901, #61101, #59416, #59805, #61213, #58661.

#21 @desrosj
2 weeks ago

In 58331:

Build/Test Tools: Add an input to allow errors for the PHPUnit workflow.

This allows a calling workflow to configure the PHPUnit workflow to continue-on-error when one occurs. This is useful for older branches where support for a specific version of PHP was not at 100% within the test suite.

Follow up to [58165], [58269], [58270], [58329].

See #61213.

#23 @desrosj
2 weeks ago

In 58349:

Build/Test Tools: Use input added in [58274] in the 6.2 branch.

This was missed in [58301].

See #59416, #61213.

#24 @desrosj
2 weeks ago

In 58350:

Build/Test Tools: Use input added in [58274] in the 6.1 branch.

This was missed in [58330].

See #59416, #61213.

#27 @desrosj
2 weeks ago

In 58351:

Build/Test Tools: Make OS detection more generic in job names.

This prevents workflow runs in older branches that are using older versions of runner images from displaying the wrong operating system in job names.

Because the updated files are reusable, this change will automatically fix the issue in all older branches without the need to backport.

See #61213.

#29 @desrosj
13 days ago

In 58357:

Build/Test Tools: Make use of new reusable workflows for 6.0.

This updates the 6.0 branch to utilize the new reusable workflows in trunk introduced in [58165].

This also includes backports for a some additional improvements and bug fixes that are necessary for the local development environment to continue working long term:

  • The image and platform properties for the mysql container have been updated to always prefer amd64 containers (#60822).
  • macos-13 is now pinned for MacOS jobs instead of macos-latest (#61340).
  • Run E2E tests with and without SCRIPT_DEBUG (#58661).
  • Migrating to Docker Compose V2 (#60901).
  • Removing the version property from docker-compose.yml (#59416).
  • Improvements to how artifacts and comments for Playground testing are generated.
  • Removing SVN related commands causing failures (#61216).
  • Updating the actions/github-scripts action to the latest version.
  • Move the Memcached container into the Docker Compose config (#55700).
  • Configure Xdebug modes in the local Docker environment (#56022).

Merges [53895], [53552], [56113], [56114], [57918], [58157], [57124], [57125], [57249] to the 6.0 branch.

Props johnbillion, joemcgill, swissspidy, thelovekesh, narenin, mukesh27, JeffPaul, peterwilsoncc, zieladam, ockham, SergeyBiryukov, jorbin, Clorith, afragen.
See #55700, #61340, #60822, #61216, #60901, #61101, #59416, #59805, #61213, #58661.

#31 @desrosj
13 days ago

In 58358:

Build/Test Tools: Make use of new reusable workflows for 5.9.

This updates the 5.9 branch to utilize the new reusable workflows in trunk introduced in [58165].

This also includes backports for a some additional improvements and bug fixes that are necessary for the local development environment to continue working long term:

  • The image and platform properties for the mysql container have been updated to always prefer amd64 containers (#60822).
  • macos-13 is now pinned for MacOS jobs instead of macos-latest (#61340).
  • Run E2E tests with and without SCRIPT_DEBUG (#58661).
  • Migrating to Docker Compose V2 (#60901).
  • Removing the version property from docker-compose.yml (#59416).
  • Improvements to how artifacts and comments for Playground testing are generated.
  • Removing SVN related commands causing failures (#61216).
  • Updating the actions/github-scripts action to the latest version.
  • Move the Memcached container into the Docker Compose config (#55700).
  • Configure Xdebug modes in the local Docker environment (#56022).

Merges [53895], [53552], [56113], [56114], [57918], [58157], [57124], [57125], [57249] to the 5.9 branch.

Props johnbillion, joemcgill, swissspidy, thelovekesh, narenin, mukesh27, JeffPaul, peterwilsoncc, zieladam, ockham, SergeyBiryukov, jorbin, Clorith, afragen.
See #55700, #61340, #60822, #61216, #60901, #61101, #59416, #59805, #61213, #58661.

#32 @desrosj
13 days ago

In 58359:

Build/Test Tools: Update actions/github-scripts in the 5.9 branch.

This change was missed in [58258].

Unprops desrosj.
See #61213.

Note: See TracTickets for help on using tickets.