Skip to content

Conversation

@wzieba
Copy link
Contributor

@wzieba wzieba commented Nov 17, 2025

Closes: AINFRA-661: Remove FluxC dependency on Track's experimentation

Description

Update: this PR removes ExPlat/experimentation from the project, as there are no running experiments.

This PR is a twin of woocommerce/woocommerce-android#14128.

The idea here is to replace internal experimentation logic with experimentation library.

The historical context is following:

  • initially, ExPlat was shared via FluxC between WordPress and WooCommerce
  • then, we vendored FluxC into projects
  • then, we extracted experimentation from WooCommerce's FluxC and replaced it there
  • and now, does the same, but for WordPress/Jetpack

Testing instructions

Actually - not needed. The experimentation library was tested during development. As there are no running experiments in WordPress/Jetpack, we can't meaningfully test this PR.

@dangermattic
Copy link
Collaborator

dangermattic commented Nov 17, 2025

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 Nov 17, 2025

Project dependencies changes

list
+ New Dependencies
com.automattic.tracks:experimentation:6.0.6
tree
+\--- com.automattic.tracks:experimentation:6.0.6
+     +--- com.squareup.okhttp3:okhttp:4.12.0 -> 5.3.1 (*)
+     +--- com.squareup.moshi:moshi:1.15.1 (*)
+     +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4 -> 1.10.2 (*)
+     \--- org.jetbrains.kotlin:kotlin-stdlib:2.0.21 -> 2.2.21 (*)

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Nov 17, 2025

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
FlavorJalapeno
Build TypeDebug
Versionpr22354-cd710de
Commitcd710de
Direct Downloadwordpress-prototype-build-pr22354-cd710de.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Nov 17, 2025

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
FlavorJalapeno
Build TypeDebug
Versionpr22354-cd710de
Commitcd710de
Direct Downloadjetpack-prototype-build-pr22354-cd710de.apk
Note: Google Login is not supported on these builds.

Otherwise unit tests fail because Mockito has a problem with the synthethic Kotlin method (doesn't see it)
@wzieba wzieba changed the title Remove ExPlat logic from the project. Replace it with experimentation library from Tracks. Remove ExPlat from the project. Replace it with experimentation library from Tracks. Nov 18, 2025
@codecov
Copy link

codecov bot commented Nov 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.07%. Comparing base (7d993c6) to head (cd710de).
⚠️ Report is 4 commits behind head on trunk.

Additional details and impacted files
@@            Coverage Diff             @@
##            trunk   #22354      +/-   ##
==========================================
- Coverage   39.12%   39.07%   -0.06%     
==========================================
  Files        2205     2199       -6     
  Lines      106157   106030     -127     
  Branches    15049    15035      -14     
==========================================
- Hits        41536    41431     -105     
+ Misses      61129    61111      -18     
+ Partials     3492     3488       -4     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

appLogWrapper: AppLogWrapper,
@Named(APPLICATION_SCOPE) appScope: CoroutineScope,
) = VariationsRepository.create(
platform = "wpandroid",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines 664 to 665
// Possible way to initialize variations repository. Not tested, verify when working on experiments.
// variationsRepository.initialize("${tracker.anonID}")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't implement it because the project doesn't run any experiments, and what we consider "experiment id" can vary from use case. This is just a hint where we should likely initialize VariationsRepository.

Comment on lines -937 to -941
if (!firstActivityResumed) {
// Since we're force refreshing on app startup, we don't need to try refreshing again when starting
// our first Activity.
exPlat.refreshIfNeeded()
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Intended removal. The experimentation library will handle per-session cache. There's no need to refresh the experiments on app resume.

@wzieba wzieba added this to the 26.5 milestone Nov 18, 2025
@wzieba wzieba marked this pull request as ready for review November 18, 2025 13:51
@wzieba wzieba requested a review from a team as a code owner November 18, 2025 13:51
@wzieba wzieba requested review from adalpari and removed request for a team November 18, 2025 13:51
Copy link
Contributor

@jkmassel jkmassel left a comment

Choose a reason for hiding this comment

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

LGTM, but if we're not doing any experiments right now would it make more sense to just remove without adding a replacement until we need it?

There are no currently running experiments, so this integration is redundant. #22354 (review)
@wzieba
Copy link
Contributor Author

wzieba commented Nov 19, 2025

would it make more sense to just remove without adding a replacement until we need it?

Makes sense 👍 . And in the future, this PR could help as a reference point on how to integrate the library. I removed the eperimentation in cd710de

@sonarqubecloud
Copy link

@wzieba wzieba merged commit 89633eb into trunk Nov 19, 2025
24 checks passed
@wzieba wzieba deleted the remove_fluxc_experimentation branch November 19, 2025 09:49
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.

5 participants