Skip to content

Conversation

@wzieba
Copy link
Contributor

@wzieba wzieba commented Dec 12, 2025

Closes: AINFRA-547: Migrate SitePluginModel

Description

Test Steps

Images/gif

  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

wzieba and others added 6 commits December 12, 2025 13:38
- Add SitePluginModel as Room entity with composite PK (siteId, slug)
- Add SitePluginDao with suspend methods and deprecated blocking methods for Java interop
- Add LocalIdConverter for Room type conversion
- Update WPAndroidDatabase to v31 with AutoMigration
- Use @upsert annotation for cleaner upsert semantics
- Expose protected methods (deleteBySite, upsertAll) and public replaceAllSitePlugins for atomic replace operations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Inject SitePluginDao directly instead of database wrapper
- Use upsert() and upsertBlocking() methods
- Remove insertOrUpdateSitePlugin helper methods
- Update response model mappers to create Room entities
- Make PluginStore constructor internal (package-private)
- Use site.localId() instead of LocalId(site.id)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Inject SitePluginDao instead of WPAndroidDatabase
- Use replaceAllSitePlugins() for atomic delete+insert operations
- Use site.localId() instead of LocalId(site.id)
- Update WCSystemPluginResponse mapper to create Room entities

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Add SitePluginDaoTest with Room in-memory database
- Update SitePluginSqlUtilsTest to use Room DAO and runTest
- Update PluginCoroutineStoreTest mock verifications (upsert)
- Update WooCommerceStoreTest to use WPAndroidDatabase
- Add kotlinx-coroutines-test dependency to fluxc-tests

All tests use the new DAO methods (upsert, replaceAllSitePlugins) and
proper coroutine testing with runTest instead of runBlocking.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Delete PluginSqlUtils.kt (replaced by SitePluginDao)
- Delete PluginSqlUtilsWrapper.kt (no longer needed)
- Delete old SitePluginModel.java (replaced by Kotlin Room entity)
- Delete old SitePluginSqlUtilsTest.java (replaced by SitePluginDaoTest)

All functionality has been migrated to Room-based DAO with improved
API design (upsert, replaceAllSitePlugins).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@dangermattic
Copy link
Collaborator

1 Error
🚫 Please add tests for class LocalIdConverter (or add unit-tests-exemption label to ignore this).
1 Warning
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Dec 12, 2025

🤖 Build Failure Analysis

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

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Dec 15, 2025

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App NameWooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit7062883
Direct Downloadwoocommerce-wear-prototype-build-pr15098-7062883.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Dec 15, 2025

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

App NameWooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit7062883
Direct Downloadwoocommerce-prototype-build-pr15098-7062883.apk

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.

4 participants