Make WordPress Core

Opened 5 months ago

Last modified 2 months ago

#65496 new defect (bug)

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

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

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).

Attachments (1)

issue-after-fix.png​ (589.1 KB ) - added by arkaprabhachowdhury 2 months ago.

Download all attachments as: .zip

Change History (4)

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


5 months 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.

#2 @sanayasir
4 months ago

  • Keywords needs-testing added

#3 @arkaprabhachowdhury
2 months ago

Test Report

Summary

Tested ​PR #12240, which addresses the duplicate artifact-name failure described in this ticket.

Test environment

Steps performed

  1. Reviewed the reported failure condition where multiple theme patches use the same artifact name.
  2. Reviewed the successful workflow run after the fix.
  3. Confirmed that the workflow completed successfully and produced the expected matrix results and artifacts.

Expected result

Each affected theme should upload its built-file patch without duplicate-name failures, and the consumer workflow should process all matching patch artifacts.

Actual result

The reported issue is caused by the duplicate pr-built-file-changes artifact name used across theme jobs. After the fix, the linked workflow run completed successfully in 1 minute 52 seconds and produced 15 artifacts.

Result

PASS

The successful run confirms that the workflow is healthy after the fix. The attached screenshot shows the successful post-fix workflow run.

Last edited 2 months ago by arkaprabhachowdhury (previous) (diff)
Note: See TracTickets for help on using tickets.