Repository navigation
Keep the WP-CLI commands on a WordPress that ships the Secrets API - #13
Merged
Merged
Conversation
The plugin has required 6.8 since 32e8972, but WordPressCS was still told 6.6, so it would not flag a function deprecated in 6.7 or 6.8.
Core took the API in r64337 and left the WP-CLI commands to the plugin, but the bootstrap went fully dark once core shipped the API, so `wp secret` and `wp network-secret` disappeared on 7.2. The stand-down branch now registers both commands and still loads none of src/ or plugin/. The commands call only the public API and internals core has too, so the same cli/ runs on core's implementation. `wp secret health` loads core's wp-admin/includes/secrets-site-health.php itself, since core loads it only for the Site Health screen. `migrate-legacy` exits 1 with an explanation instead of fataling: its migrator loads only with the plugin's copy, and the prototype is deprecated. A conflict still registers nothing. The admin notice says the plugin now provides only its WP-CLI commands. ADR 0014 records the decision; the README and scope page describe it. The CLI tests now run on a WordPress that ships the API, except the migrate-legacy cases, and a new one checks the refusal there. The mock WP_CLI records add_command() calls so the gate tests can check which branch registers the commands.
The smoke test drives a real wp binary through every subcommand, but CI ran it only on latest, where the plugin uses its own copy of the API. A PHP 8.3 / WP nightly leg now runs it where core ships the API, and smoke.sh detects that case and expects migrate-legacy to refuse there.
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.
Core took the Secrets API in r64337 and left the WP-CLI commands to this plugin. The plugin, though, went fully dark once core shipped the API, so
wp secretandwp network-secretdisappeared on 7.2. This keeps them, running on core's implementation. See ADR 0014.What changes on a WordPress that ships the API
wp_secrets_api_bootstrap()now registers both commands under WP-CLI, and still loads none ofsrc/orplugin/. Registration moved intowp_secrets_api_register_cli(), which both branches call.cli/calls only the public API and internals core has as well:_wp_secrets_get_key_manager(),_wp_secrets_get_provider(),_wp_secrets_get_store(), andWP_Secrets_Config_Key_Provider. So it runs unchanged on core.wp secret healthloads core'swp-admin/includes/secrets-site-health.phpitself. Core loads that file only for the Site Health screen, so its test functions don't exist under WP-CLI otherwise.migrate-legacyexits 1 with "not available on a WordPress that ships the Secrets API. Migrate legacy secrets before upgrading." It used to fatal on the unloaded migrator.wp_get_secret(), the commands would run on an unknown credential store.Also:
phpcs.xml.diststill told WordPressCS the minimum was 6.6, a leftover from #12. It's now 6.8.Tests
migrate-legacycases skip there, and a new test checks the refusal.WP_CLInow recordsadd_command(). Gate tests check that the core branch registers both commands and that a conflict registers none.wpsmoke test only onlatest. A PHP 8.3 / WP nightly leg now covers the core case.smoke.shdetects core's API and expectsmigrate-legacyto refuse there. The existing smoke check names are unchanged.Testing
latest: 146/146 pass.7.2-beta1-64701: 147/147 pass, with detection reporting core's implementation.main's plugin against nightly fails at the first command,'secret' is not a registered wp command.make lint compat analyse reference-checkall pass.