Skip to content

Task/migrate to new blaze fetch campaigns endpoint#20358

Merged
JorgeMucientes merged 20 commits intotrunkfrom
task/migrate-to-new-blaze-fetch-campaigns-endpoint
Mar 8, 2024
Merged

Task/migrate to new blaze fetch campaigns endpoint#20358
JorgeMucientes merged 20 commits intotrunkfrom
task/migrate-to-new-blaze-fetch-campaigns-endpoint

Conversation

@JorgeMucientes
Copy link
Copy Markdown
Contributor

@JorgeMucientes JorgeMucientes commented Mar 1, 2024

Closes: #10836

Description

Please don't panic with the number of file changes. Most of them are really small ones.
This PR migrates existing endpoint for fetching Blaze campaigns to new endpoint. The previous one was deprecated and we were encouraged from the self serve team to migrate it. Since, the FluxC change were breaking changes I decided to help migrating the Jetpack/WordPress app at the same time as the WooCommerce app. I'd suggest checking the FluxC changes: wordpress-mobile/WordPress-FluxC-Android#2963 for extra context.

To Test:

I'll appreciate some input here in case I'm missing something. But overall, the smoke testing Blaze campaign loading and opening campaign details should be enough.

demoAfterMigration.mp4

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Mar 1, 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
Versionpr20358-cfe878b
Commitcfe878b
Direct Downloadwordpress-prototype-build-pr20358-cfe878b.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Mar 1, 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
Versionpr20358-cfe878b
Commitcfe878b
Direct Downloadjetpack-prototype-build-pr20358-cfe878b.apk
Note: Google Login is not supported on these builds.

@JorgeMucientes JorgeMucientes marked this pull request as ready for review March 4, 2024 11:49
Comment on lines +11 to +16
InModeration("pending", R.string.campaign_status_in_moderation),
Scheduled("scheduled", R.string.campaign_status_scheduled),
Active("active", R.string.campaign_status_active),
Completed("finished", R.string.campaign_status_completed),
Rejected("rejected", R.string.campaign_status_rejected),
Canceled("canceled", R.string.campaign_status_canceled),
Scheduled("scheduled", R.string.campaign_status_scheduled),
InModeration("created", R.string.campaign_status_in_moderation);
Completed("finished", R.string.campaign_status_completed);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The new API exposes the following statues:

Screenshot 2024-03-04 at 17 37 02

The only change to what we were using before is that now created value has been replaced with pending. The rest of the returned values from the API are the same, I've just simply ordered them in "successive campaign life cycle" order.

Copy link
Copy Markdown
Contributor

@AjeshRPai AjeshRPai left a comment

Choose a reason for hiding this comment

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

Hey @JorgeMucientes

Thanks for picking up on this change. I smoke-tested the app and found a minor issue. When you go to the campaign listing screen, the first item is the most recent campaign, but if you refresh, it is not arranged in the most recent order. See the video capture below.

Screen_recording_20240306_114536.webm

I haven't reviewed the code yet. I plan to do that today or tomorrow. But I wanted to let you know about this issue so that I can possibly take up the review after it has been fixed.

@JorgeMucientes
Copy link
Copy Markdown
Contributor Author

Hey @AjeshRPai thanks for the input! I've checked the issue you mentioned and I noticed that I can only reproduce it on trunk. I can't reproduce it on task/migrate-to-new-blaze-fetch-campaigns-endpoint. This are the screen recordings from my tests:

trunk:

reorderingBug.mp4

task/migrate-to-new-blaze-fetch-campaigns-endpoint:

refreshCampaigns.mp4

Upon further investigation I noticed that the issue is with the API response. Its returning the items for page=1 in different orders.

So once we merge this PR that issue should be fixed as it seems is not happening with the new endpoint.

@AjeshRPai AjeshRPai self-requested a review March 7, 2024 10:48
Copy link
Copy Markdown
Contributor

@AjeshRPai AjeshRPai left a comment

Choose a reason for hiding this comment

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

Hey @JorgeMucientes

I have smoke tested the blaze feature and everything looks good to me. Thanks for wrangling this change. I will approve the fluxC PR. Let me know if you need me to update the fluxC hash version and merge this.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 8, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

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

See analysis details on SonarCloud

@wpmobilebot
Copy link
Copy Markdown
Contributor

Found 1 violations:

The PR caused some dependency changes (expand to see details)

-+--- org.wordpress:fluxc:{strictly trunk-ae15f6b0b21c0ee9e0f97741ea2e16545358eac3} -> trunk-ae15f6b0b21c0ee9e0f97741ea2e16545358eac3
-|    +--- 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-ae15f6b0b21c0ee9e0f97741ea2e16545358eac3
-|    +--- 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.9.10 (*)
-|    +--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.6.20 -> 1.9.10 (*)
-|    +--- 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.1 (*)
-|    |    +--- 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.9.10 (*)
-|    |    +--- androidx.sqlite:sqlite:2.3.0
-|    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.6.0 (*)
-|    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.7.20 -> 1.9.20 (*)
-|    |    \--- 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.9.20 (*)
-|    +--- androidx.room:room-ktx:2.4.2 -> 2.5.0
-|    |    +--- androidx.room:room-common:2.5.0 (*)
-|    |    +--- androidx.room:room-runtime:2.5.0 (*)
-|    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.7.20 -> 1.9.20 (*)
-|    |    \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 -> 1.7.3 (*)
-|    +--- com.google.dagger:dagger:2.42 -> 2.50
-|    |    \--- 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-b9ecc708dde74d6cc95aeab42e56fb8067640039} -> trunk-b9ecc708dde74d6cc95aeab42e56fb8067640039
+|    +--- 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-b9ecc708dde74d6cc95aeab42e56fb8067640039
+|    +--- 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.9.10 (*)
+|    +--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.6.20 -> 1.9.10 (*)
+|    +--- 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.1 (*)
+|    |    +--- 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.9.10 (*)
+|    |    +--- androidx.sqlite:sqlite:2.3.0
+|    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.6.0 (*)
+|    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.7.20 -> 1.9.20 (*)
+|    |    \--- 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.9.20 (*)
+|    +--- androidx.room:room-ktx:2.4.2 -> 2.5.0
+|    |    +--- androidx.room:room-common:2.5.0 (*)
+|    |    +--- androidx.room:room-runtime:2.5.0 (*)
+|    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.7.20 -> 1.9.20 (*)
+|    |    \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 -> 1.7.3 (*)
+|    +--- com.google.dagger:dagger:2.42 -> 2.50
+|    |    \--- 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.14.1
-     \--- org.wordpress:fluxc:trunk-ed60798b4d96ec19863c74b0f525e2e20f4525db -> trunk-ae15f6b0b21c0ee9e0f97741ea2e16545358eac3 (*)
+     \--- org.wordpress:fluxc:trunk-ed60798b4d96ec19863c74b0f525e2e20f4525db -> trunk-b9ecc708dde74d6cc95aeab42e56fb8067640039 (*)

Please review and act accordingly

@JorgeMucientes JorgeMucientes added this to the 24.5 milestone Mar 8, 2024
@JorgeMucientes JorgeMucientes merged commit 5e6a217 into trunk Mar 8, 2024
@JorgeMucientes JorgeMucientes deleted the task/migrate-to-new-blaze-fetch-campaigns-endpoint branch March 8, 2024 08:50
AjeshRPai added a commit that referenced this pull request Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stats widgets are showing "No network available" after some time

3 participants