Add WordPress.com simple site and Jetpack site support to WpApiClient#22765
Open
jkmassel wants to merge 13 commits intojkmassel/gutenbergkit-settings-refactorfrom
Open
Add WordPress.com simple site and Jetpack site support to WpApiClient#22765jkmassel wants to merge 13 commits intojkmassel/gutenbergkit-settings-refactorfrom
jkmassel wants to merge 13 commits intojkmassel/gutenbergkit-settings-refactorfrom
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
These are replaced by the simplified GutenbergKitSettingsBuilder and the new GutenbergEditorPreloader in subsequent commits. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Inline the 18-parameter buildEditorConfiguration into buildPostConfiguration, which now reads site/post fields directly from SiteModel and PostImmutableModel. Also fixes a bug in shouldUsePlugins where a stray `return false` made the method always return false. Tests are updated to construct SiteModel objects instead of passing individual primitives. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the old GutenbergKitConfig builder pattern with a simpler buildEditorConfiguration that calls buildPostConfiguration and customizes locale, cookies, plugins, theme styles, and network logging via toBuilder(). Remove the ProgressBar from the editor layout since GutenbergView manages its own loading visibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Inject EditorSettingsRepository so the builder can query editor settings support when configuring theme styles. Extract buildCachedHosts and buildEditorAssetsEndpoint into named methods. Update GutenbergKitActivity to use the injected instance and remove redundant builder overrides. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Local draft posts have remotePostId defaulting to 0, which was passed directly to GutenbergKit's setPostId(). GBK expects null for unsaved posts. Now check isLocalDraft and pass null instead.
Wrap cursor usage in try/finally in getUseThemeStyles and getUseThirdPartyBlocks so the cursor is always closed, even if deserialization throws. Also fix four tests that were calling buildPostConfiguration as a static method instead of on the injected instance. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove EditorSettingsRepository dependency from GutenbergKitSettingsBuilder (not part of this PR) - Remove GutenbergKitWarmupHelper references from MySiteViewModel and its test - Update GutenbergKitEditorFragment for GutenbergKit v0.15.0 API: use GutenbergView constructor instead of createForEditor, accept EditorConfiguration in newInstance, remove obsolete startWithEditorSettings and EditorConfigurationBuilder usage
Remove EditorSettingsRepository mock and MockitoJUnitRunner since the builder no longer takes constructor parameters. Fix UInt comparison in published post ID test assertion.
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>
Remove the requirement for a non-empty namespace when building the editor assets endpoint URL. Self-hosted sites have an empty namespace but the wpcom/v2/editor-assets endpoint is still valid for them. 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.
Collaborator
Generated by 🚫 Danger |
Contributor
|
|
Contributor
|
|
Contributor
🤖 Build Failure AnalysisThis build has failures. Claude has analyzed them - check the build annotations for details. |
d538543 to
865899d
Compare
f861ada to
6cfa2a2
Compare
Contributor
|
@jkmassel There are multiple conflicts and CI failures in this PR. Probably best to address that before I do a review. |
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.


Summary
PR 2 in the series splitting up the
integrate/gutenberg-preloadingbranch (#22579).createSelfHostedClient: UseWpComDotOrgApiUrlResolverand WP.com bearer auth for simple sites (non-Atomic WP.com sites) instead of application password authisUsingWpComRestApi) through the WP.com API client alongside pure WP.com sitesfetchWpComManifestRoutesandfetchSiteManifestRoutesmethods to discover available REST API routes by fetching the API root indexTest plan
fetchWpComManifestRoutesreturns route paths for a WP.com sitefetchSiteManifestRoutesreturns route paths for a self-hosted site