Skip to content

Updating API RS library #21844

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

Merged
merged 3 commits into from
Apr 30, 2025
Merged

Updating API RS library #21844

merged 3 commits into from
Apr 30, 2025

Conversation

adalpari
Copy link
Contributor

@adalpari adalpari commented Apr 30, 2025

Description

This PR is updating the WordPress rs library to the last alpha

Testing instructions

Run the app and smoke test it. Specially self-hosted login

Screen_recording_20250430_124136.mp4

@dangermattic
Copy link
Collaborator

1 Warning
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

Project dependencies changes

list
+ New Dependencies
com.squareup.okhttp3:okhttp-tls:4.12.0

! Upgraded Dependencies
net.java.dev.jna:jna:5.17.0, (changed from 5.15.0)
rs.wordpress.api:android:alpha-20250411, (changed from trunk-50f703a7f677084157d02f05d4d477d7eaf960b1)
rs.wordpress.api:kotlin:alpha-20250411, (changed from trunk-50f703a7f677084157d02f05d4d477d7eaf960b1)
tree
 +--- project :libs:fluxc
-|    \--- net.java.dev.jna:jna:5.15.0
+|    \--- net.java.dev.jna:jna:5.15.0 -> 5.17.0
-\--- rs.wordpress.api:android:trunk-50f703a7f677084157d02f05d4d477d7eaf960b1
-     +--- com.squareup.okhttp3:okhttp:4.12.0 (*)
-     +--- net.java.dev.jna:jna:5.14.0 -> 5.15.0
-     +--- rs.wordpress.api:kotlin:trunk-50f703a7f677084157d02f05d4d477d7eaf960b1
-     |    +--- com.squareup.okhttp3:okhttp:4.12.0 (*)
-     |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1 -> 1.10.2 (*)
-     |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.24 -> 2.1.10 (*)
-     \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.24 -> 2.1.10 (*)
+\--- rs.wordpress.api:android:alpha-20250411
+     +--- com.squareup.okhttp3:okhttp:4.12.0 (*)
+     +--- com.squareup.okhttp3:okhttp-tls:4.12.0
+     |    +--- com.squareup.okhttp3:okhttp:4.12.0 (*)
+     |    +--- com.squareup.okio:okio:3.6.0 -> 3.9.0 (*)
+     |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21 -> 1.9.10 (*)
+     +--- net.java.dev.jna:jna:5.17.0
+     +--- rs.wordpress.api:kotlin:alpha-20250411
+     |    +--- com.squareup.okhttp3:okhttp:4.12.0 (*)
+     |    +--- com.squareup.okhttp3:okhttp-tls:4.12.0 (*)
+     |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0 -> 1.10.2 (*)
+     |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.24 -> 2.1.10 (*)
+     \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.24 -> 2.1.10 (*)

@wpmobilebot
Copy link
Contributor

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr21844-d205e74
Commitd205e74
Direct Downloadwordpress-prototype-build-pr21844-d205e74.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr21844-d205e74
Commitd205e74
Direct Downloadjetpack-prototype-build-pr21844-d205e74.apk
Note: Google Login is not supported on these builds.

Copy link

codecov bot commented Apr 30, 2025

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 39.39%. Comparing base (3dcd41b) to head (d205e74).
Report is 1 commits behind head on trunk.

Files with missing lines Patch % Lines
...rg/wordpress/android/ui/accounts/LoginViewModel.kt 0.00% 1 Missing ⚠️
...ordpress/android/ui/selfhostedusers/SampleUsers.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #21844   +/-   ##
=======================================
  Coverage   39.39%   39.39%           
=======================================
  Files        2132     2132           
  Lines       99994    99994           
  Branches    15398    15398           
=======================================
  Hits        39397    39397           
  Misses      57115    57115           
  Partials     3482     3482           

☔ 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.

@adalpari adalpari requested a review from Copilot April 30, 2025 12:18
Copy link
Contributor

@Copilot Copilot AI left a 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 updates the WordPress rs library to the latest alpha version and adjusts dependent code accordingly.

  • Updated the WordPress rs library version in gradle/libs.versions.toml.
  • Changed the type conversion in SampleUsers.kt to convert sampleUserList.size to Long.
  • Modified LoginViewModel.kt to remove the getOrThrow() call in accordance with the new API behavior.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
gradle/libs.versions.toml Updated WordPress rs library version to alpha-20250411.
WordPress/src/main/java/org/wordpress/android/ui/selfhostedusers/SampleUsers.kt Converted size from Int to Long for the id field.
WordPress/src/main/java/org/wordpress/android/ui/accounts/LoginViewModel.kt Removed getOrThrow() to adjust to updated API discovery behavior.
Comments suppressed due to low confidence (1)

WordPress/src/main/java/org/wordpress/android/ui/accounts/LoginViewModel.kt:39

  • Removing getOrThrow() might bypass necessary error handling previously provided by the Result API. Please ensure that error scenarios from apiDiscovery are handled safely under the new API contract.
urlDiscovery.apiDetails.findApplicationPasswordsAuthenticationUrl()

@nbradbury nbradbury self-assigned this Apr 30, 2025
Copy link
Contributor

@nbradbury nbradbury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good and self-hosted login worked as expected :shipit:

@adalpari adalpari merged commit 7adeb0a into trunk Apr 30, 2025
29 checks passed
@adalpari adalpari deleted the feature/rest-api-login branch April 30, 2025 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants