-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Flutter Migrate #95708
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
Flutter Migrate #95708
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
@blasten You are welcome to take a look/try it out. But heads up, the robustness still needs a lot of work. This works nicely for apps that were generated with a previous stable version as the fallback base commit discovery isn't quite fully fleshed out yet. |
|
cc @jmagman @hellohuanlin This should be in a working-enough state to try out. Best way to see how it works cleanly is to create a new project with an old version of flutter, then run the migrate tool on it. I'd be interested in if there are any ios specific issues/files/edge cases that should be handled. |
|
@jmagman I am seeing that the migration tool is finding merge conflicts when attempting to merge modern versions of ios/Runner.xcodeproj/project.pbxproj with old versions. This file seems to be a machine-handled file that is quite long and unwieldy. Fixing ~6 merge conflicts in this file does not seem like a good user experience. Do you have any context on how this file changes over time, and the risk of breaking the file either due to a bad merge or it becoming outdated? Is it something we can choose to not handle and xcode will update it for us through context? Here is an example conflicted file: https://gist.github.com/GaryQian/9313b4424b30ee0efe4e07464d2018c6 |
|
|
Ok, thanks for the explanation/advice. I think for now, we can just skip that file and have the user own it. Currently, I definitely cannot guarantee we can fully handle the file, and manually resolving conflicts in it sounds very risky indeed. I will do some testing to see if not migrating that file can cause iOS build issues. |
jmagman
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.
Once you're satisfied with this change I recommend breaking this up into smaller reviews to get thorough feedback.
@GaryQian per this comment, it sounds like you're not really going to land this, but instead smaller incremental changes? Given this, I am going to mark this a draft so it doesn't show up in PR review. Feel free to mark ready for review if I am mistaken. |
|
Yeah, feel free to mark as draft. Ive already broken this up, and am using this as a master reference |
|
This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
Superseded by #100284 |
This PR adds a
flutter migrate <action>command.To use the migrate tool:
flutter migrate start --verbose<project>/migrate_working_dir.flutter migrate applyto apply the changes and clean up the working dir.Subcommands:
flutter migrate start: Computes the migration and outputs changes into a working directoryflutter migrate apply: Checks the working directory conflicts are resolved and applies the changes to the project.flutter migrate abandon: Deletes the current working directory and active migration.flutter migrate status: Print the files that are slated to be changed as well as any conflicted files that need manual merging.Notes on testing:
The migration tool requires full apps created with past flutter versions. This can be done two ways: a test fixture copy of pre-generated apps or cloning old versions of flutter and calling create on them after building the tool. The fixture method is much faster than the clone and create way.