From 2ea9a9326af15df01422b65d196fed924edab1b7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 15:09:20 +0000 Subject: [PATCH 1/3] Initial plan From 20ba5958fbbf78a1dba99f585db7b7f66b0de85a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 15:15:53 +0000 Subject: [PATCH 2/3] Allow wp config create to defer dbname/dbuser with --skip-check Agent-Logs-Url: https://github.com/wp-cli/config-command/sessions/bb9bee86-eafb-4f5a-b29a-840a29bdcd8c Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com> --- features/config-create.feature | 34 ++++++++++++++++++++++++++++++---- src/Config_Command.php | 8 +++++--- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/features/config-create.feature b/features/config-create.feature index 9f13c192..d2e795f6 100644 --- a/features/config-create.feature +++ b/features/config-create.feature @@ -163,12 +163,38 @@ Feature: Create a wp-config file Error: Database connection error """ - @require-mysql - Scenario: Missing --dbname or --dbuser without SQLite integration + Scenario: Missing --dbname or --dbuser with --skip-check + Given an empty directory + And WP files + + When I run `wp config create --skip-check --dbuser=someuser` + Then the wp-config.php file should contain: + """ + define( 'DB_NAME', '' ); + """ + And the wp-config.php file should contain: + """ + define( 'DB_USER', 'someuser' ); + """ + + Given an empty directory + And WP files + + When I run `wp config create --skip-check --dbname=somedb` + Then the wp-config.php file should contain: + """ + define( 'DB_NAME', 'somedb' ); + """ + And the wp-config.php file should contain: + """ + define( 'DB_USER', '' ); + """ + + Scenario: Missing --dbname or --dbuser without --skip-check Given an empty directory And WP files - When I try `wp config create --skip-check --dbuser=someuser` + When I try `wp config create --dbuser=someuser` Then the return code should be 1 And STDERR should contain: """ @@ -176,7 +202,7 @@ Feature: Create a wp-config file missing --dbname parameter (Set the database name.) """ - When I try `wp config create --skip-check --dbname=somedb` + When I try `wp config create --dbname=somedb` Then the return code should be 1 And STDERR should contain: """ diff --git a/src/Config_Command.php b/src/Config_Command.php index 4bf502b2..02ddde8e 100644 --- a/src/Config_Command.php +++ b/src/Config_Command.php @@ -121,10 +121,10 @@ private static function get_initial_locale() { * ## OPTIONS * * [--dbname=] - * : Set the database name. Required unless the SQLite integration drop-in is detected. + * : Set the database name. Required unless `--skip-check` is used or the SQLite integration drop-in is detected. * * [--dbuser=] - * : Set the database user. Required unless the SQLite integration drop-in is detected. + * : Set the database user. Required unless `--skip-check` is used or the SQLite integration drop-in is detected. * * [--dbpass=] * : Set the database user password. @@ -209,6 +209,8 @@ public function create( $_, $assoc_args ) { } $defaults = [ + 'dbname' => '', + 'dbuser' => '', 'dbhost' => 'localhost', 'dbpass' => '', 'dbprefix' => 'wp_', @@ -222,7 +224,7 @@ public function create( $_, $assoc_args ) { $is_sqlite = self::is_sqlite_integration_active(); - if ( ! $is_sqlite ) { + if ( ! $is_sqlite && ! Utils\get_flag_value( $assoc_args, 'skip-check' ) ) { $errors = []; if ( empty( $assoc_args['dbname'] ) ) { $errors[] = 'missing --dbname parameter (Set the database name.)'; From f73ba418d191022684da2473708c3980392526ff Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 16:49:44 +0000 Subject: [PATCH 3/3] Fix flaky config-create scenarios across matrix Agent-Logs-Url: https://github.com/wp-cli/config-command/sessions/a9cfed86-9ca4-4148-8ac2-ee184f7180a2 Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com> --- features/config-create.feature | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/features/config-create.feature b/features/config-create.feature index d2e795f6..36dd4a70 100644 --- a/features/config-create.feature +++ b/features/config-create.feature @@ -163,7 +163,7 @@ Feature: Create a wp-config file Error: Database connection error """ - Scenario: Missing --dbname or --dbuser with --skip-check + Scenario: Missing --dbname with --skip-check Given an empty directory And WP files @@ -177,6 +177,7 @@ Feature: Create a wp-config file define( 'DB_USER', 'someuser' ); """ + Scenario: Missing --dbuser with --skip-check Given an empty directory And WP files @@ -190,6 +191,7 @@ Feature: Create a wp-config file define( 'DB_USER', '' ); """ + @require-mysql Scenario: Missing --dbname or --dbuser without --skip-check Given an empty directory And WP files