[flutter_tools] Have FlutterValidator fail on non-ideal git config#103259
[flutter_tools] Have FlutterValidator fail on non-ideal git config#103259auto-submit[bot] merged 9 commits intoflutter:masterfrom
Conversation
There was a problem hiding this comment.
can you pull some of this logic into helper methods? This cascade of if/else's is very difficult for my poor brain to parse.
There was a problem hiding this comment.
I made each statement have its separate function returning ValidationMessage. Hope that suffices.
4d5d1e0 to
e6f6019
Compare
There was a problem hiding this comment.
Out of curiosity, when is this value 0.0.0-unknown? And can you add a comment with the answer so I don't ask you next time :)
There was a problem hiding this comment.
I think this can be before run the validator on line 544?
There was a problem hiding this comment.
Rather than doing this check for gitUrl != null, can we not re-use the error message of upstreamValidationError? If that doesn't make sense, I think we should at least sub-class VersionCheckError for the different types of errors, rather than doing a check for the value of gitUrl here. It would be better for that implementation detail to be encapsulated inside of the VersionUpstreamValidator.
There was a problem hiding this comment.
That actually sounds like a good idea.
0ef7ca3 to
38bb6eb
Compare
There was a problem hiding this comment.
should this be a hint? is it not a legitimate state to be in to be on a non-release branch?
There was a problem hiding this comment.
This is because I want to nudge users towards hints that might cause flutter upgrade to fail. The tool sets channel unknown if the branch doesn't have an upstream.
There was a problem hiding this comment.
It doesn't seem like this message gives the user actionable information, though.
There was a problem hiding this comment.
Should we recommend the user to reinstall here(and other errors where applicable)?
There was a problem hiding this comment.
what if the if i'm tracking branch delta from my own mirror? Won't that also resolve to "Unknown"? This seems like a reasonable workflow.
There was a problem hiding this comment.
The tool parses the information from this command for the channel:
flutter/packages/flutter_tools/lib/src/version.dart
Lines 113 to 114 in c181e45
and sets 'unknown' if the above returns nothing(or fails), which shouldn't be possible if the current branch is tracking something, be it a remote or a local branch.
There was a problem hiding this comment.
Ahh, ok, I assumed we were validating that this was in a known set. Thanks for educating me!
There was a problem hiding this comment.
Is the assumption here that git describe ... outputted something we can't parse?
8377c7b to
edb657d
Compare
This is what I have in mind:
|
edb657d to
0057438
Compare
Fixes #102035.
Makes the version and the upstream repository message display an issue in cases where
flutter upgradeis not supported.Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.