Add WP.com simple site and Jetpack site routing to WpApiClient#22765
Add WP.com simple site and Jetpack site routing to WpApiClient#22765
Conversation
|
|
|
|
🤖 Build Failure AnalysisThis build has failures. Claude has analyzed them - check the build annotations for details. |
d538543 to
865899d
Compare
f861ada to
6cfa2a2
Compare
|
@jkmassel There are multiple conflicts and CI failures in this PR. Probably best to address that before I do a review. |
|
@nbradbury – sorry, this was supposed to be a draft still! |
bae20e0 to
bfebb4a
Compare
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.
bfebb4a to
e9eba85
Compare
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
Cover isWPComSimpleSite() and the getWpApiRestUrl() proxy URL override introduced in #22765, including the boundary between Jetpack REST sites (routed via WP.com client) and WP.com simple sites (get the proxy URL).
|
@jkmassel This looks and works fine, but Claude found some potential issues. |
I saw this –
I'm aware of this one as well – if These new methods don't really benefit from test coverage, because it'd be a "test that the code does what the code does" situation. The trailing slash thing isn't relevant to this PR because this URL is only used to build the URL resolver. Semi-related, any path building that relies on concatenation instead of a path builder is probably buggy anyway 😅 |


Summary
isWPComSimpleSite()toSiteModeland overridegetWpApiRestUrl()to return thepublic-api.wordpress.comproxy URL for simple (non-Atomic) WP.com sitesisUsingWpComRestApi) through the WP.com API client alongside pure WP.com sitesapiUrlResolverconstructor: UpdatecreateSelfHostedClientto useWpOrgSiteApiUrlResolverinstead of the oldwpOrgSiteApiRootUrlparameterTest plan
WpOrgSiteApiUrlResolver