Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 1, 2026

When using inherit: in WP-CLI config files, disabled_commands from the inherited file were being overwritten instead of merged with the parent file's disabled commands.

Changes

  • php/config-spec.php: Added 'multiple' => true flag to disabled_commands spec to enable array merging during config inheritance
  • features/config.feature: Added test scenario verifying disabled commands merge correctly across inherited configs

Example

# prod.yml
disabled_commands:
  - eval

# wp-cli.yml  
disabled_commands:
  - eval-file
_:
  merge: true
  inherit: prod.yml

Before: Only eval-file was disabled (inherited eval was lost)
After: Both eval and eval-file are disabled

The 'multiple' => true flag instructs the Configurator to merge arrays instead of replacing them, matching the behavior of other array-based config options like require and apache_modules.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • example.com
    • Triggering command: /usr/bin/php php vendor/bin/phpunit --color=always --bootstrap ./vendor/wp-cli/wp-cli-tests/tests/bootstrap.php '-d short_open_t-n (dns block)
    • Triggering command: /usr/bin/php /usr/bin/php /home/REDACTED/work/wp-cli/wp-cli/bin/../php/boot-fs.php core install --url=REDACTED --title=WP CLI Site --admin_user=admin --admin_email=admin@example.com --admin_password=password1 --skip-email (dns block)
    • Triggering command: /usr/bin/php /usr/bin/php /home/REDACTED/work/wp-cli/wp-cli/bin/../php/boot-fs.php core install --url=REDACTED --title=WP CLI Site --admin_user=admin --admin_email=admin@example.com --admin_password=password1 --skip-email est.php sh /hom�� '-d display_startup_errors=0' '-d asp_tags=Off' '-d short_open_tag=Off' '-d error_reporting=E_ALcp (dns block)
  • nosuchhost_asdf_asdf_asdf.com
    • Triggering command: /usr/bin/php php vendor/bin/phpunit --color=always --bootstrap ./vendor/wp-cli/wp-cli-tests/tests/bootstrap.php '-d short_open_t-n (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>inherit: not inheriting disabled_commands</issue_title>
<issue_description>## Bug Report

Describe the current, buggy behavior

disabled_commands are not inherited

wp-cli.yml

# some comment
disabled_commands:
    - eval-file
    - cache

# '_' is a special value denoting configuration options for this wp-cli.yml
_:
    merge: true
    # Inherit configuration from an arbitrary YAML file
    inherit: prod.yml

prod.yml

disabled_commands:
    - eval

wp cli has-command "eval"; echo "$?"
0
wp cli has-command "eval-file"; echo "$?"
1

Describe what you expect as the correct outcome

I'd expect 1 in both cases
Using merge: true makes no difference

Let us know what environment you are running this on

OS:     Linux 5.14.0-162.23.1.el9_1.x86_64
Shell:  /bin/bash
PHP binary:     /usr/bin/php
PHP version:    7.4.33
WP-CLI root dir:        phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:      phar://wp-cli.phar/vendor
WP_CLI phar path:       /foo
WP-CLI packages dir:    /bar/.wp-cli/packages/
WP-CLI cache dir:       /bar/.wp-cli/cache
WP-CLI global config:
WP-CLI project config:  /foo/wp-cli.yml
WP-CLI version: 2.11.0

</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue with not inheriting disabled_commands Fix disabled_commands not merging on config inheritance Feb 1, 2026
Copilot AI requested a review from swissspidy February 1, 2026 19:38
@codecov
Copy link

codecov bot commented Feb 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions github-actions bot added bug command:cli Related to 'cli' command command:cli-has-command Related to 'cli has-command' command labels Feb 2, 2026
@swissspidy swissspidy requested a review from Copilot February 2, 2026 02:15

This comment was marked as resolved.

@swissspidy swissspidy added this to the 3.0.0 milestone Feb 3, 2026
@swissspidy swissspidy marked this pull request as ready for review February 3, 2026 01:40
@swissspidy swissspidy requested a review from a team as a code owner February 3, 2026 01:40
@swissspidy

This comment was marked as resolved.

gemini-code-assist[bot]

This comment was marked as resolved.

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

Labels

breaking-change bug command:cli Related to 'cli' command command:cli-has-command Related to 'cli has-command' command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

inherit: not inheriting disabled_commands

2 participants