-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Flutter migrate command #100284
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 command #100284
Conversation
2c9c3bc to
68d06fd
Compare
|
Gold has detected about 1 new digest(s) on patchset 5. |
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.
Can you just use systemTempDirectory.createTempSync as the rest of the tool does?
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.
Ahh sure, didn't know about this utility!
|
@GaryQian you have a validation error in your .ci.yaml that's causing none of the pre-submit checks to be scheduled: https://github.com/flutter/flutter/pull/100284/checks?check_run_id=5843295727 |
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.
can you link to an issue?
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.
I suggest also checking in this block if it exists; if it doesn't, the likely reason is a typo in the argument.
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.
I think we should be much more conservative and probably prompt for some user input unless --force was provided. Something like: `logger.printStatus('Are you sure you want to delete ${workingDirectory.absolute.path}?');
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.
We should handle this delete failing.
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.
Can you break up this line?
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.
| logger.printStatus('No git repo found. Please run in a project with an initialized git repo or initialize one with:'); | |
| logger.printError('No git repo found. Please run in a project with an initialized git repo or initialize one with:'); |
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.
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.
| logger.printStatus('No migration in progress. Please run:'); | |
| logger.printError('No migration in progress. Please run:'); |
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.
Here and throughout, if we're about to fail, we should log to STDERR
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.
Use printError, also we should log out where we checked, in case this was wrong.
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.
Log to STDERR here why we're failing. Also, I think we should log something if they had uncommitted changes and we're overriding with --force
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.
since this is verbose, should we list the files we're modifying?
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.
I'm pretty sure you don't need to actually track these in your Commands. Any time you want verbose logging, you can call logger.printTrace(), and it will only actually show in the logger if the logger in the context is verbose. See https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/executable.dart#L126
7602469 to
76aaf52
Compare
70ab156 to
1f65cd6
Compare
|
I was trying to run the example app in https://github.com/mobiten/flutter_staggered_animations/tree/master/example, and it just doesn't compile because it requires:
I was curious about how the migration tool will work in this case. |
|
We can't do the all of the v2 embedding migration for them, they will still have to migrate manually. The tool will do some of the more mundane v2 embedding migrations though such as add metadata. Some of the things in (2) and (3) are handled as merge conflicts that will have to be manually resolved until we add smarter per-file custom merging, which the design allows to be modularly added in the future. If the files are not user modified though, we usually see clean bumps in versions. |
|
This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold. 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. |
|
Closing this as it has been superseded by #102598 and the individual PRs for each subcommand. |
Adds
flutter migrate startflutter migrate abandonflutter migrate applyflutter migrate statusThis feature includes the following sections:
migrate_compute.dart- performs the majority of the migration computation via thecomputeMigrationfunction.migrate_utils.dart- Utility and data classes that provide utility methods to access git and other bash/dos commands.migrate_manifest- Data class that wraps a MigrateResult and represents the manifest that is output alongside the staged filescustom_merge.dart- Handles manually merging files with known structures to produce better results. The initial version only manually merges.metadatathough this should be expanded to includepubspec.yamland other commonly encountered known files.