Skip to content

fix: filter missing addon plugins in e2e wp-env setup#339

Merged
superdav42 merged 1 commit intomainfrom
fix/e2e-optional-addon-plugins
Feb 10, 2026
Merged

fix: filter missing addon plugins in e2e wp-env setup#339
superdav42 merged 1 commit intomainfrom
fix/e2e-optional-addon-plugins

Conversation

@superdav42
Copy link
Collaborator

@superdav42 superdav42 commented Feb 10, 2026

Summary

  • The .wp-env.json includes addon plugin paths (e.g. ../addons/ultimate-multisite-domain-seller) that exist in the local monorepo but not in CI where only the core plugin is checked out
  • This caused wp-env start to fail with "The 'ultimate-multisite-domain-seller' plugin could not be found"
  • The override step now reads .wp-env.json, checks each plugin path with fs.existsSync(), and only includes plugins that are actually present on disk
  • Locally (where addons exist) nothing changes; in CI, missing addon paths are silently filtered out

Test plan

  • Verify the e2e workflow passes in CI without the domain-seller addon present
  • Verify local npm run env:start:test still works with addons present

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated end-to-end testing workflow to improve environment configuration management and plugin validation during test setup.

The .wp-env.json includes addon paths (e.g. domain-seller) that only
exist in the local monorepo but not in CI where only the core plugin
is checked out. This caused wp-env start to fail with "plugin could
not be found". Now the override step checks each plugin path exists
before including it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 10, 2026

📝 Walkthrough

Walkthrough

The e2e.yml workflow replaces a basic echo command for PHP version configuration with a Node.js script that dynamically reads wp-env.json, applies matrix-based PHP versions, filters plugins by file existence across environments, and writes a generated override configuration file.

Changes

Cohort / File(s) Summary
CI Workflow Configuration
.github/workflows/e2e.yml
Replaces simple echo-based PHP version override with Node.js script that reads configuration files, applies matrix values, filters plugins based on resolved path existence, and generates wp-env.override.json with logging.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A script hops in with logic so keen,
Reading configs and filtering unseen,
WordPress environments now setup with care,
Plugin paths verified, none left to spare! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: filtering missing addon plugins in the e2e wp-env setup, which directly matches the core objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/e2e-optional-addon-plugins

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.github/workflows/e2e.yml:
- Line 65: The override object currently nests phpVersion under config which
makes it a wp-config constant; instead set phpVersion as a top-level property on
the override object. Update the override variable (named override) so it has
phpVersion: '${{ matrix.php }}' alongside env rather than inside config, and
keep config only for wp-config constants; ensure the resulting object shape
matches the wp-env override schema (top-level phpVersion, config, env).
🧹 Nitpick comments (1)
.github/workflows/e2e.yml (1)

34-34: actions/checkout@v2 is deprecated (runs on Node.js 12).

This is pre-existing, but v2 was sunset by GitHub. Consider bumping to v4 (along with setup-node and cache to v4) in a follow-up.

const fs = require('fs');
const path = require('path');
const config = JSON.parse(fs.readFileSync('.wp-env.json', 'utf8'));
const override = { config: { phpVersion: '${{ matrix.php }}' }, env: {} };
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

wp-env.override.json phpVersion schema documentation

💡 Result:

Where is the wp-env JSON schema documented?

WordPress publishes a JSON Schema for wp-env config files (.wp-env.json / .wp-env.override.json). You can reference it via $schema:

  • Trunk schema URL: https://schemas.wp.org/trunk/wp-env.json (note: tagged versions may not be available there). [2]
  • Pinned to a specific @wordpress/env version:
    https://raw.githubusercontent.com/WordPress/gutenberg/@wordpress/env@x.y.z/schemas/json/wp-env.json [2]
    Note: version 10.1.0 used a filename with a leading dot (.wp-env.json) in the schema name; later versions don’t. [2]

Example:

{
  "$schema": "https://schemas.wp.org/trunk/wp-env.json",
  "phpVersion": "8.2"
}

What’s the phpVersion field (including in .wp-env.override.json)?

  • phpVersion is supported in .wp-env.json with type string | null and sets the PHP version used by wp-env. If null, wp-env uses its default. [1]
  • .wp-env.override.json uses the same shape; any fields you set there take precedence over .wp-env.json (with only config and mappings being merged). [1]
  • Example value: "phpVersion": "8.2" is shown in WordPress’s wp-env docs/posts and is expected to work. [3]

Sources: [1] [2] [3]


phpVersion must be a top-level property, not nested under config.

In the wp-env override schema, phpVersion sets the actual PHP version used by the environment and belongs at the top level of the override object. The config key is reserved for wp-config.php constants. As currently written, this code would add a PHP constant instead of changing the runtime version.

Fix
-            const override = { config: { phpVersion: '${{ matrix.php }}' }, env: {} };
+            const override = { phpVersion: '${{ matrix.php }}', env: {} };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const override = { config: { phpVersion: '${{ matrix.php }}' }, env: {} };
const override = { phpVersion: '${{ matrix.php }}', env: {} };
🤖 Prompt for AI Agents
In @.github/workflows/e2e.yml at line 65, The override object currently nests
phpVersion under config which makes it a wp-config constant; instead set
phpVersion as a top-level property on the override object. Update the override
variable (named override) so it has phpVersion: '${{ matrix.php }}' alongside
env rather than inside config, and keep config only for wp-config constants;
ensure the resulting object shape matches the wp-env override schema (top-level
phpVersion, config, env).

@superdav42 superdav42 merged commit 6fd4a99 into main Feb 10, 2026
8 of 9 checks passed
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