Skip to content

Add WP.com simple site and Jetpack site routing to WpApiClient#22765

Draft
jkmassel wants to merge 2 commits intotrunkfrom
jkmassel/wpapiclient-wpcom-support
Draft

Add WP.com simple site and Jetpack site routing to WpApiClient#22765
jkmassel wants to merge 2 commits intotrunkfrom
jkmassel/wpapiclient-wpcom-support

Conversation

@jkmassel
Copy link
Copy Markdown
Contributor

@jkmassel jkmassel commented Apr 3, 2026

Summary

  • WP.com simple site URL routing: Add isWPComSimpleSite() to SiteModel and override getWpApiRestUrl() to return the public-api.wordpress.com proxy URL for simple (non-Atomic) WP.com sites
  • Jetpack site routing: Route sites using the WP.com REST API (isUsingWpComRestApi) through the WP.com API client alongside pure WP.com sites
  • Migrate to new apiUrlResolver constructor: Update createSelfHostedClient to use WpOrgSiteApiUrlResolver instead of the old wpOrgSiteApiRootUrl parameter

Test plan

  • Verify WP.com simple sites get the correct public-api proxy URL from getWpApiRestUrl()
  • Verify Jetpack-connected sites route through the WP.com API client
  • Verify self-hosted sites continue to use application password auth and WpOrgSiteApiUrlResolver

@dangermattic
Copy link
Copy Markdown
Collaborator

dangermattic commented Apr 3, 2026

1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Apr 3, 2026

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
Build TypeDebug
Versionpr22765-e9eba85
Build Number1488
Application IDcom.jetpack.android.prealpha
Commite9eba85
Installation URL4n08vltctk1a0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Apr 3, 2026

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
Build TypeDebug
Versionpr22765-e9eba85
Build Number1488
Application IDorg.wordpress.android.prealpha
Commite9eba85
Installation URL00j66168pb6s0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Apr 3, 2026

🤖 Build Failure Analysis

This build has failures. Claude has analyzed them - check the build annotations for details.

@jkmassel jkmassel force-pushed the jkmassel/gutenbergkit-settings-refactor branch from d538543 to 865899d Compare April 3, 2026 21:25
@jkmassel jkmassel requested a review from a team as a code owner April 3, 2026 21:25
@jkmassel jkmassel requested review from nbradbury and removed request for a team April 3, 2026 21:25
@jkmassel jkmassel force-pushed the jkmassel/gutenbergkit-settings-refactor branch 4 times, most recently from f861ada to 6cfa2a2 Compare April 4, 2026 03:47
@nbradbury
Copy link
Copy Markdown
Contributor

@jkmassel There are multiple conflicts and CI failures in this PR. Probably best to address that before I do a review.

@jkmassel jkmassel marked this pull request as draft April 6, 2026 04:27
@jkmassel
Copy link
Copy Markdown
Contributor Author

jkmassel commented Apr 6, 2026

@nbradbury – sorry, this was supposed to be a draft still!

Base automatically changed from jkmassel/gutenbergkit-settings-refactor to trunk April 9, 2026 19:17
@jkmassel jkmassel force-pushed the jkmassel/wpapiclient-wpcom-support branch from bae20e0 to bfebb4a Compare April 9, 2026 19:47
jkmassel and others added 2 commits April 9, 2026 14:24
Add `isWPComSimpleSite()` to SiteModel and use it to route WP.com
simple sites through the public-api.wordpress.com proxy with bearer
token authentication. This enables the Rust WP API client to make
authenticated requests for WPCom sites that don't use application
passwords.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Route sites using WP.com REST API (isUsingWpComRestApi) through the
WP.com API client, alongside pure WP.com sites. This enables Jetpack-
connected sites to use the correct authentication and URL resolution.

Add manifest route fetching methods (fetchWpComManifestRoutes,
fetchSiteManifestRoutes) that retrieve the API root index to
discover available REST routes for a site.
@jkmassel jkmassel force-pushed the jkmassel/wpapiclient-wpcom-support branch from bfebb4a to e9eba85 Compare April 9, 2026 20:51
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 37.50000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.34%. Comparing base (7b391e8) to head (e9eba85).

Files with missing lines Patch % Lines
...fluxc/network/rest/wpapi/rs/WpApiClientProvider.kt 0.00% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #22765   +/-   ##
=======================================
  Coverage   37.34%   37.34%           
=======================================
  Files        2327     2327           
  Lines      124639   124645    +6     
  Branches    16892    16894    +2     
=======================================
+ Hits        46551    46554    +3     
- Misses      74351    74354    +3     
  Partials     3737     3737           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jkmassel jkmassel changed the title Add WordPress.com simple site and Jetpack site support to WpApiClient Add WP.com simple site and Jetpack site routing to WpApiClient Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants