-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Nullability Annotations to Java Classes] Use Updated and Null Proof TermModel
Class (breaking
)
#19158
[Nullability Annotations to Java Classes] Use Updated and Null Proof TermModel
Class (breaking
)
#19158
Conversation
This 'FluxC' PR hash updates the library to that branch version where the 'TermModel' is updated to its new null proof version. FluxC PR: https://github.com/wordpress-mobile/ WordPress-FluxC-Android/pull/2851 This step is required in order to check that these 'FluxC' related changes work as expected for WPAndroid.
Warning: "Type mismatch. Required: String Found: String?"
Compile Warnings: - "Unnecessary safe call on a non-null receiver of type TermModel" - "Condition 'event.term.name == null' is always 'false'" ------------------------------------------------------------------------ As per the removed comment, and although it specifies that sometimes the API will return a success response with a null name, which then will be treated as an error, because without a name, there is no category, after some testing, it has been verified that this is not needed anymore. A '409 duplicate' error is returned instead, that is, instead of a valid response but with a 'null' name, which the deleted code was guarding against. This previous 'term.name == null' change is related to this JP/WPAndroid #13256 PR below: #13256 However, as per this newly merge FluxC #2826 PR below, the 'TermWPComRestResponse' response class and its 'name' field was marked as '@nonnull'. wordpress-mobile/WordPress-FluxC-Android#2826 PS: If and whenever the backend starts sending a 'term.name' as 'nullable', then this need to be addressed on the backend side, that is, instead of making 'term.name' a nullable field on the FluxC side and start guarding against such occurrences everywhere.
Compile Warnings: - Kotlin: "'constructor TermModel()' is deprecated. Deprecated in Java" - Java: "'TermModel()' is deprecated"
Compile Warnings: "'constructor TermModel()' is deprecated. Deprecated in Java"
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr19158-88618fa | |
Commit | 88618fa | |
Direct Download | jetpack-prototype-build-pr19158-88618fa.apk |
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr19158-88618fa | |
Commit | 88618fa | |
Direct Download | wordpress-prototype-build-pr19158-88618fa.apk |
… into analysis/use-updated-and-null-proff-term-model-class # Conflicts: # build.gradle
This 'FluxC' PR hash updates the library to that branch version where the 'TermModel' is updated to its new null proof version. FluxC PR: https://github.com/wordpress-mobile/ WordPress-FluxC-Android/pull/2851 This step is required in order to check that these 'FluxC' related changes work as expected for WPAndroid. ------------------------------------------------------------------------ FYI: This change is an addition to 39b6fb7. This change is necessary in order to overcome and resolve new merge conflicts.
👋 @mkevins I've now unassigned you from this and assigned @AjeshRPai instead. It seems that you might be busy atm and I don't want to hold this PR any longer. 🙏 |
… into analysis/use-updated-and-null-proff-term-model-class # Conflicts: # build.gradle
This 'FluxC' PR hash updates the library to that branch version where the 'TermModel' is updated to its new null proof version. FluxC PR: https://github.com/wordpress-mobile/ WordPress-FluxC-Android/pull/2851 This step is required in order to check that these 'FluxC' related changes work as expected for WPAndroid. ------------------------------------------------------------------------ FYI: This change is an addition to 621e5b0. This change is necessary in order to overcome and resolve new merge conflicts.
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.
Hey @ParaskP7
Tested the changes in this PR with the companion WP PR. Everything looks good to me
👋 @AjeshRPai and thank you so much for reviewing and testing this, you rock! 🙇 ❤️ 🚀 |
… into analysis/use-updated-and-null-proff-term-model-class
This 'FluxC' hash updates the library to that 'trunk' version where the 'TermModel' is updated to its new null proof version. Related FluxC PR: https://github.com/wordpress-mobile/ WordPress-FluxC-Android/pull/2851
Found 1 violations: The PR caused the following dependency changes:-+--- org.wordpress:fluxc:{strictly 2.48.0} -> 2.48.0
-| +--- org.wordpress:wellsql:2.0.0
-| | +--- androidx.annotation:annotation:1.2.0 -> 1.6.0 (*)
-| | \--- org.wordpress.wellsql:wellsql-annotations:2.0.0
-| +--- org.wordpress.fluxc:fluxc-annotations:2.48.0
-| +--- org.greenrobot:eventbus:3.3.1
-| | \--- org.greenrobot:eventbus-java:3.3.1
-| +--- com.squareup.okhttp3:okhttp:4.9.0 -> 4.10.0 (*)
-| +--- com.android.volley:volley:1.1.1 -> 1.2.1
-| +--- androidx.paging:paging-runtime:2.1.2
-| | +--- androidx.paging:paging-common:2.1.2
-| | | +--- androidx.annotation:annotation:1.0.0 -> 1.6.0 (*)
-| | | \--- androidx.arch.core:core-common:2.0.0 -> 2.2.0 (*)
-| | +--- androidx.arch.core:core-runtime:2.0.0 -> 2.2.0 (*)
-| | +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.6.2 (*)
-| | +--- androidx.lifecycle:lifecycle-livedata:2.0.0 -> 2.6.2 (*)
-| | \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.3.0 (*)
-| +--- com.goterl:lazysodium-android:5.0.2
-| +--- net.java.dev.jna:jna:5.5.0
-| +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20 -> 1.8.21 (*)
-| +--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.6.20 -> 1.8.21 (*)
-| +--- androidx.appcompat:appcompat:1.0.2 -> 1.6.1 (*)
-| +--- androidx.recyclerview:recyclerview:1.0.0 -> 1.3.0 (*)
-| +--- androidx.exifinterface:exifinterface:1.0.0 -> 1.3.6 (*)
-| +--- androidx.security:security-crypto:1.0.0
-| | +--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
-| | \--- com.google.crypto.tink:tink-android:1.5.0
-| +--- com.squareup.okhttp3:okhttp-urlconnection:4.9.0 -> 4.9.2 (*)
-| +--- com.google.code.gson:gson:2.8.5 -> 2.10.1
-| +--- org.apache.commons:commons-text:1.10.0
-| | \--- org.apache.commons:commons-lang3:3.12.0
-| +--- androidx.room:room-runtime:2.4.2 -> 2.5.0
-| | +--- androidx.annotation:annotation-experimental:1.1.0 -> 1.3.0 (*)
-| | +--- androidx.arch.core:core-runtime:2.0.1 -> 2.2.0 (*)
-| | +--- androidx.room:room-common:2.5.0
-| | | +--- androidx.annotation:annotation:1.3.0 -> 1.6.0 (*)
-| | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20 -> 1.8.21 (*)
-| | +--- androidx.sqlite:sqlite:2.3.0
-| | | +--- androidx.annotation:annotation:1.0.0 -> 1.6.0 (*)
-| | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.7.20 -> 1.8.21 (*)
-| | \--- androidx.sqlite:sqlite-framework:2.3.0
-| | +--- androidx.annotation:annotation:1.2.0 -> 1.6.0 (*)
-| | +--- androidx.sqlite:sqlite:2.3.0 (*)
-| | \--- org.jetbrains.kotlin:kotlin-stdlib:1.7.20 -> 1.8.21 (*)
-| +--- androidx.room:room-ktx:2.4.2
-| | +--- androidx.room:room-common:2.4.2 -> 2.5.0 (*)
-| | +--- androidx.room:room-runtime:2.4.2 -> 2.5.0 (*)
-| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.6.10 -> 1.8.21 (*)
-| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 -> 1.7.3 (*)
-| +--- com.google.dagger:dagger:2.42 -> 2.46.1
-| | \--- javax.inject:javax.inject:1
-| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.7.3 (*)
-| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.7.3 (*)
++--- org.wordpress:fluxc:{strictly trunk-55122d0f327b24441003653dcfe7d3cd03bc7972} -> trunk-55122d0f327b24441003653dcfe7d3cd03bc7972
+| +--- org.wordpress:wellsql:2.0.0
+| | +--- androidx.annotation:annotation:1.2.0 -> 1.6.0 (*)
+| | \--- org.wordpress.wellsql:wellsql-annotations:2.0.0
+| +--- org.wordpress.fluxc:fluxc-annotations:trunk-55122d0f327b24441003653dcfe7d3cd03bc7972
+| +--- org.greenrobot:eventbus:3.3.1
+| | \--- org.greenrobot:eventbus-java:3.3.1
+| +--- com.squareup.okhttp3:okhttp:4.9.0 -> 4.10.0 (*)
+| +--- com.android.volley:volley:1.1.1 -> 1.2.1
+| +--- androidx.paging:paging-runtime:2.1.2
+| | +--- androidx.paging:paging-common:2.1.2
+| | | +--- androidx.annotation:annotation:1.0.0 -> 1.6.0 (*)
+| | | \--- androidx.arch.core:core-common:2.0.0 -> 2.2.0 (*)
+| | +--- androidx.arch.core:core-runtime:2.0.0 -> 2.2.0 (*)
+| | +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.6.2 (*)
+| | +--- androidx.lifecycle:lifecycle-livedata:2.0.0 -> 2.6.2 (*)
+| | \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.3.0 (*)
+| +--- com.goterl:lazysodium-android:5.0.2
+| +--- net.java.dev.jna:jna:5.5.0
+| +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20 -> 1.8.21 (*)
+| +--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.6.20 -> 1.8.21 (*)
+| +--- androidx.appcompat:appcompat:1.0.2 -> 1.6.1 (*)
+| +--- androidx.recyclerview:recyclerview:1.0.0 -> 1.3.0 (*)
+| +--- androidx.exifinterface:exifinterface:1.0.0 -> 1.3.6 (*)
+| +--- androidx.security:security-crypto:1.0.0
+| | +--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
+| | \--- com.google.crypto.tink:tink-android:1.5.0
+| +--- com.squareup.okhttp3:okhttp-urlconnection:4.9.0 -> 4.9.2 (*)
+| +--- com.google.code.gson:gson:2.8.5 -> 2.10.1
+| +--- org.apache.commons:commons-text:1.10.0
+| | \--- org.apache.commons:commons-lang3:3.12.0
+| +--- androidx.room:room-runtime:2.4.2 -> 2.5.0
+| | +--- androidx.annotation:annotation-experimental:1.1.0 -> 1.3.0 (*)
+| | +--- androidx.arch.core:core-runtime:2.0.1 -> 2.2.0 (*)
+| | +--- androidx.room:room-common:2.5.0
+| | | +--- androidx.annotation:annotation:1.3.0 -> 1.6.0 (*)
+| | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20 -> 1.8.21 (*)
+| | +--- androidx.sqlite:sqlite:2.3.0
+| | | +--- androidx.annotation:annotation:1.0.0 -> 1.6.0 (*)
+| | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.7.20 -> 1.8.21 (*)
+| | \--- androidx.sqlite:sqlite-framework:2.3.0
+| | +--- androidx.annotation:annotation:1.2.0 -> 1.6.0 (*)
+| | +--- androidx.sqlite:sqlite:2.3.0 (*)
+| | \--- org.jetbrains.kotlin:kotlin-stdlib:1.7.20 -> 1.8.21 (*)
+| +--- androidx.room:room-ktx:2.4.2
+| | +--- androidx.room:room-common:2.4.2 -> 2.5.0 (*)
+| | +--- androidx.room:room-runtime:2.4.2 -> 2.5.0 (*)
+| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.6.10 -> 1.8.21 (*)
+| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 -> 1.7.3 (*)
+| +--- com.google.dagger:dagger:2.42 -> 2.46.1
+| | \--- javax.inject:javax.inject:1
+| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.7.3 (*)
+| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.7.3 (*)
\--- org.wordpress:login:1.6.0
- \--- org.wordpress:fluxc:2.21.0 -> 2.48.0 (*)
+ \--- org.wordpress:fluxc:2.21.0 -> trunk-55122d0f327b24441003653dcfe7d3cd03bc7972 (*)
Please review and act accordingly
|
Parent FluxC#2799
Accompanying FluxC#2851
This PR accompanying the above FluxC PR, and uses an updated and null-proof TermModel.java class.
FYI: This change is
breaking
, meaning that this client, which depends on theTerm
model, is now being updated to use the new APIs (non-default constructors
) as the existing API (default constructor
) are now deprecated. As such, this change is inherentlyrisky
, meaning that there are compile-time changes associated with this change and thus needs testing to verify correctness, both on the library and clients side.@mkevins@AjeshRPai let me know how I did on this PR, that is, in terms of updating this client to use the non-default constructors for theTerm
model in order to utilize the nullability annotations added on its fields and thus make its use null proof. If you also feel that this is a good way to proceed with such client PRs, I'll then use this pattern across the board and follow a similar approach on every such PR.FluxC Update List:
Deprecation Resolution List (
breaking
):Warning Resolution List:
breaking
)To test:
TaxonomyStore
related functionality andTermModel
related instantialization on both, the WordPress and Jetpack apps, and see if everything is working as expected. For a couple of examples, you can expand and follow the inner and more explicit test steps within:1. Categories Settings Screen [CategoriesListFragment.kt]
ℹ️ This test applies to both, the
Jetpack
andWordPress
app.Menu
sub-tab on the initialMy Site
screen and click onSite Settings
under theManage
section.Categories
under theWriting
section and click on it.Categories
screen is displayed and that everything works as expected.2. Tags Settings Screen [SiteSettingsTagListActivity.kt]
ℹ️ This test applies to both, the
Jetpack
andWordPress
app.Menu
sub-tab on the initialMy Site
screen and click onSite Settings
under theManage
section.Tags
under theWriting
section and click on it.Tags
screen is displayed and that everything works as expected.3. Prepublishing Screens [PrepublishingTagsFragment.kt + PrepublishingCategoriesFragment.kt]
ℹ️ This test applies to both, the
Jetpack
andWordPress
app.Posts
screen and edit any post.UPDATE
button to have the bottom sheet appear (top-right
).Tags
row and add, remove or edit any tag for this post. Click back.Categories
row and add, remove or create a new category for this post. Click back.UPDATE NOW
button to update this post (bottom
).Tags
/Categories
are updated and that everything works as expected.Merge instructions:
wordPressFluxCVersion
to point to thetrunk
hash that includes the above solution.[Status] Not Ready for Merge
label.Regression Notes
Potential unintended areas of impact
Prepublishing
screens, related to theterm.name
being null, which had it's (seemingly unnecessary) guarding code removed.What I did to test those areas of impact (or what existing automated tests I relied on)
To test
section above.What automated tests I added (or what prevented me from doing so)
PR submission checklist:
RELEASE-NOTES.txt
if necessary.UI Changes testing checklist: