Allow wp config create to defer DB_NAME/DB_USER initialization via --skip-check#223
Merged
swissspidy merged 3 commits intomainfrom Apr 16, 2026
Merged
Conversation
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>
Copilot
AI
changed the title
[WIP] Add option to defer parameter initialization in wp config create
Allow Apr 15, 2026
wp config create to defer DB_NAME/DB_USER initialization via --skip-check
This comment was marked as resolved.
This comment was marked as resolved.
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>
This comment was marked as resolved.
This comment was marked as resolved.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates wp config create to support a deferred initialization workflow by allowing DB_NAME and/or DB_USER to be omitted when --skip-check is used, while keeping the existing required-parameter validation when connection checks are enabled.
Changes:
- Make
--dbname/--dbuseroptional when--skip-checkis provided (unless SQLite integration detection already bypasses checks). - Update inline command option documentation to reflect the conditional requirement.
- Add/adjust Behat coverage for the new
--skip-checkmissing-parameter success path and the unchanged error path without--skip-check.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/Config_Command.php |
Adjusts option docs and validation logic so dbname/dbuser are only required when DB checks are performed. |
features/config-create.feature |
Adds scenarios for successful config generation with --skip-check and missing dbname/dbuser, and updates the existing required-parameter error scenario. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
wp config createcurrently blocks a deferred “create then set constants” workflow by requiring--dbnameand--dbusereven when connection checks are intentionally skipped. This change makes that path explicit while preserving existing validation when checks are enabled.Behavior change: deferred initialization path
--dbnameand--dbuserare now optional when--skip-checkis used.wp-config.phpis generated with emptyDB_NAME/DB_USERif omitted, enabling follow-upwp config setworkflows.Validation preserved for checked path
--dbname/--dbuserremain in place when--skip-checkis not used (and SQLite drop-in is not active).Command docs updated
--dbnameand--dbusernow reflects: required only when connection checks are performed (or no SQLite drop-in shortcut applies).Acceptance coverage updated
--skip-checkand missing one of--dbname/--dbuser--skip-checkis not providedWarning
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:
api.wordpress.org/usr/bin/curl curl -s REDACTED(dns block)/usr/bin/php /usr/bin/php /home/REDACTED/work/config-command/config-command/vendor/wp-cli/wp-cli/bin/../php/boot-fs.php core download --skip-content --quiet(dns block)/usr/bin/curl curl -s REDACTED git conf�� --local credential.username /home/REDACTED/work/_temp/ghcca-node/node/bin/git(dns block)downloads.wordpress.org/usr/bin/php php vendor/bin/behat --snippets-for=WP_CLI\Tests\Context\FeatureContext --format progress --tags=~@broken&&~@require-object-cache&&~@require-mariadb&&~@require-mysql&&~@require-mysql-or-mariadb&&~@skip-sqlite --strict(dns block)/usr/bin/php php vendor/bin/behat features/config-create.feature --name Missing --dbname or --dbuser rt-size '1280, 720' --output-dir /tmp/playwright-logs --allowed-origins 'localhost;localhost:*;1which(dns block)/usr/bin/php php vendor/bin/behat -vvv features/config-create.feature --name Missing --dbname or --dbuser(dns block)If you need me to access, download, or install something from one of these locations, you can either: