wordpress-mobile / WordPress-Android

WordPress for Android
http://android.wordpress.org
GNU General Public License v2.0
2.92k stars 1.3k forks source link

Offline Sync: EditPostActivity Conversion #20543

Closed zwarm closed 3 weeks ago

zwarm commented 1 month ago

Fixes #20509

This PR marks the initial phase in simplifying the complexity of EditPostActivity.

In this PR is the conversion of EditPostActivity from Java to Kotlin. While Android Studio handled the bulk of the conversion, I manually did a bunch of cleanup to minimize the need for "most" suppressions. The lingering suppressions, include CyclomaticComplexMethod, ReturnCount, LargeMethod, and LargeClass. They will be addressed outside of this PR.

The ultimate objective is to refactor this class into coherent segments, streamlining the activity into a more manageable and maintainable structure.

The UI was not touched during this conversion


To Test:

Using the branch from this PR, thoroughly check the following create/edit post scenarios (and any others you can think of)

Regression Notes

  1. Potential unintended areas of impact Edit post activities no longer work

  2. What I did to test those areas of impact (or what existing automated tests I relied on) Manual testing of edit posts. No unit tests exist because it's an activity

  3. What automated tests I added (or what prevented me from doing so) The existing instrumentation tests.


PR Submission Checklist:


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

dangermattic commented 1 month ago
2 Warnings
:warning: This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
:warning: Class RestartEditorOptions is missing tests, but unit-tests-exemption label was set to ignore this.

Generated by :no_entry_sign: Danger

wpmobilebot commented 1 month ago
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
Versionpr20543-25d7cb9
Commit25d7cb9760b435b2cd9f21318aacd948b6d695cf
Direct Downloadjetpack-prototype-build-pr20543-25d7cb9.apk
Note: Google Login is not supported on these builds.
wpmobilebot commented 1 month ago
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
Versionpr20543-25d7cb9
Commit25d7cb9760b435b2cd9f21318aacd948b6d695cf
Direct Downloadwordpress-prototype-build-pr20543-25d7cb9.apk
Note: Google Login is not supported on these builds.
codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 40.32%. Comparing base (21bf822) to head (25d7cb9). Report is 5 commits behind head on trunk.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## trunk #20543 +/- ## =========================================== - Coverage 82.58% 40.32% -42.26% =========================================== Files 15 1473 +1458 Lines 534 67852 +67318 Branches 50 11221 +11171 =========================================== + Hits 441 27362 +26921 - Misses 75 38024 +37949 - Partials 18 2466 +2448 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sonarcloud[bot] commented 3 weeks ago

Quality Gate Passed Quality Gate passed

Issues
27 New issues
0 Accepted issues

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

See analysis details on SonarCloud

sentry-io[bot] commented 3 weeks ago

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

Did you find this useful? React with a 👍 or 👎