Skip to content

Build/Test Tools: Allow the CSS precommit task to be skipped - #13318

Closed
itzmekhokan wants to merge 1 commit into
WordPress:trunkfrom
itzmekhokan:fix/65993-precommit-css-input
Closed

Build/Test Tools: Allow the CSS precommit task to be skipped#13318
itzmekhokan wants to merge 1 commit into
WordPress:trunkfrom
itzmekhokan:fix/65993-precommit-css-input

Conversation

@itzmekhokan

Copy link
Copy Markdown

The Test Build Processes workflow now fails for the 5.2 through 5.7 branches.

The precommit:css step added in [63315] runs Autoprefixer against whichever branch is checked out. Those branches have not had the task run since the browser usage database was last updated, so it rewrites tracked CSS files and the git diff --exit-code step that follows the build then fails. Since those branches call this reusable workflow at @trunk, this adds a test-css input mirroring the existing test-emoji one, letting each branch opt out.

It defaults to true, so no current caller changes behaviour; the affected branches still need test-css: false added alongside their existing test-emoji: false.

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

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5
Used for: Tracing the CI failure to the precommit:css step and drafting the workflow input. All changes were reviewed and validated 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 `precommit:css` step added in [63315] runs Autoprefixer against
whichever branch is checked out. In the 5.2 through 5.7 branches, that
task has not been run since the browser usage database was last
updated, so it rewrites tracked CSS files and the `git diff
--exit-code` step that follows the build fails.

Those branches call this reusable workflow at `@trunk`, so add a
`test-css` input mirroring the existing `test-emoji` one, allowing each
branch to opt out of the task.

See #65993.
@github-actions

github-actions Bot commented Aug 29, 2026

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, lancewillett, desrosj.

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

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@lancewillett
lancewillett self-requested a review September 3, 2026 14:24

@lancewillett lancewillett left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a valid, narrowly scoped fix. I verified that the 5.2–5.7 src jobs modify tracked CSS and fail the clean-tree check.

The new input follows the existing test-emoji pattern, defaults to true, and leaves current callers unchanged. Approved for trunk.

@lancewillett

Copy link
Copy Markdown
Member

@itzmekhokan, after this lands on trunk, please open one follow-up PR each against the affected branches:

  • 5.2—PR:
  • 5.3—PR:
  • 5.4—PR:
  • 5.5—PR:
  • 5.6—PR:
  • 5.7—PR:

In each PR, add test-css: false beside the existing test-emoji: false in both with: blocks in .github/workflows/test-build-processes.yml. Please link Trac #65993 and confirm all Test Build Processes jobs pass.

Once all six are green, please comment here with the PR links and results. We’ll then coordinate the required second-core-committer reviews and SVN branch commits.

pento pushed a commit that referenced this pull request Sep 3, 2026
The reusable build-process workflow runs `precommit:css` against the checked-out branch. On branches 5.2 through 5.7, the task rewrites tracked CSS and causes the clean-tree check to fail.

Add a `test-css` input so affected branch callers can skip the task. It defaults to `true`, preserving behavior for existing callers.

Developed in: #13318

Props desrosj, khokansardar.
See #65993.


git-svn-id: https://develop.svn.wordpress.org/trunk@63445 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Sep 3, 2026
The reusable build-process workflow runs `precommit:css` against the checked-out branch. On branches 5.2 through 5.7, the task rewrites tracked CSS and causes the clean-tree check to fail.

Add a `test-css` input so affected branch callers can skip the task. It defaults to `true`, preserving behavior for existing callers.

Developed in: WordPress/wordpress-develop#13318

Props desrosj, khokansardar.
See #65993.

Built from https://develop.svn.wordpress.org/trunk@63445


git-svn-id: http://core.svn.wordpress.org/trunk@62626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
@lancewillett

Copy link
Copy Markdown
Member

Trunk fix landed in https://core.trac.wordpress.org/changeset/63445

@lancewillett

Copy link
Copy Markdown
Member

Slack failures indicate we still need the backport PRs to land: https://wordpress.slack.com/archives/C02RQBWTW/p1788453035296919

@lancewillett lancewillett reopened this Sep 3, 2026
@desrosj

desrosj commented Sep 3, 2026

Copy link
Copy Markdown
Member

I'm a pretty torn on this one.

The fact that these CSS changes have not been committed to the branch is a bug. It's also a sign that this new step in the workflow is doing it's job and flagging legitimate problems, even ones minor in nature.

While precommit:css usually results in minor changes that only affect users who have really old versions of browsers installed (which, in most cases, we have not supported for some time), it is possible that this could flag something more problematic in the future.

I am currently of the opinion that we should just commit the changes that were missed to these 5 or so branches instead.

@desrosj desrosj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking as requesting changes just so my concerns can be discussed first.

@desrosj

desrosj commented Sep 3, 2026

Copy link
Copy Markdown
Member

To make sure I was not recommending that we make changes that were too substantive, I analyzed the actual changes:

5.7 branch

28 KB src/wp-admin/css/about.css

5.6 branch

20 KB src/wp-admin/css/admin-menu.css
72 KB src/wp-admin/css/common.css
68 KB src/wp-admin/css/customize-controls.css
24 KB src/wp-admin/css/customize-nav-menus.css
16 KB src/wp-admin/css/customize-widgets.css
8 KB src/wp-admin/css/site-health.css
44 KB src/wp-admin/css/themes.css
20 KB src/wp-admin/css/widgets.css
24 KB src/wp-includes/css/admin-bar.css
36 KB src/wp-includes/css/editor.css
56 KB src/wp-includes/css/media-views.css

