Skip to content

refactor: remove obsolete database migration controller - #986

Merged
BrandonStalnaker merged 2 commits into
workstation/swift-migrationfrom
refactor/Remove-DB-Migration-Controller
Sep 11, 2026
Merged

BrandonStalnaker merged 2 commits into
workstation/swift-migrationfrom
refactor/Remove-DB-Migration-Controller

Conversation

@BrandonStalnaker

@BrandonStalnaker BrandonStalnaker commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Background

  • The persistence migration now uses the Swift implementation, leaving MPDatabaseMigrationController unused with no remaining callers.

What Has Changed

  • Removed the obsolete Objective-C MPDatabaseMigrationController header and implementation.
  • Removed its references from the Xcode project.

Checklist

  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have tested this locally.

Reference Issue (For employees only. Ignore if you are an outside contributor)

Summary by CodeRabbit

  • Refactor

    • Removed legacy database migration handling from the SDK.
    • Related migration APIs and processing are no longer included.
  • User Impact

    • Standard integrations should not experience changes to user-facing SDK functionality.
    • Existing applications relying on the removed database migration behavior may require updates to maintain compatibility.

@BrandonStalnaker BrandonStalnaker self-assigned this Sep 10, 2026
@BrandonStalnaker
BrandonStalnaker requested a review from a team as a code owner September 10, 2026 18:20
@cursor

cursor Bot commented Sep 10, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches on-device persistence migration code paths; risk is low if Swift migration is the only active path, but regressions would affect upgrades from older DB versions.

Overview
Removes the unused Objective-C MPDatabaseMigrationController (.h/.m) and drops it from the Xcode target’s headers, sources, and Persistence group.

Local SQLite upgrade paths that this class implemented (sessions, messages, uploads, forwarding records, consumer info/cookies, integration attributes, old-record pruning) are already covered by the Swift persistence stack (MPDatabaseMigrator / MPDatabaseMigrationLogicPRIVATE); this change is dead-code cleanup with no intended public API change.

Reviewed by Cursor Bugbot for commit 676303b. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: QUIET

Plan: Advanced

Run ID: 2b52cda6-ac90-4441-a42b-17b51a12ac07

📥 Commits

Reviewing files that changed from the base of the PR and between 130e2d0 and 676303b.

📒 Files selected for processing (1)
  • mParticle-Apple-SDK.xcodeproj/project.pbxproj
💤 Files with no reviewable changes (1)
  • mParticle-Apple-SDK.xcodeproj/project.pbxproj

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The pull request removes MPDatabaseMigrationController, including its Objective-C interface and database migration implementation. It also removes all related file references and build-phase entries from the Xcode project.

Changes

Database migration controller removal

Layer / File(s) Summary
Remove migration controller implementation
mParticle-Apple-SDK/Persistence/MPDatabaseMigrationController.h, mParticle-Apple-SDK/Persistence/MPDatabaseMigrationController.m
Deletes the controller interface and its database migration, cleanup, transfer, and database-file handling methods.
Remove Xcode target integration
mParticle-Apple-SDK.xcodeproj/project.pbxproj
Removes the controller from project file references, the Persistence group, header build files, source build files, and target build phases.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 67630

The obsolete Objective-C migration controller and project references are removed in favor of the Swift implementation, with no identified merge-blocking risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: removal of the obsolete MPDatabaseMigrationController and its project references.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/Remove-DB-Migration-Controller

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown

🐦 Swift Migration Progress

Production implementation code at 676303bad475 compared with abbf3bfe0a1d.

Area Goal Progress Base This PR Swift SLOC Objective-C remaining Change
Core SDK Short term — in scope ███████▏░░ 70.38% 71.51% 11,476 4,571 🚀 +1.13 pp
Core SDK Long term — all Objective-C █████▏░░░░ 50.99% 51.58% 11,476 10,771 🚀 +0.59 pp
SDK kit infrastructure Short term — in scope ███████▍░░ 73.45% 73.45% 2,031 734 ➖ 0.00 pp
SDK kit infrastructure Long term — all Objective-C ████░░░░░░ 39.81% 39.81% 2,031 3,071 ➖ 0.00 pp
Standalone kits Short term — in scope ▋░░░░░░░░░ 5.84% 5.84% 864 13,921 ➖ 0.00 pp
Standalone kits Long term — all Objective-C ▋░░░░░░░░░ 5.84% 5.84% 864 13,921 ➖ 0.00 pp

Objective-C retained by design: Core SDK 6,200 · SDK kit infrastructure 2,337 · Standalone kits 0.

This PR's code movement

Area Swift lines added Objective-C lines removed
Core SDK 0 340
SDK kit infrastructure 0 0
Standalone kits 0 0
How this is measured
  • Current composition uses production source lines of code (SLOC) from cloc; comments and blank lines are excluded.
  • Short term — in scope excludes the Objective-C the migration will not delete, so 100% is the end of this project: every in-scope implementation gone.
  • Long term — all Objective-C keeps the full denominator. Reaching 100% there means the public API itself becomes Swift, which is a breaking change reserved for a future major release.
  • The gap between the two rows is the retained public/kit contract, runtime-identity, and boundary-glue surface listed in Tools/swift-migration-retained-objc.txt.
  • Retained wrappers keep their Objective-C interface but still shed logic to Swift. That thinning moves the long-term row and the retained figure, not the short-term row.
  • Both revisions are measured with the manifest from the head revision, so a manifest edit does not by itself move the reported change. A retained file this pull request renamed or deleted still counts as retained at the base.
  • Pull request movement uses physical additions/deletions from git diff base...head --numstat; it counts retained files too and is intentionally separate from SLOC totals.
  • Core excludes SDK kit infrastructure and vendored libraries. Standalone kits include only files below Kits/**/Sources.
  • Tests, examples, headers, build outputs, vendored libraries, and the MParticle/Sources Swift overlay are excluded.
  • Objective-C++ (.mm) is included in the Objective-C figures and removed counts.

Generated with cloc 2.10. This report is informational and does not gate migration direction.

@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown

📦 SDK Size Impact Report

Measures how much the SDK adds to an app's size (with-SDK minus without-SDK).

Metric Target Branch This PR Change
App Bundle Impact 2.68 MB 2.66 MB -20 KB
Executable Impact 848 bytes 848 bytes +N/A
XCFramework Size 6.84 MB 6.77 MB -72 KB

➡️ SDK size impact change is minimal.

Raw measurements

Target branch (workstation/swift-migration):

{"baseline_app_size_kb":84,"baseline_executable_size_bytes":75464,"with_sdk_app_size_kb":2824,"with_sdk_executable_size_bytes":76312,"sdk_impact_kb":2740,"sdk_executable_impact_bytes":848,"xcframework_size_kb":7000}

This PR:

{"baseline_app_size_kb":84,"baseline_executable_size_bytes":75464,"with_sdk_app_size_kb":2804,"with_sdk_executable_size_bytes":76312,"sdk_impact_kb":2720,"sdk_executable_impact_bytes":848,"xcframework_size_kb":6928}

@BrandonStalnaker
BrandonStalnaker merged commit 410e8d1 into workstation/swift-migration Sep 11, 2026
82 checks passed
@BrandonStalnaker
BrandonStalnaker deleted the refactor/Remove-DB-Migration-Controller branch September 11, 2026 14:21
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.

3 participants