Skip to content

Remove the dead WordPress-to-Jetpack content migration subsystem - #23309

Merged
nbradbury merged 7 commits into
trunkfrom
delete-jetpack-migration-subsystem
Sep 9, 2026
Merged

nbradbury merged 7 commits into
trunkfrom
delete-jetpack-migration-subsystem

Conversation

@nbradbury

@nbradbury nbradbury commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

TL;DR

This is (hopefully!) the last PR which deletes the remaining unused WordPress→Jetpack content migration code.

Description

JetpackMigrationFlowFeatureConfig has no remote field, so it resolves straight to BuildConfig.JETPACK_MIGRATION_FLOW, which is false with no flavor override. The flow cannot be switched on from the server. Despite that, the WordPress flavor still shipped LocalMigrationContentProvider with exported="true" (serving the access token, sites and posts) plus an exported JetpackAppInstallReceiver behind a self-declared permission whose only broadcaster was inside the dead flow.

This PR removes:

  • The migration UI, the local content migration helpers, and the shared-login / user-flags / blogging-reminders-sync / reader-saved-posts-sync packages, with their tests (~5,200 LOC)
  • 7 feature configs and their buildConfigFields, 7 AppPrefs keys, 29 Tracks constants, and the FluxC JetpackMigrationStore (only used by the migration-completed email)
  • The exported provider, the install receiver and its custom permission from the WordPress manifest, and the matching uses-permission from the Jetpack manifest
  • HelpActivity's migration-help branch, HelpViewModel (sign-out logic reachable only from that branch), and the Help layout views only that branch showed
  • 26 string keys across all locales, a layout, 4 drawables, 2 dimens and 2 colors

Kept on purpose: OpenWebLinksWithJetpackFlow and JetpackAppUninstallReceiver (live), JetpackPoweredBottomSheetFragment, and three jp_migration_* dimens and one jp_migration_* string that live screens still use.

Two behaviour notes: the Help screen no longer shows the "Switch to the Jetpack app FAQ" row that migrated users saw, and ActivityLauncher.showMainActivity(Context, boolean) now means selectPrimarySite (the only remaining flag).

Accepted risk: Jetpack 21.3 through 25.8 shipped with the migration flow hard-enabled and no remote kill switch. A signed-out user still on one of those builds who updates WordPress will see the generic migration error on Continue, then fall back to login. Nothing on the WordPress side can change that.

The second commit tidies what the deletion left behind (single-child layout wrapper, a duplicated LoadingState composable, a now-empty util/publicdata package).

Testing instructions

Clean CI should be enough to approve this, but a more thorough check would be to build and run both the Jetpack and WordPress variations and ensure they load as expected.

The migration flow could not start in any shipped build: its feature config
had no remote field and BuildConfig.JETPACK_MIGRATION_FLOW was false with no
flavor override. The WordPress flavor still shipped an exported content
provider vending the account access token, plus an exported receiver behind
a custom permission whose only broadcaster was this dead code.

Deletes the migration UI, local content migration helpers, shared login,
user flags, blogging reminders sync and reader saved-posts sync packages
with their tests, 7 feature configs, the AppPrefs keys, 29 Tracks constants,
the FluxC JetpackMigrationStore, HelpActivity's migration-help branch, and
the associated strings, layout, drawables, dimens and colors.

LoadingState is moved to ui/compose/components since Blaze and site
creation use it. showMainActivity's boolean now means selectPrimarySite.
- Drop the single-child ConstraintLayout wrapper in the Help layout
- Reuse the shared LoadingState composable in QR-code auth
- Fold getPackageInfo into util/PackageManagerWrapper and delete the
  now-empty util/publicdata package
- Collapse a nested else/if in WPMainActivity and a braced single-statement
  when branch in AccountSettingsFragment
- Inline a single-use local in DeepLinkingIntentReceiverActivity
@dangermattic

dangermattic commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator
2 Warnings
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot

wpmobilebot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Project manifest changes for WordPress

The following changes in the WordPress's merged AndroidManifest.xml file were detected (build variant: wordpressRelease):

--- ./build/reports/diff_manifest/WordPress/wordpressRelease/base_manifest.txt	2026-09-09 10:52:11.072844842 +0000
+++ ./build/reports/diff_manifest/WordPress/wordpressRelease/head_manifest.txt	2026-09-09 10:52:14.583716036 +0000
@@ -8,11 +8,7 @@
     <uses-sdk
         android:minSdkVersion="26"
         android:targetSdkVersion="36" />
-
-    <permission
-        android:name="org.wordpress.android.permission.DISABLE_NOTIFICATIONS"
-        android:description="@string/notification_disable_broadcast_permission_desc"
-        android:label="@string/notification_disable_broadcast_permission_label" /> <!-- Normal permissions, access automatically granted to app -->
+    <!-- Normal permissions, access automatically granted to app -->
     <uses-permission android:name="android.permission.VIBRATE" />
     <uses-permission android:name="android.permission.INTERNET" />
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
@@ -134,19 +130,6 @@
         android:supportsRtl="true"
         android:theme="@style/WordPress"
         android:usesCleartextTraffic="false" >
