-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CMM-808 port categories and tags to the new generic wordpress-rs API #22252
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
CMM-808 port categories and tags to the new generic wordpress-rs API #22252
Conversation
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 updates the taxonomy API implementation to use the new generic wordpress-rs API instead of the previous category and tag-specific endpoints. The main purpose is to modernize the codebase by consolidating separate category and tag handling into a unified terms API approach.
- Replaces separate category and tag API classes with unified term endpoints using
TermEndpointType
- Adds
isHierarchical
field toTermModel
to distinguish between hierarchical (categories) and flat (tags) taxonomies - Updates all related test files and usage sites to accommodate the new API structure
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
TaxonomyRsApiRestClient.kt |
Complete refactor to use unified terms API instead of separate category/tag endpoints |
TermModel.java |
Added isHierarchical boolean field and updated constructor |
WellSqlConfig.kt |
Database migration to add IS_HIERARCHICAL column to TermModel |
TaxonomyRsApiRestClientTest.kt |
Updated tests to use new unified API and added isHierarchical field |
TaxonomyTestUtils.java |
Updated test helper to include isHierarchical parameter |
Various other files | Updated to accommodate new API signature and field additions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...main/java/org/wordpress/android/fluxc/network/rest/wpapi/taxonomy/TaxonomyRsApiRestClient.kt
Outdated
Show resolved
Hide resolved
libs/fluxc/src/main/java/org/wordpress/android/fluxc/persistence/WellSqlConfig.kt
Show resolved
Hide resolved
Generated by 🚫 Danger |
Project dependencies changeslist! Upgraded Dependencies
net.java.dev.jna:jna:5.18.0, (changed from 5.17.0)
rs.wordpress.api:android:trunk-d0c9eebab77e8701810077ac1fba7d39ef8d121f, (changed from trunk-f4e2450ca5545a4909cb08273f37a7f694244921)
rs.wordpress.api:kotlin:trunk-d0c9eebab77e8701810077ac1fba7d39ef8d121f, (changed from trunk-f4e2450ca5545a4909cb08273f37a7f694244921) tree +--- project :libs:fluxc
-| \--- rs.wordpress.api:android:trunk-f4e2450ca5545a4909cb08273f37a7f694244921
-| +--- 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.24 (*)
-| +--- net.java.dev.jna:jna:5.17.0
-| +--- rs.wordpress.api:kotlin:trunk-f4e2450ca5545a4909cb08273f37a7f694244921
-| | +--- com.squareup.okhttp3:okhttp:4.12.0 (*)
-| | +--- com.squareup.okhttp3:okhttp-tls:4.12.0 (*)
-| | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2 (*)
-| | \--- org.jetbrains.kotlin:kotlin-stdlib:2.1.21 -> 2.2.10 (*)
-| \--- org.jetbrains.kotlin:kotlin-stdlib:2.1.21 -> 2.2.10 (*)
+| \--- rs.wordpress.api:android:trunk-d0c9eebab77e8701810077ac1fba7d39ef8d121f
+| +--- 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.24 (*)
+| +--- net.java.dev.jna:jna:5.18.0
+| +--- rs.wordpress.api:kotlin:trunk-d0c9eebab77e8701810077ac1fba7d39ef8d121f
+| | +--- com.squareup.okhttp3:okhttp:4.12.0 (*)
+| | +--- com.squareup.okhttp3:okhttp-tls:4.12.0 (*)
+| | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2 (*)
+| | \--- org.jetbrains.kotlin:kotlin-stdlib:2.1.21 -> 2.2.10 (*)
+| \--- org.jetbrains.kotlin:kotlin-stdlib:2.1.21 -> 2.2.10 (*)
-+--- rs.wordpress.api:android:trunk-f4e2450ca5545a4909cb08273f37a7f694244921 (*)
++--- rs.wordpress.api:android:trunk-d0c9eebab77e8701810077ac1fba7d39ef8d121f (*)
\--- com.automattic:encryptedlogging:1.1.0
- \--- net.java.dev.jna:jna:5.17.0
+ \--- net.java.dev.jna:jna:5.17.0 -> 5.18.0 |
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr22252-03b8a91 | |
Commit | 03b8a91 | |
Direct Download | wordpress-prototype-build-pr22252-03b8a91.apk |
|
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr22252-03b8a91 | |
Commit | 03b8a91 | |
Direct Download | jetpack-prototype-build-pr22252-03b8a91.apk |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #22252 +/- ##
==========================================
- Coverage 39.98% 39.91% -0.07%
==========================================
Files 2165 2165
Lines 102627 102511 -116
Branches 14766 14771 +5
==========================================
- Hits 41034 40922 -112
+ Misses 58130 58122 -8
- Partials 3463 3467 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Looks good. 🧹 Changes tested well for me.
I noted one issue, but it also occurs in the production release. Attempting to modify a term without a network connection causes the app to enter an infinite "Saving" state. Ideally, we handle the failed request with an error message and potentially retry when the network connection returns. Currently, the app remains in the saving state even after regaining a network connection. The user is unable to exit the screen and must quit the app.
Screen recording
Screen_Recording_20251003_074824_Jetpack.Pre-Alpha.mp4
Thank you for the heads up. I experimented something similar, but I think it's better to work on it as a separate bug since it's not related to the migration. |
Description
This PR updates the taxonomy CRUD implementation to use the new generic WordPress-RS API instead of the previous category and tag-specific endpoints. So, from now on, all terms will be used the same way by just specifying the taxonomy name.
Testing instructions
Screen.Recording.2025-10-01.at.14.41.07.mov
Screen.Recording.2025-10-01.at.14.40.33.mov