Skip to content
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

Integrate "dart fix" into flutter tool #70113

Open
goderbauer opened this issue Nov 9, 2020 · 11 comments
Open

Integrate "dart fix" into flutter tool #70113

goderbauer opened this issue Nov 9, 2020 · 11 comments
Labels
passed first triage proposal tool

Comments

@goderbauer
Copy link
Member

goderbauer commented Nov 9, 2020

This issue is to discuss whether/how we should integrate "dart fix" into flutter tool. Two useful integrations I could see are:

  1. Make flutter fix available to apply available fixes to my current fluter project (this command would probably just pipe through to "dart fix").
  2. Prompt users after upgrading to a new flutter version that they may want to run flutter fix to apply any available fixes for breaking changes to their flutter projects (maybe we could automatically detect that new fixes are available in the new version by comparing the dartfix files pre and post upgrade).

/cc @Piinks @jonahwilliams @bwilkerson

@goderbauer goderbauer added the tool label Nov 9, 2020
@jonahwilliams
Copy link
Member

jonahwilliams commented Nov 9, 2020

  1. What does flutter fix add over dart fix? Generally speaking I'd like to avoid adding more dart tool wrappers to the flutter tool if it is only for "branding" - its nonzero effort to maintain and we're already strapped for time.

  2. Generally speaking we should only log error messages if they are actionable - if we at least know they have fixes that can be applied that could be good enough, but this information should also be surfaced through IDEs too.

( What happens if someone temporarily upgrades to master/dev/beta, applies fixes, and then wants to go back to master )

@goderbauer
Copy link
Member Author

goderbauer commented Nov 9, 2020

/cc @csells @devoncarew

@goderbauer
Copy link
Member Author

goderbauer commented Nov 9, 2020

but this information should also be surfaced through IDEs too.

The fixes do already show up as quick fixes in the IDE.

@bwilkerson
Copy link
Contributor

bwilkerson commented Nov 9, 2020

What happens if someone temporarily upgrades to master/dev/beta, applies fixes, and then wants to go back to master

We aren't currently planning on supporting any form of downgrade. Users would need to use their source code control system to revert the changes.

@jonahwilliams
Copy link
Member

jonahwilliams commented Nov 9, 2020

Seems reasonable!

@Piinks
Copy link
Contributor

Piinks commented Nov 9, 2020

Re: prompting users to run flutter/dart fix when appropriate, could this be determined by running the analyzer and seeing if there is attention needed that way?

@devoncarew
Copy link
Member

devoncarew commented Nov 9, 2020

We could add something like dart fix --dry-run --fix package:flutter or similar, which could indicate whether there were any package flutter fixes that would apply to the current codebase. That would take ~10sec to run, so not an instant result.

@jonahwilliams
Copy link
Member

jonahwilliams commented Nov 9, 2020

Do we have a way to check if there were new dart fix metadata files added? We could weaken it a bit to detecting potential fixes and directing users to dart fix

@bwilkerson
Copy link
Contributor

bwilkerson commented Nov 9, 2020

Do we have a way to check if there were new dart fix metadata files added?

The current design is to have a single file per package, but the tool could easily compare the length of the file or an MD5 hash both before and after the upgrade to determine whether there are any new fixes that users might want to run.

@jonahwilliams
Copy link
Member

jonahwilliams commented Nov 9, 2020

I actually think either of those approaches (running analyzer or checking fixes) will not be feasible on upgrade, since we don't require that command is run in the context of a flutter project.

It would have to be a per-project check of some kind

@bwilkerson
Copy link
Contributor

bwilkerson commented Nov 9, 2020

I was thinking of a message more like:

Some APIs have been modified as part of this upgrade. Running dart fix in each of your packages might help you migrate your code.

@pedromassangocode pedromassangocode added the passed first triage label Nov 10, 2020
@jmagman jmagman added this to Awaiting triage in Tools - Dart and pub review via automation Nov 10, 2020
@TahaTesser TahaTesser added the proposal label Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
passed first triage proposal tool
Projects
Tools - Dart and pub review
  
Awaiting triage
Development

No branches or pull requests

7 participants