-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Jetpack REST connection: connect site and user #22126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ir is an HTTP status code
…ir is an HTTP status code
…-Android into feature/jetpack-connect-install
Generated by 🚫 Danger |
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr22126-6185c2d | |
Commit | 6185c2d | |
Direct Download | wordpress-prototype-build-pr22126-6185c2d.apk |
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr22126-6185c2d | |
Commit | 6185c2d | |
Direct Download | jetpack-prototype-build-pr22126-6185c2d.apk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements the "connect site" and "connect user" steps in the Jetpack REST connection flow for the WordPress Android app. The changes enable automatic site connection to WordPress.com and user authentication through the Jetpack plugin installation process.
Key changes:
- Added actual implementation for Jetpack plugin installation and site/user connection steps
- Created new helper classes (
JetpackInstaller
,JetpackConnector
,JetpackConnectionHelper
) to handle the connection logic - Updated UI strings and error handling to reflect the new connection flow
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
strings.xml |
Updated step labels and added new error messages for connection failures |
JetpackRestConnectionViewModel.kt |
Implemented actual connection logic replacing placeholder code, added new dependencies and error types |
JetpackRestConnectionScreen.kt |
Updated UI to reflect renamed connection steps and new error types |
JetpackInstaller.kt |
New class implementing Jetpack plugin installation using wordpress-rs API |
JetpackConnector.kt |
New class handling site and user connection to WordPress.com |
JetpackConnectionHelper.kt |
New helper class for initializing API clients with authentication |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...c/main/java/org/wordpress/android/ui/jetpackrestconnection/JetpackRestConnectionViewModel.kt
Outdated
Show resolved
Hide resolved
...c/main/java/org/wordpress/android/ui/jetpackrestconnection/JetpackRestConnectionViewModel.kt
Outdated
Show resolved
Hide resolved
...c/main/java/org/wordpress/android/ui/jetpackrestconnection/JetpackRestConnectionViewModel.kt
Outdated
Show resolved
Hide resolved
…-Android into feature/jetpack-connect-site-and-user Conflicts: WordPress/src/main/java/org/wordpress/android/ui/jetpackrestconnection/JetpackInstaller.kt WordPress/src/main/java/org/wordpress/android/ui/jetpackrestconnection/JetpackRestConnectionScreen.kt WordPress/src/main/java/org/wordpress/android/ui/jetpackrestconnection/JetpackRestConnectionViewModel.kt WordPress/src/main/res/values/strings.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
|
fun initWpApiClient(site: SiteModel): WpApiClient { | ||
requireRestCredentials(site) | ||
return WpApiClient( | ||
wpOrgSiteApiRootUrl = URL(resolveRestApiUrl(site)), | ||
authProvider = createRestAuthProvider(site) | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛏️ I know I have already mentioned this, but what about keeping all the WpApiClient
creations inside the WpApiClientProvider
so the maintenante is clearer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this is already a task on the Linear project. I'll DM you the project link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and works as expected!
just left a minor comment
This PR adds the "connect site" and "connect user" steps to the Jetpack REST connection flow.
To test
Note: The connection flow will then appear stuck on the "Finalize setup" step. This will be addressed in a separate PR.
Screen_recording_20250813_153323.mp4