5.5 branch

20 KB src/wp-admin/css/admin-menu.css
72 KB src/wp-admin/css/common.css
68 KB src/wp-admin/css/customize-controls.css
24 KB src/wp-admin/css/customize-nav-menus.css
16 KB src/wp-admin/css/customize-widgets.css
8 KB src/wp-admin/css/site-health.css
44 KB src/wp-admin/css/themes.css
20 KB src/wp-admin/css/widgets.css
24 KB src/wp-includes/css/admin-bar.css
36 KB src/wp-includes/css/editor.css
56 KB src/wp-includes/css/media-views.css

5.4 branch

20 KB src/wp-admin/css/admin-menu.css
72 KB src/wp-admin/css/common.css
68 KB src/wp-admin/css/customize-controls.css
24 KB src/wp-admin/css/customize-nav-menus.css
16 KB src/wp-admin/css/customize-widgets.css
40 KB src/wp-admin/css/themes.css
20 KB src/wp-admin/css/widgets.css
28 KB src/wp-includes/css/admin-bar.css
36 KB src/wp-includes/css/editor.css
56 KB src/wp-includes/css/media-views.css

5.3 branch

20 KB src/wp-admin/css/admin-menu.css
72 KB src/wp-admin/css/common.css
68 KB src/wp-admin/css/customize-controls.css
24 KB src/wp-admin/css/customize-nav-menus.css
16 KB src/wp-admin/css/customize-widgets.css
40 KB src/wp-admin/css/themes.css
20 KB src/wp-admin/css/widgets.css
28 KB src/wp-includes/css/admin-bar.css
36 KB src/wp-includes/css/editor.css
56 KB src/wp-includes/css/media-views.css

5.2 branch

20 KB src/wp-admin/css/admin-menu.css
72 KB src/wp-admin/css/common.css
68 KB src/wp-admin/css/customize-controls.css
24 KB src/wp-admin/css/customize-nav-menus.css
16 KB src/wp-admin/css/customize-widgets.css
40 KB src/wp-admin/css/themes.css
20 KB src/wp-admin/css/widgets.css
36 KB src/wp-includes/css/editor.css
52 KB src/wp-includes/css/media-views.css

As for the changes themselves, nearly all of the changed lines are removing -moz-user-select: none; rules. Firefox has not required this vendor prefix since version 68 (they're currently at 150+). There are a small number of min-width: -moz-fit-content additions in a few of the branches.

In summary, the files modified combine for less than 400KB in size that would be added to the next auto-update for each, sould one be required.

@lancewillett

lancewillett commented Sep 3, 2026

Copy link
Copy Markdown
Member

I’m in favor of fixing the generated CSS instead of changing the test behavior. Good catch, @desrosj.

@itzmekhokan, what do you think about reverting the trunk change, keeping the test enabled on these branches, and committing the generated CSS changes instead?

@lancewillett

Copy link
Copy Markdown
Member

After more thought, I do agree we should flip this to fix CSS files instead.

Suggested direction (open to more feedback!):

  1. Revert r63445 on trunk
  2. Replace the planned test-css: false backports with one PR per affected branch
  3. Each PR should contain only the output of npm run grunt precommit:css—no workflow changes
  4. Keep the CSS check enabled and confirm the build-process jobs pass on all three operating systems
  5. Close Trac #65993 after all six branch commits land

This fixes the code flagged by the check and preserves CI’s ability to detect future CSS drift.

@itzmekhokan, since you identified the failure and contributed the original fix, I’d like you to remain part of the solution. Would you be willing to prepare the six branch PRs with the generated CSS changes?

@itzmekhokan

Copy link
Copy Markdown
Author

@lancewillett @desrosj — agreed, fixing the CSS is the better outcome. Six PRs are open, one per branch, each containing only the output of npm run grunt precommit:css and no workflow changes:

All six are green. That is 36 of 36 Core running from src and Core running from build jobs passing on Linux, Windows and macOS. The build jobs were already passing before these changes; the src jobs were the failing ones.

Each branch was regenerated on Node 14 with npm ci, so Autoprefixer and caniuse-lite come from that branch's own package-lock.json. Before committing I diffed the result against the failing Core running from src logs for all six branches on all three operating systems, and every one of those 18 jobs produced a diff byte-identical to what is committed here.

The content matches your analysis: every deleted line is a -moz-user-select declaration, 5.3 through 5.6 each add one min-width: -moz-fit-content in admin-bar.css, and 5.7 adds -webkit-user-select and -ms-user-select to one rule in about.css.

That leaves the trunk revert of [63445], which needs a committer. Once that and the six branch commits land, https://core.trac.wordpress.org/ticket/65993 can be closed.

@lancewillett

Copy link
Copy Markdown
Member

Looking good @itzmekhokan

@desrosj If you could be a 2nd reviewer on all these PRs I'll do the core commits

@lancewillett

Copy link
Copy Markdown
Member

r63465 reverted r63445

The replacement CSS fixes are tracked in #13400, #13401, #13402, #13403, #13404, and #13405

Waiting on a 2nd core committer to review

@desrosj

desrosj commented Sep 4, 2026

Copy link
Copy Markdown
Member

Going to close this out as fixed because the original change was reverted. Let's use the individual PRs to follow up.

@desrosj desrosj closed this Sep 4, 2026
@github-project-automation github-project-automation Bot moved this from In review to Done in WordPress Project Build Tooling Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants