Thanks to visit codestin.com
Credit goes to core.trac.wordpress.org

Make WordPress Core

Opened 12 hours ago

Last modified 2 hours ago

#65496 new defect (bug)

Theme testing workflow will fail when multiple themes have uncommitted changes to built files.

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

Description

When the test-and-zip-default-themes.yml workflow detects unexpected changes to built files, a patch file is uploaded as an artifact for the commit-built-file-changes.yml workflow to apply and commit before pushing the changes back to the pull request HEAD branch.

However, if multiple themes have uncommitted changes the workflow will fail due to actions/upload-artifact rejecting artifacts with identical names on the same workflow run (pr-built-file-changes is used for every job).

The workflow needs to be updated to use a unique name for each theme, and commit-built-file-changes.yml needs to be updated to handle multiple patch files from a single triggering workflow (currently only the first artifact is processed).

The check-built-files.yml also uploads artifacts using the same name. But these patches are for the main WordPress build script. There should only ever be one artifact attached to these triggering workflow runs.

The name of the artifact is configured as pr-built-file-changes because that is the name commit-built-file-changes.yml expects. However, only the first artifact is uploaded when a workflow attempts to upload multiple artifacts with the same name (each additional attempt receives a failure and the workflow fails).

Change History (1)

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


2 hours ago
#1

  • Keywords has-patch added; needs-patch removed

Fixes the theme testing workflow failing when more than one default theme has uncommitted changes to built files.

What the problem was:

  • The test-build-scripts matrix in test-and-zip-default-themes.yml uploaded every theme's patch under the same artifact name (pr-built-file-changes).
  • actions/upload-artifact rejects duplicate artifact names within a single workflow run, so any run with two or more affected themes failed.
  • commit-built-file-changes.yml only ever matched and processed the first artifact named exactly pr-built-file-changes, so multiple theme patches could not be handled.

What the fix does:

  • Gives each theme a unique artifact name: pr-built-file-changes-<theme>.
  • Updates the "Commit Built File Changes" workflow to download, unzip, and apply every artifact sharing the pr-built-file-changes prefix, instead of only the first match.
  • Leaves reusable-check-built-files.yml unchanged; its single pr-built-file-changes artifact is still matched by the same prefix.

Approach and why:

  • A shared prefix lets one consumer workflow handle both the single main-build patch and the per-theme patches without special-casing either trigger. Each patch is extracted to its own directory so the changes.diff files do not collide, then applied in sequence.

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

## Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 4.8
Used for: Ticket analysis, and tests cases. All changes were reviewed, validated against the codebase, and are taken responsibility for by me.

Note: See TracTickets for help on using tickets.