-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
chore: Handle async migrations & add migration tests #8967
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Bitrise❌❌❌ Commit hash: 9b14bfb Note
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8967 +/- ##
==========================================
+ Coverage 45.30% 45.35% +0.04%
==========================================
Files 1272 1272
Lines 31239 31247 +8
Branches 3189 3189
==========================================
+ Hits 14154 14171 +17
+ Misses 16245 16234 -11
- Partials 840 842 +2 ☔ View full report in Codecov by Sentry. |
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!!! This can be described with just this word -> AWESOME !!!
Bitrise✅✅✅ Commit hash: 979cc5b Note
|
…/handle-async-migrations
@Cal-L can you take a look at the merge conflicts. |
Bitrise✅✅✅ Commit hash: 7be5f0d Note
|
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** 1. What is the reason for the change? - @Cal-L discovered a missing test case in [his PR](#8967) for my migration. In order to perfectly handle the edge cases for this migration we must also check if the Preferences controller state is defined. - In order to unblock the above PR we need to handle this edge case. 2. What is the improvement/solution? - check if the preferences controller state is defined - add tests for the error cases and error messages ## **Related issues** Fixes: N/A ## **Manual testing steps** - [x] the tests should all pass. - [x] this migration was already tested and QAd in this previous [PR](https://github.com/pulls?page=2&q=is%3Apr+author%3Aowencraston+archived%3Afalse+is%3Aclosed) ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <img width="1246" alt="Screenshot 2024-03-27 at 11 54 27 AM" src="https://github.com/MetaMask/metamask-mobile/assets/22918444/f9a34068-8ab9-45fa-8f80-1b45eb6115d0"> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
…/handle-async-migrations
Bitrise❌❌❌ Commit hash: 876a0b5 Note
|
Bitrise✅✅✅ Commit hash: 7bbebeb Note
|
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 PR is QA passed.
Quality Gate passedIssues Measures |
Description
This PR enables the ability to write both asynchronous and synchronous migrations. Moving forward, we should not have to worry about resolving the incoming states within migration themselves. This change wraps each migration in an asynchronous function, which resolves the state before sending it to the next migration. We also added unit tests for checking migration functionality using
createMigrate
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
The videos below shows that migrations are still functioning as expected. There is no change in user experience. In addition to E2E tests, the main QA test to check is testing upgrading from current release (7.18.0) to this branch.
Video of upgrade from 7.17.0 -> This branch. Example: Shows migration 35 being applied, which sets the displayed currency to ETH
https://github.com/MetaMask/metamask-mobile/assets/10508597/ab21c8f1-de46-40b4-85a7-5ece5fbe4425
Same flow going from 7.15.0 -> This branch
https://github.com/MetaMask/metamask-mobile/assets/10508597/4d03ddea-2391-4372-b553-f79c9bd5300f
Pre-merge author checklist
Pre-merge reviewer checklist