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)
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
#3
@
2 months ago
Test Report
Summary
Tested PR #12240, which addresses the duplicate artifact-name failure described in this ticket.
Test environment
- GitHub Actions run: Test Default Themes & Create ZIPs.
- Browser: Google Chrome.
Steps performed
- Reviewed the reported failure condition where multiple theme patches use the same artifact name.
- Reviewed the successful workflow run after the fix.
- 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.
Fixes the theme testing workflow failing when more than one default theme has uncommitted changes to built files.
What the problem was:
test-build-scriptsmatrix intest-and-zip-default-themes.ymluploaded every theme's patch under the same artifact name (pr-built-file-changes).actions/upload-artifactrejects duplicate artifact names within a single workflow run, so any run with two or more affected themes failed.commit-built-file-changes.ymlonly ever matched and processed the first artifact named exactlypr-built-file-changes, so multiple theme patches could not be handled.What the fix does:
pr-built-file-changes-<theme>.pr-built-file-changesprefix, instead of only the first match.reusable-check-built-files.ymlunchanged; its singlepr-built-file-changesartifact is still matched by the same prefix.Approach and why:
changes.difffiles 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.