Gate taxonomies REST API migration behind a remote feature flag#23029
Merged
adalpari merged 5 commits intoJun 24, 2026
Conversation
…ion flag The new wp-rs taxonomy client is now used for self-hosted sites only when the categories_rest_api_migration remote feature flag is enabled, so the migration can be rolled out or reverted from the server. When disabled, self-hosted sites fall back to the legacy XML-RPC client. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
Generated by 🚫 Danger |
Contributor
|
|
Contributor
|
|
Contributor
🤖 Build Failure AnalysisThis build has failures. Claude has analyzed them - check the build annotations for details. |
…api_migration The flag gates the whole self-hosted taxonomy path in TaxonomyStore (categories and tags), so the taxonomies_ prefix is more accurate. Renames the flag string, BuildConfig field, both config classes, the constant, the DI provider, and all references. Also drops an unused Mockito import flagged by checkstyle in TaxonomyStoreRoutingTest. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/26.9 #23029 +/- ##
================================================
+ Coverage 37.56% 37.57% +0.01%
================================================
Files 2325 2326 +1
Lines 125324 125332 +8
Branches 17187 17189 +2
================================================
+ Hits 47073 47094 +21
+ Misses 74433 74414 -19
- Partials 3818 3824 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.


Description
The post categories taxonomy was migrated from XML-RPC to the REST API. For self-hosted sites with an Application Password,
TaxonomyStoreroutes to the new wp-rs REST client (TaxonomyRsApiRestClient); previously this was gated only onsite.isUsingSelfHostedRestApi().This PR adds a new server-side remote feature flag,
taxonomies_rest_api_migration, so the new self-hosted path can be rolled out (or reverted) remotely. The wp-rs path is now used only when both the Application-Password check passes and the flag is enabled. When the flag is off, self-hosted sites fall back to the exact pre-migration behavior (XML-RPC).Note: this flag gates the whole self-hosted taxonomy path in
TaxonomyStore, which covers both categories and tags — hence thetaxonomies_prefix.Changes:
taxonomies_rest_api_migrationfeature flag (TaxonomiesRestApiMigrationFeatureConfig, default off), wired via a small fluxc-sideTaxonomiesRestApiMigrationConfiginterface that the app implements inAppConfigModule(same app→fluxc bridge pattern used forUserAgent/AppSecrets, since fluxc can't depend on the app module).TaxonomyStorenow gates all self-hosted wp-rs routing through a singleshouldUseTaxonomyRsApiRestClient(site)helper:fetchTerms,pushTerm, and the response-already-contains-term branch ofhandlePushTermCompleted(so an off-flag push correctly takes the XML-RPC follow-up-fetch path).deleteTermis also migrated to the wp-rs client under the same flag, closing a prior gap where self-hosted deletes always went to XML-RPC.Note on the singular
fetchTermpath: it is intentionally left ungated. TheFETCH_TERMaction (which routes to the single-termfetchTermhandler) has no dispatchers anywhere in the codebase — a repo-wide search fornewFetchTermActionreturns zero callers — so it was never migrated to the wp-rs client and is unreachable in production. The only reachable self-hosted taxonomy operations arefetchTerms(list),pushTerm, anddeleteTerm, all of which this PR gates. (ThemTaxonomyXMLRPCClient.fetchTerm(...)call insidehandlePushTermCompletedis a direct call on the XML-RPC follow-up branch, not the gated path, so it stays correct by construction.)Testing instructions
Routing logic is covered by unit tests in
TaxonomyStoreRoutingTest(flag on → wp-rs client, flag off → XML-RPC, for fetch/push/delete; plus wp.com unaffected). Run them with:./gradlew :libs:fluxc:testDebugUnitTest --tests "org.wordpress.android.fluxc.taxonomy.TaxonomyStoreRoutingTest"Manual verification on a self-hosted (Application Password) site:
You can turn ON(OFF the FF by going to Me -> Debug Settings
Flag OFF (default):
AppLog.T.APIlogs that XML-RPC endpoints are used and create/edit still resolves the slugFlag ON (enable
taxonomies_rest_api_migrationremotely or via a debug override):3. Repeat fetch / create / edit / delete of categories.
WordPress.com / Jetpack sites:
4. Manage categories on a WP.com site with the flag both on and off.