Repository navigation
[flutter_tools] Improve toolexit error messages for flutter upgrade - #86351
Conversation
a8cd989 to
b059f1c
Compare
There was a problem hiding this comment.
Any reason not to use expectLater() with throwsToolExit()?
There was a problem hiding this comment.
I need to test for multiple strings within the error message. @jonahwilliams suggested over here the way to do this, but I'm all for any other approach.
There was a problem hiding this comment.
Can you not match the entire message as a single string?
There was a problem hiding this comment.
Wouldn't that break these tests over trivial formatting changes?
There was a problem hiding this comment.
I guess breaking tests would be worth the tradeoff for that kind of changes. Nvm.
There was a problem hiding this comment.
nit make this a const String
3532511 to
a858887
Compare
There was a problem hiding this comment.
The first message is better. I agree we should point users away from using git directly, but then terminology like Flutter: HEAD is just going to be confusing.
There was a problem hiding this comment.
How about this?
Unable to upgrade Flutter: Your Flutter checkout is currently not on a release branch (Are you
in a detached HEAD state?)...
I would prefer to keep the comment within () to suggest users who could diagnose this error with git.
There was a problem hiding this comment.
i think if they know what they're doing, "your flutter checkout is currently not on a release branch" will let them know what's happening. and if not, they can always just run the flutter channel command.
There was a problem hiding this comment.
Sounds reasonable. Likewise, I could edit the other message:
Unable to upgrade Flutter: The current Flutter branch/channel is not tracking any remote repository...
If it is okay to lose some verbosity in these messages, I will go ahead and make the changes.
There was a problem hiding this comment.
That looks good to me.
a858887 to
bb04a4c
Compare
bb04a4c to
b9ee458
Compare
|
@jonahwilliams @christopherfujino friendly ping |
This PR updates the toolexit error messages displayed when one runs
flutter upgradewith either theHEADnot pointing to a branch, or the current branch lacking an upstream.More specifically, this removes any
gitcommands from the error messages. and replaces them with an equivalent from the flutter sub commands, if any.Also adds a link to the official Flutter install docs(https://flutter.dev/docs/get-started/install) for further help.
This change was originally a part of #79372, which was reverted in #83423.
Fixes #49713.
Fixes #79366.
Pre-launch Checklist
///).