Skip to content

Remove deprecated constants - #2496

Merged
westonruter merged 2 commits into
WordPress:trunkfrom
hbhalodia:fix/issue-1920
May 28, 2026
Merged

westonruter merged 2 commits into
WordPress:trunkfrom
hbhalodia:fix/issue-1920

Conversation

@hbhalodia

@hbhalodia hbhalodia commented May 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR contains two unrelated changes:

  1. Removes the now-unused deprecated constants file from the Optimization Detective plugin (the original scope, fixes Remove constant from the deprecated.php in optimization-detective plugin #1920).
  2. Fixes the Plugin Check CI workflow, which started failing on the new GitHub Actions ubuntu-24.04 runner image (20260525.161, Node.js 24.16.0) due to a latent bug in @wordpress/env's URL-source download path. The workflow now inlines the relevant steps of wordpress/plugin-check-action so we can install plugin-check via wp-cli after wp-env start instead of via a URL plugin entry in .wp-env.json (the trigger). Also pins @wordpress/env to a known-good version.

Tracking upstream resolution at:

Once those land, revert the workflow change back to uses: wordpress/plugin-check-action@….

Relevant technical choices

  1. Remove the constants and remove the deprecated.php file as there are no deprecation available.
  2. Inline wordpress/plugin-check-action's steps in .github/workflows/plugin-check.yml, omitting the plugin-check.zip URL from the generated .wp-env.json and installing it via wp-cli post-boot. Bisection of the bug is documented in the squashed commit message and on plugin-check-action#579.

Use of AI Tools

  • Original constant-removal change: none.
  • CI workflow fix: investigated, bisected, and authored in a session with Claude Code (Opus 4.7). Pinning @wordpress/env was suggested by GitHub Copilot's PR reviewer. Both are credited as co-authors on the workflow commit.

@hbhalodia
hbhalodia requested a review from westonruter as a code owner May 27, 2026 06:41
@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.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: hbhalodia <hbhalodia@git.wordpress.org>
Co-authored-by: westonruter <westonruter@git.wordpress.org>

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

@codecov

codecov Bot commented May 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.29%. Comparing base (683ffb0) to head (56c61e6).
⚠️ Report is 17 commits behind head on trunk.

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk    #2496   +/-   ##
=======================================
  Coverage   69.29%   69.29%           
=======================================
  Files          90       90           
  Lines        7724     7723    -1     
=======================================
  Hits         5352     5352           
+ Misses       2372     2371    -1     
Flag Coverage Δ
multisite 69.29% <ø> (+<0.01%) ⬆️
single 35.76% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the now-unused deprecated constants file from the Optimization Detective plugin and adjusts the CI Plugin Check workflow to work around an upstream wp-env startup issue on ubuntu-24.04.

Changes:

  • Removed loading of deprecated.php from plugins/optimization-detective/load.php.
  • Deleted plugins/optimization-detective/deprecated.php (previously containing deprecated constants).
  • Reworked .github/workflows/plugin-check.yml to inline Plugin Check setup/run steps via wp-env (instead of wordpress/plugin-check-action) and upload results as an artifact.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
plugins/optimization-detective/load.php Stops requiring the deprecated constants file during plugin load.
plugins/optimization-detective/deprecated.php Removes the deprecated constants file entirely.
.github/workflows/plugin-check.yml Changes how Plugin Check runs in CI to avoid an upstream wp-env runner issue.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/plugin-check.yml Resolved
Comment thread .github/workflows/plugin-check.yml Resolved
@westonruter westonruter changed the title Remove constant from the deprecated.php in optimization-detective plugin Remove deprecated constants; fix Plugin Check CI on ubuntu-24.04 May 28, 2026
The `Plugin Check` workflow started failing intermittently on PRs starting
2026-05-26 and was about to fail for every run once GitHub finished rolling
out the new `ubuntu-24.04` runner image (20260525.161, Node.js 24.16.0).
The symptom: `wp-env start` from wordpress/plugin-check-action silently
exits 0 after ~30 s without booting Docker, then `wp-env run cli wp cli
info` reports "Environment not initialized". Failures correlated 100% with
the new image; runs on the previous image (20260518.149, Node 24.15.0)
continued to succeed.

Bisected the trigger via three CI experiments on this branch:

  1. Inlined the upstream action and added `"testsEnvironment": false`
     to the generated `.wp-env.json` — the dual-env deprecation path was
     a plausible suspect. Symptom unchanged.

  2. Dropped the `--update` flag from `wp-env start` — Gutenberg's CI
     succeeds on the new image without it. Symptom unchanged.

  3. Removed the URL-based plugin entry
     ("https://downloads.wordpress.org/plugin/plugin-check.zip") from
     `.wp-env.json` and installed plugin-check via `wp-cli` after the env
     came up. All matrix jobs went green on the new image.

The bug is in wp-env's URL-plugin download path (likely the bundled `got`
^11.8.5 dependency regressing on Node 24.16/libuv 1.52.1). This commit
keeps the workaround from experiment 3 — inlining the upstream action's
steps so we can omit the URL plugin and install plugin-check via wp-cli
post-boot.

