Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Build/Test Tools: Support multiple built file change patches#12240

Open
itzmekhokan wants to merge 1 commit into
WordPress:trunkfrom
itzmekhokan:fix/65496-themes-built-file-artifact-names
Open

Build/Test Tools: Support multiple built file change patches#12240
itzmekhokan wants to merge 1 commit into
WordPress:trunkfrom
itzmekhokan:fix/65496-themes-built-file-artifact-names

Conversation

@itzmekhokan

Copy link
Copy Markdown

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.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

The theme testing workflow uploads a built file changes patch as an
artifact for each default theme that has uncommitted changes. Because
every job used the same artifact name (`pr-built-file-changes`), runs
with more than one affected theme failed: `actions/upload-artifact`
rejects duplicate artifact names within a single workflow run.

Give each theme a unique artifact name by appending the theme slug, and
update the "Commit Built File Changes" workflow to download, unzip, and
apply every patch sharing the `pr-built-file-changes` prefix rather than
only the first match. The single patch produced by the main build check
continues to be handled by the same prefix match.

Fixes #65496.
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props khokansardar.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

Copy link
Copy Markdown

Hi there! 👋

Thank you for your contribution to WordPress! 💖

It looks like this is your first pull request to wordpress-develop. Here are a few things to be aware of that may help you out!

No one monitors this repository for new pull requests. Pull requests must be attached to a Trac ticket to be considered for inclusion in WordPress Core. To attach a pull request to a Trac ticket, please include the ticket's full URL in your pull request description.

Pull requests are never merged on GitHub. The WordPress codebase continues to be managed through the SVN repository that this GitHub repository mirrors. Please feel free to open pull requests to work on any contribution you are making.

More information about how GitHub pull requests can be used to contribute to WordPress can be found in the Core Handbook.

Please include automated tests. Including tests in your pull request is one way to help your patch be considered faster. To learn about WordPress' test suites, visit the Automated Testing page in the handbook.

If you have not had a chance, please review the Contribute with Code page in the WordPress Core Handbook.

The Developer Hub also documents the various coding standards that are followed:

Thank you,
The WordPress Project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant