Skip to content

Conversation

@wzieba
Copy link
Contributor

@wzieba wzieba commented Dec 1, 2025

Closes: AINFRA-548: Migrate ThemeModel

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 3 commits December 1, 2025 12:34
- Convert all classes and methods to Kotlin syntax
- Use @JvmField for properties accessed from Java code
- Maintain exact same behavior and API
- All tests passing

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

Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Convert ThemeModel to Room entity with composite primary key (siteId, themeId, isWpComTheme)
- Create ThemeDao with direct @upsert exposure following OrderStatusDao pattern
- Remove ThemeSqlUtils and move business logic to ThemeStore
- Add LocalIdConverter for Room type conversion
- Add comprehensive ThemeDaoTest with 13 test cases
- Rewrite ThemeStoreUnitTest from Java to Kotlin
- Update WPAndroidDatabase to version 31 with AutoMigration
- Use site.localId() instead of LocalId(site.id)
- Use runBlocking without dispatcher to preserve threading behavior

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

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

dangermattic commented Dec 1, 2025

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

wzieba and others added 2 commits December 4, 2025 12:29
Updates ThemeRepository to use the new Room-based ThemeModel constructor
with all required parameters instead of the deprecated default constructor.
This fixes compilation errors in the Wasabi debug unit tests.

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

Co-Authored-By: Claude <[email protected]>
The LocalIdConverter was defined in both fluxc and fluxc-plugin modules,
causing a "Type is defined multiple times" error during dex merging.

Since fluxc-plugin already depends on fluxc via api dependency, it
inherits the LocalIdConverter from the fluxc module. Removed the
duplicate from fluxc-plugin to resolve the build error.

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

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

wpmobilebot commented Dec 4, 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
Commit54cbaaa
Direct Downloadwoocommerce-wear-prototype-build-pr15045-54cbaaa.apk

- Remove unused imports from ThemeStore, ThemeDao, and ThemeStoreUnitTest
- Fix import ordering in WPAndroidDatabase (ThemeModel should come before persistence imports)
- Remove unused createSite function from ThemeDaoTest
- Rename test functions to follow detekt naming convention: "when X, then Y"

All 19 detekt issues have been resolved.

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

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

📲 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
Commit54cbaaa
Direct Downloadwoocommerce-prototype-build-pr15045-54cbaaa.apk

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 0% with 264 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.52%. Comparing base (eda322f) to head (54cbaaa).
⚠️ Report is 32 commits behind head on trunk.

Files with missing lines Patch % Lines
...va/org/wordpress/android/fluxc/store/ThemeStore.kt 0.00% 147 Missing ⚠️
.../fluxc/network/rest/wpcom/theme/ThemeRestClient.kt 0.00% 87 Missing ⚠️
...m/woocommerce/android/ui/themes/ThemeRepository.kt 0.00% 18 Missing ⚠️
...va/org/wordpress/android/fluxc/model/ThemeModel.kt 0.00% 8 Missing ⚠️
...ordpress/android/fluxc/persistence/dao/ThemeDao.kt 0.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #15045      +/-   ##
============================================
- Coverage     38.61%   38.52%   -0.09%     
- Complexity    10311    10312       +1     
============================================
  Files          2163     2167       +4     
  Lines        122674   122936     +262     
  Branches      16934    16945      +11     
============================================
+ Hits          47365    47366       +1     
- Misses        70503    70765     +262     
+ Partials       4806     4805       -1     

☔ 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.

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.

5 participants