Also pins @wordpress/env to 11.7.0 (rather than installing latest) so a
future regression in wp-env can't silently break this workflow the same
way again. Bump intentionally when picking up upstream fixes.

Tracking upstream fixes at:

- WordPress/plugin-check-action#579
- WordPress/gutenberg#78762

Revert to `uses: wordpress/plugin-check-action@...` once those are
resolved upstream.

---

Squashed from the following commits, preserved verbatim below:

--- 1a83936: Inline plugin-check-action to add testsEnvironment:false workaround ---

The upstream wordpress/plugin-check-action auto-generates a .wp-env.json
without "testsEnvironment": false, which triggers a bug in @wordpress/env's
legacy dual-environment startup path on the ubuntu-24.04 runner image
20260525.161 (Node.js 24.16.0): wp-env start silently exits 0 after ~30s
without booting Docker, then `wp-env run cli wp cli info` reports
"Environment not initialized". Failures correlate 100% with the new image;
runs on 20260518.149 (Node 24.15.0) still succeed.

This commit inlines the relevant steps from the action so we can add
"testsEnvironment": false to the generated config, sidestepping the
buggy code path. Track upstream resolution at:
WordPress/plugin-check-action#579

Revert to `uses: wordpress/plugin-check-action@...` once that issue lands.

--- fb628f6: Drop --update flag from wp-env start to test if it dodges the bug ---

First experiment (testsEnvironment: false) didn't fix it — wp-env still
silently exits 0 on the new runner image. The deprecation warning is gone,
proving the config was honored, so the dual-env path isn't where the bug
lives.

The remaining difference vs Gutenberg's CI (which boots wp-env fine on the
same broken image) is the --update flag. Their `wp-env --config ... start`
has no --update; ours does. Dropping it here to see if that's the trigger.

--- 90e0955: Remove URL plugin download from .wp-env.json to test if that's the trigger ---

The remaining material difference vs Gutenberg's working wp-env start on the
new runner image: their config only references local plugins ("." and a git
core ref); ours pulls plugin-check via HTTP from downloads.wordpress.org.

The HTTP download path goes through wp-env's bundled `got` (^11.8.5, last
released years ago), which is plausibly where Node 24.16 / libuv 1.52.1
regresses silently.

Removing the URL plugin from .wp-env.json; install plugin-check via wp-cli
once the env is up instead.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@westonruter westonruter changed the title Remove deprecated constants; fix Plugin Check CI on ubuntu-24.04 Remove deprecated constants May 28, 2026
@westonruter
westonruter merged commit 3aa5145 into WordPress:trunk May 28, 2026
28 checks passed
Eitan-brightleaf added a commit to BrightLeaf-Digital/.github that referenced this pull request Jun 1, 2026
…bug (#579)

On the ubuntu-24.04 runner image >=20260525.161 (Node 24.16), @wordpress/env's
URL-source download path silently exits 0 without booting Docker. The upstream
plugin-check-action auto-generates a .wp-env.json that lists plugin-check as a URL
plugin, which trips this bug, so `wp-env start` "succeeds" but nothing runs and the
check fails with "Environment not initialized".

Inline the action's steps in the pcp job: generate .wp-env.json without the URL
plugin, pin @wordpress/env@11.6.0, and install plugin-check via wp-cli after boot.
Revert to `uses: wordpress/plugin-check-action@...` once upstream is fixed.

Also clear any github-oauth token before Strauss in both jobs (prefixing reads only
the installed composer.json/vendor and needs no GitHub auth; gravityops/core is
SSH/no-api, the rest are public), and add a debug step to surface composer auth state.

Refs WordPress/plugin-check-action#579, WordPress/performance#2496, WordPress/gutenberg#78762.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Plugin] Optimization Detective [slug: optimization-detective] [Type] Enhancement A suggestion for improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove constant from the deprecated.php in optimization-detective plugin

3 participants