Skip to content
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 CommentModel Class (breaking) #19389

Merged

Conversation

ParaskP7
Copy link
Contributor

@ParaskP7 ParaskP7 commented Oct 16, 2023

Parent FluxC#2799
Accompanying FluxC#2870

This PR accompanying the above FluxC PR, and uses an updated and null-proof CommentModel.java class.

FYI: This change is breaking, meaning that any client that depended on the Comment model should update to the new APIs. As such, this change is inherently risky, meaning that there are compile-time changes associated with this change and thus needs testing to verify correctness, both on the library's and client's side.

PS: The CommentModel.java model class is shared between the deprecated CommentStore and the CommentsStore, thus testing any CommentsStore related functionality, that is, in addition to testing any the CommentStore related functionality (shouldn't be many) is highly recommended.


@wzieba let me know how I did on this PR, that is, in terms of updating the store/sqlutils classes and adding nullability annotations on them and their main CommentModel.java model class, 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 PRs, I'll then use this pattern across the board and follow a similar approach on every such PR.


FluxC Update List:

  1. Update fluxc version to pr hash (2870)
  2. Update fluxc version to pr hash (2870)
  3. Update fluxc version to trunk hash (2870)

Test List:

  1. Update get likes use case test to updated on cmt likes changed

To Test (REST):

  • Smoke test any CommentStore and CommentsStore related functionality 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:

To Test (XMLRPC):

  • Create a new self-hosted WordPress site for XMLRPC testing purposes (jurassic.ninja).
  • Smoke test any CommentStore and CommentsStore related functionality 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. Comment Details Screen from Comments Screen [CommentDetailFragment.java]

ℹ️ This test applies to both, the Jetpack and WordPress app.

  • Go to Comments screen and tap on any comment.
  • Verify that the Comment Details screen is shown and functioning as expected.
  • For example, try replying, approving, marking as spam, liking, trashing, editing or copying a comment's link address. Additionally, make sure to verify that you can still swipe left-right to navigate between comments.
2. Comment Details Screen from Notification Tab [CommentDetailFragment.java]

ℹ️ This test applies to the Jetpack app only.

  • Go to Notifications tab, then its COMMENTS sub-tab, and tap on any comment.
  • Verify that the Comment Details screen is shown and functioning as expected.
  • For example, try replying to a comment. Additionally, make sure to verify that you can still swipe left-right to navigate between comments.
3. Edit Comment Screen from Comments Screen [UnifiedCommentsEditActivity.java]

ℹ️ This test applies to both, the Jetpack and WordPress app.

  • Go to Comments screen and tap on any comment.
  • From the More on the right side, at the bottom of the comment, select Edit.
  • Verify that the Edit Comment screen is shown and functioning as expected.
  • For example, try editing/adding the comment's Name, Web address, Email address and its Comment itself.
4. Edit Comment Screen from Notification Tab [UnifiedCommentsEditActivity.java]

ℹ️ This test applies to the Jetpack app only.

  • Go to Notifications tab, then its COMMENTS sub-tab, and tap on any comment.
  • From the More on the right side, at the bottom of the comment, select Edit.
  • Verify that the Edit Comment screen is shown and functioning as expected.
  • For example, try editing/adding the comment's Name, Web address, Email address and its Comment itself.
5. Reader Comments Screen [ReaderCommentListActivity.java]

ℹ️ This test applies to the Jetpack app only.

  • Go to Reader tab, then its DISCOVER sub-tab, and tap on any post.
  • Tap on the Comments button at the bottom of the post.
  • Verify that the Reader Comments screen is shown and functioning as expected.
  • For example, try (un)following, enabling/disabling in-app notifications, replying to post, and then sharing, replying or liking a specific comment.

Merge instructions:

  1. Wait for the accompanying FluxC#2870 PR to be merged.
  2. Update wordPressFluxCVersion to point to the trunk hash that includes the above solution.
  3. Remove the [Status] Not Ready for Merge label.
  4. Merge this PR.

PS: This PR will be failing until this base PR is merged to trunk and the accompanying FluxC#2870 gets updated with the latest trunk version of FluxC.


Regression Notes

  1. Potential unintended areas of impact

    • N/A
  2. What I did to test those areas of impact (or what existing automated tests I relied on)

    • See To test section above.
  3. What automated tests I added (or what prevented me from doing so)

    • N/A

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

UI Changes testing checklist:

  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • Talkback.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • Large and small screen sizes. (Tablet and smaller phones)
  • Multi-tasking: Split screen and Pop-up view. (Android 10 or higher)

This 'FluxC' PR hash updates the library to that branch version
where the 'CommentModel' is updated to its new null proof version.

FluxC PR: https://github.com/wordpress-mobile/
WordPress-FluxC-Android/pull/2870

This step is required in order to check that these 'FluxC'
related changes work as expected for WPAndroid.
Copy link
Contributor

@wzieba wzieba left a comment

Choose a reason for hiding this comment

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

Looks good 👍 Not merging.

@ParaskP7
Copy link
Contributor Author

👋 @wzieba and thanks reviewing and testing this! 🙇 ❤️ 🚀

FYI: I am going to merge this myself when everything is ready, following the merge instructions.

… into analysis/use-updated-and-null-proff-comment-model-class

# Conflicts:
#	build.gradle
This 'FluxC' PR hash updates the library to that branch version
where the 'CommentModel' is updated to its new null proof version.

FluxC PR: https://github.com/wordpress-mobile/
WordPress-FluxC-Android/pull/2870

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
ab1afaa. This change is necessary in
order to overcome and resolve new merge conflicts.
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Oct 18, 2023

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
Versionpr19389-1a3ee3d
Commit1a3ee3d
Direct Downloadjetpack-prototype-build-pr19389-1a3ee3d.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Oct 18, 2023

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
Versionpr19389-1a3ee3d
Commit1a3ee3d
Direct Downloadwordpress-prototype-build-pr19389-1a3ee3d.apk
Note: Google Login is not supported on these builds.

ParaskP7 and others added 2 commits October 18, 2023 15:53
This 'FluxC' hash updates the library to that 'trunk' version
where the 'CommentModel' is updated to its new null proof version.

FluxC PR: https://github.com/wordpress-mobile/
WordPress-FluxC-Android/pull/2870
@wpmobilebot
Copy link
Contributor

Found 1 violations:

The PR caused the following dependency changes:

-+--- org.wordpress:fluxc:{strictly trunk-6eee26f191edc73d3934ad5876d4a9b7b1456a9f} -> trunk-6eee26f191edc73d3934ad5876d4a9b7b1456a9f
-|    +--- 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-6eee26f191edc73d3934ad5876d4a9b7b1456a9f
-|    +--- org.greenrobot:eventbus:3.3.1
-|    |    \--- org.greenrobot:eventbus-java:3.3.1
-|    +--- com.squareup.okhttp3:okhttp:4.9.0 -> 4.11.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-5f7448d86213648f402c2e04af738ec5904ebb31} -> trunk-5f7448d86213648f402c2e04af738ec5904ebb31
+|    +--- 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-5f7448d86213648f402c2e04af738ec5904ebb31
+|    +--- org.greenrobot:eventbus:3.3.1
+|    |    \--- org.greenrobot:eventbus-java:3.3.1
+|    +--- com.squareup.okhttp3:okhttp:4.9.0 -> 4.11.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 -> trunk-6eee26f191edc73d3934ad5876d4a9b7b1456a9f (*)
+     \--- org.wordpress:fluxc:2.21.0 -> trunk-5f7448d86213648f402c2e04af738ec5904ebb31 (*)

Please review and act accordingly

@ParaskP7 ParaskP7 merged commit ca4e8b4 into trunk Oct 19, 2023
2 checks passed
@peril-wordpress-mobile
Copy link

Warnings
⚠️ PR is not assigned to a milestone.

Generated by 🚫 dangerJS

@ParaskP7 ParaskP7 deleted the analysis/use-updated-and-null-proff-comment-model-class branch October 19, 2023 11:09
@ParaskP7 ParaskP7 added this to the Future milestone Nov 1, 2023
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.

3 participants