| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
WP-CLI gates `require`, `exec`, `env` and `ssh-args` directives found in a project-level wp-cli.yml behind a trust confirmation. Test fixtures create such files routinely and a non-interactive test run cannot answer the prompt, so pass WP_CLI_TRUST_PROJECT_CONFIG=1 to every command the Behat context runs. An explicit WP_CLI_TRUST_PROJECT_CONFIG in the outer environment still wins, and scenarios exercising the trust mechanism itself can keep overriding it per command. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcafAC2UeQTVKoy8wVxJzB
📝 Walkthrough
WalkthroughChangesProject configuration trust
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: copilot, schlessera 🚥 Pre-merge checks | ✅ 5 ✅ Passed checks (5 passed)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 PHPStan (2.2.7)PHPStan was skipped because the config uses disallowed bootstrapFiles, bootstrapFile, or includes directives. 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. ❤️ ShareComment @coderabbitai help to get the list of available commands. |
Sorry, something went wrong.
Codecov Report❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
📢 Thoughts on this report? Let us know! |
Sorry, something went wrong.
There was a problem hiding this comment.
This PR updates the WP-CLI Behat test harness to default to trusting project-level wp-cli.yml configuration during non-interactive runs, preventing widespread failures introduced by the new trust confirmation gate in wp-cli/wp-cli#6365.
Changes:
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Context/FeatureContext.php | Adds a default WP_CLI_TRUST_PROJECT_CONFIG=1 process environment value for commands executed by the Behat context (with passthrough override support). |
| README.md | Documents the default trust behavior in Behat runs and shows how to override it for the full run or per command. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agentsVerify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. Inline comments: In `@README.md`: - Around line 150-157: Update the “Project configuration trust” heading in README.md to use the repository’s configured setext heading style, and add a gherkin language identifier to the command example’s fenced code block.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 47ae8d2e-65d6-4ffa-a607-d2c37a5e68b8
📥 CommitsReviewing files that changed from the base of the PR and between b02c72d and 7896e5a.
📒 Files selected for processing (2)
Sorry, something went wrong.
| #### Project configuration trust | ||
|
|
||
| WP-CLI asks for confirmation before acting on `require`, `exec`, `env` or `ssh-args` directives found in a project-level `wp-cli.yml` file. Test fixtures create such files all the time and a test run cannot answer an interactive prompt, so the Behat context passes `WP_CLI_TRUST_PROJECT_CONFIG=1` to every command it runs. | ||
|
|
||
| Set the `WP_CLI_TRUST_PROJECT_CONFIG` environment variable yourself to override that default for the whole run. Individual scenarios can override it per command: | ||
| ``` | ||
| When I try `WP_CLI_TRUST_PROJECT_CONFIG=false wp cli version` | ||
| ``` |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Fix the Markdown lint issues in the new section.
Line 150 must use the configured setext heading style. Line 155 must specify a fence language, such as gherkin.
Proposed fix-#### Project configuration trust
+Project configuration trust
+---------------------------
...
-```
+```gherkin‼️ 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.
| #### Project configuration trust | |
| WP-CLI asks for confirmation before acting on `require`, `exec`, `env` or `ssh-args` directives found in a project-level `wp-cli.yml` file. Test fixtures create such files all the time and a test run cannot answer an interactive prompt, so the Behat context passes `WP_CLI_TRUST_PROJECT_CONFIG=1` to every command it runs. | |
| Set the `WP_CLI_TRUST_PROJECT_CONFIG` environment variable yourself to override that default for the whole run. Individual scenarios can override it per command: | |
| ``` | |
| When I try `WP_CLI_TRUST_PROJECT_CONFIG=false wp cli version` | |
| ``` | |
| Project configuration trust | |
| --------------------------- | |
| WP-CLI asks for confirmation before acting on `require`, `exec`, `env` or `ssh-args` directives found in a project-level `wp-cli.yml` file. Test fixtures create such files all the time and a test run cannot answer an interactive prompt, so the Behat context passes `WP_CLI_TRUST_PROJECT_CONFIG=1` to every command it runs. | |
| Set the `WP_CLI_TRUST_PROJECT_CONFIG` environment variable yourself to override that default for the whole run. Individual scenarios can override it per command: |
[warning] 150-150: Heading style
Expected: setext; Actual: atx
(MD003, heading-style)
[warning] 155-155: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI AgentsVerify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@README.md` around lines 150 - 157, Update the “Project configuration trust” heading in README.md to use the repository’s configured setext heading style, and add a gherkin language identifier to the command example’s fenced code block.
Source: Linters/SAST tools
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Companion to wp-cli/wp-cli#6365.
That PR gates require, exec, env and ssh-args directives found in a project-level wp-cli.yml behind a trust confirmation, controlled by --trust-project-config / WP_CLI_TRUST_PROJECT_CONFIG.
Test fixtures create such files all the time — Given a wp-cli.yml file: with a require: entry is one of the most common steps across the WP-CLI package suites, and given_a_request_to_a_url_respond_with_file() writes one itself. A Behat run is non-interactive, so without this change every one of those scenarios fails with:
Changes
Testing
Ran the affected wp-cli/wp-cli feature scenarios against a checkout of wp-cli/wp-cli#6365 with this context patched in: the 28 scenarios that build a project wp-cli.yml containing require/exec/env/ssh-args and do not need a WordPress install (across command, config, flags, prompt, runcommand and runner features) fail without this change and pass with it. The nine new trust scenarios in features/config.feature still pass, confirming that the per-command override keeps working.
Note this needs to be released before wp-cli/wp-cli#6365's CI can go green, since that repo installs wp-cli/wp-cli-tests from a version constraint.
Generated by Claude Code
Summary by CodeRabbit
New Features
Documentation