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

[Tags IA] Fetch posts for multiple tags #20684

Merged
merged 21 commits into from
Apr 26, 2024

Conversation

thomashorta
Copy link
Contributor

@thomashorta thomashorta commented Apr 19, 2024

Fixes #20588

Move shared fetching logic to Repository and create ViewModel to use Repository to fetch posts for tags directly.


To Test:

  • Open Jetpack
  • Enable the reader_tags_feed feature flag in Debug Settings
  • Go to Reader
  • Select the Tags feed
  • Verify a UI shows up that loads the tag posts for the followed tags

Regression Notes

  1. Potential unintended areas of impact

    • Fetching posts in other places of the Reader
  2. What I did to test those areas of impact (or what existing automated tests I relied on)

    • Manual tests
    • Unit tests of Repository
    • Unit tests of existing code
  3. What automated tests I added (or what prevented me from doing so)

    • Unit tests in all new classes introduced

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.

Testing Checklist (strike-out the not-applying and unnecessary ones):

N/A, the UI in this PR is completely throwaway and only there to easily test these changes.

@dangermattic
Copy link
Collaborator

dangermattic commented Apr 19, 2024

1 Warning
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Apr 19, 2024

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
Versionpr20684-59ba75c
Commit59ba75c
Direct Downloadwordpress-prototype-build-pr20684-59ba75c.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Apr 19, 2024

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
Versionpr20684-59ba75c
Commit59ba75c
Direct Downloadjetpack-prototype-build-pr20684-59ba75c.apk
Note: Google Login is not supported on these builds.

Copy link

codecov bot commented Apr 19, 2024

Codecov Report

Attention: Patch coverage is 40.64171% with 111 lines in your changes are missing coverage. Please review.

Project coverage is 40.39%. Comparing base (5e50e18) to head (59ba75c).
Report is 486 commits behind head on feature/tags-ia.

Files Patch % Lines
...droid/ui/reader/repository/ReaderPostRepository.kt 3.15% 92 Missing ⚠️
...ndroid/datasets/wrappers/ReaderPostTableWrapper.kt 0.00% 8 Missing ⚠️
...droid/ui/reader/services/post/ReaderPostLogic.java 40.00% 3 Missing ⚠️
...android/ui/reader/sources/ReaderPostLocalSource.kt 93.02% 0 Missing and 3 partials ⚠️
.../org/wordpress/android/ui/prefs/AppPrefsWrapper.kt 0.00% 2 Missing ⚠️
...d/ui/reader/exceptions/ReaderPostFetchException.kt 50.00% 1 Missing ⚠️
.../ui/reader/services/post/ReaderPostJobService.java 0.00% 1 Missing ⚠️
...oid/ui/reader/services/post/ReaderPostService.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##           feature/tags-ia   #20684      +/-   ##
===================================================
+ Coverage            40.33%   40.39%   +0.06%     
===================================================
  Files                 1474     1479       +5     
  Lines                67878    67950      +72     
  Branches             11225    11232       +7     
===================================================
+ Hits                 27377    27451      +74     
+ Misses               38034    38024      -10     
- Partials              2467     2475       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@thomashorta thomashorta requested a review from RenanLukas April 22, 2024 14:39
Copy link
Contributor

@RenanLukas RenanLukas left a comment

Choose a reason for hiding this comment

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

Thanks for the PR and all the nice improvements in the Reader logic, @thomashorta ! 💯

I've left a few comments (mostly nitpicks) and before approving I just wanted to better understand how the ReaderPostLocalSource class works. We can quickly chat when you're available.

Copy link
Contributor

@RenanLukas RenanLukas left a comment

Choose a reason for hiding this comment

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

Great job! LGTM :shipit:

@thomashorta thomashorta marked this pull request as ready for review April 25, 2024 21:44
Copy link

sonarcloud bot commented Apr 25, 2024

Quality Gate Passed Quality Gate passed

Issues
6 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
2.9% Duplication on New Code

See analysis details on SonarCloud

@thomashorta thomashorta merged commit 8955440 into feature/tags-ia Apr 26, 2024
22 checks passed
@thomashorta thomashorta deleted the issue/20588-tags-feed-fetching branch April 26, 2024 14:47
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