-
Notifications
You must be signed in to change notification settings - Fork 136
Migrate WCShippingLabelCreationEligibility to Room
#15008
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Convert model to data class with Room annotations - Use composite primary key [localSiteId, remoteOrderId] - Replace synthetic primary key with LocalId/RemoteId types - Add ShippingLabelCreationEligibilityDao with upsert and query methods - Add comprehensive DAO unit tests covering all operations - Table name: ShippingLabelCreationEligibilityEntity 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Update WCShippingLabelStore to use ShippingLabelCreationEligibilityDao - Make store constructor internal to allow internal DAO injection - Use runBlocking for DAO calls outside coroutines - Remove rowsAffected handling - Delete WCShippingLabelSqlUtils 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Register WCShippingLabelCreationEligibility entity in WCAndroidDatabase - Add ShippingLabelCreationEligibilityDao to database - Increment database version from 74 to 75 - Add AutoMigration(from = 74, to = 75) - Add WellSql migration 234 to drop legacy table 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Remove ADDON_WOOCOMMERCE parameter from test configurations - Update WCDataStoreTest, WCProductStoreTest, WCShippingLabelStoreTest - Update WooCommerceStoreTest, WCLeaderboardsStoreTest, WCProductLeaderboardsMapperTest - Remove unused WellSqlConfig imports 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Generated by 🚫 Danger |
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
Without this provider, Hilt cannot inject the DAO into WCShippingLabelStore, causing build failures. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
WCShippingLabelCreationEligibility to Room
…e to remove addon configuration to fix WellException: Generated classes for addon not found.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #15008 +/- ##
=========================================
Coverage 38.61% 38.61%
Complexity 10312 10312
=========================================
Files 2163 2163
Lines 122674 122654 -20
Branches 16934 16930 -4
=========================================
Hits 47366 47366
+ Misses 70503 70483 -20
Partials 4805 4805 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
73d75ee to
c19180f
Compare
c19180f to
73d75ee
Compare
…remote` prefixes This is redundant, as we use types for this
irfano
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and works as expected. I left minor feedback, but I’m approving. 🚢
| } | ||
|
|
||
| @Test | ||
| fun `when eligibility is not eligible with reason, then reason is persisted`() = runTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is actually doing the exact same thing as when eligibility is upserted, then it can be retrieved. Its only benefit is that it states its purpose more explicitly. Feel free to ignore, but I prefer keeping the test suite less crowded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I totally agree! I missed this when reviewing AI, fixed in: 29beb60
It's actually duplicate of existing test. See: https://github.com/woocommerce/woocommerce-android/pull/15008\#discussion_r2589577060
Description
This PR migrates
WCShippingLabelCreationEligibilityfrom WellSql to Room.The migration, like always, focuses on actually migrating database entities and not fixing threading issues. All database calls on main thread are now more visible though, because of the runBlocking usage.
Test Steps
Testing this PR requires a site with the old shipping labels flow. See this internal Slack thread for details and website, which has this flow enabled right now: p1764335185877589/1764334560.167769-slack-C03L1NF1EA3
ShippingLabelCreationEligibilityEntitytable.Images/gif
Before (trunk)
After
RELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.