-        <provider
-            android:name="org.wordpress.android.localcontentmigration.LocalMigrationContentProvider"
-            android:authorities="org.wordpress.android.LocalMigrationContentProvider"
-            android:exported="true" />
-
-        <receiver
-            android:name="org.wordpress.android.ui.mysite.jetpackbadge.JetpackAppInstallReceiver"
-            android:exported="true"
-            android:permission="org.wordpress.android.permission.DISABLE_NOTIFICATIONS" >
-            <intent-filter>
-                <action android:name="org.wordpress.android.broadcast.DISABLE_NOTIFICATIONS" />
-            </intent-filter>
-        </receiver>
         <receiver
             android:name="org.wordpress.android.ui.deeplinks.JetpackAppUninstallReceiver"
             android:exported="true" >
@@ -937,10 +920,6 @@
             android:theme="@style/WordPress.NoActionBar" />
         <activity
             android:name="org.wordpress.android.ui.debug.cookies.DebugCookiesActivity"
-            android:theme="@style/WordPress.NoActionBar" />
-        <activity
-            android:name="org.wordpress.android.ui.main.jetpack.migration.JetpackMigrationActivity"
-            android:label="@string/jp_migration_welcome_title"
             android:theme="@style/WordPress.NoActionBar" /> <!-- Notifications activities -->
         <activity
             android:name="org.wordpress.android.ui.notifications.NotificationsDetailActivity"

Go to https://buildkite.com/automattic/wordpress-android/builds/28627/canvas?sid=01a085c9-5b29-4595-a6b3-045e239619d2, click on the Artifacts tab and audit the files.

@wpmobilebot

wpmobilebot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Project manifest changes for WordPress

The following changes in the WordPress's merged AndroidManifest.xml file were detected (build variant: jetpackRelease):

--- ./build/reports/diff_manifest/WordPress/jetpackRelease/base_manifest.txt	2026-09-09 10:52:05.678041777 +0000
+++ ./build/reports/diff_manifest/WordPress/jetpackRelease/head_manifest.txt	2026-09-09 10:52:09.102687852 +0000
@@ -8,8 +8,7 @@
     <uses-sdk
         android:minSdkVersion="26"
         android:targetSdkVersion="36" />
-
-    <uses-permission android:name="org.wordpress.android.permission.DISABLE_NOTIFICATIONS" /> <!-- Normal permissions, access automatically granted to app -->
+    <!-- Normal permissions, access automatically granted to app -->
     <uses-permission android:name="android.permission.VIBRATE" />
     <uses-permission android:name="android.permission.INTERNET" />
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
@@ -962,10 +961,6 @@
             android:theme="@style/WordPress.NoActionBar" />
         <activity
             android:name="org.wordpress.android.ui.debug.cookies.DebugCookiesActivity"
-            android:theme="@style/WordPress.NoActionBar" />
-        <activity
-            android:name="org.wordpress.android.ui.main.jetpack.migration.JetpackMigrationActivity"
-            android:label="@string/jp_migration_welcome_title"
             android:theme="@style/WordPress.NoActionBar" /> <!-- Notifications activities -->
         <activity
             android:name="org.wordpress.android.ui.notifications.NotificationsDetailActivity"

Go to https://buildkite.com/automattic/wordpress-android/builds/28627/canvas?sid=01a085c9-5b29-4437-8366-2fdffd1895f7, click on the Artifacts tab and audit the files.

@nbradbury
nbradbury marked this pull request as ready for review September 8, 2026 17:39
@nbradbury
nbradbury requested a review from adalpari September 8, 2026 17:39
@wpmobilebot

wpmobilebot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
Build TypeDebug
Versionpr23309-a709b55
Build Number1498
Application IDcom.jetpack.android.prealpha
Commita709b55
Installation URL42kmuqn8mgaj0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

wpmobilebot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
Build TypeDebug
Versionpr23309-a709b55
Build Number1498
Application IDorg.wordpress.android.prealpha
Commita709b55
Installation URL56sn154eepsk0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

Copy link
Copy Markdown
Contributor

🤖 Build Failure Analysis

This build has failures. Claude has analyzed them - check the build annotations for details.

Lint flagged white_translucent_80, ic_site_icon_placeholder_primary_24 and
the pref_key_initial_screen string as unused; their only consumers were in
the deleted migration code.
@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.89%. Comparing base (623e2a4) to head (a709b55).

Files with missing lines Patch % Lines
...rg/wordpress/android/util/PackageManagerWrapper.kt 0.00% 2 Missing ⚠️
...ava/org/wordpress/android/ui/ActivityLauncher.java 0.00% 1 Missing ⚠️
...ndroid/util/crashlogging/WebviewVersionProvider.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            trunk   #23309      +/-   ##
==========================================
- Coverage   38.00%   37.89%   -0.12%     
==========================================
  Files        2350     2290      -60     
  Lines      128950   127771    -1179     
  Branches    17994    17845     -149     
==========================================
- Hits        49008    48418     -590     
+ Misses      75898    75333     -565     
+ Partials     4044     4020      -24     

☔ View full report in Codecov by Harness.
📢 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.

- Drop the /mobile/migration endpoint spec now that its rest client is gone
- Remove the unused initial-screen pref, its getters and MySiteTabType
- Remove four section comments that headed empty resource sections
- Note why the two remaining jp_migration_* dimens are kept

@adalpari adalpari left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like a nice clean! 🚢 it!

@nbradbury
nbradbury merged commit 8f09c87 into trunk Sep 9, 2026
23 checks passed
@nbradbury
nbradbury deleted the delete-jetpack-migration-subsystem branch September 9, 2026 11:02
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