[flutter_tools] Add --verify-only flag to flutter upgrade#68866
[flutter_tools] Add --verify-only flag to flutter upgrade#68866christopherfujino merged 7 commits intoflutter:masterfrom
Conversation
|
Some tests are failing on my local fork, mostly in the Switching to master and rerunning tests yields the same result, even in a cloned repo. I'm happy to provide a complete log if you require. |
I wouldn't worry too much about it, since tests are passing on CI. Some of these tests need careful environment setup to pass. I generally just run the tests for files I directly changed locally, and rely on CI to run the rest of them. Thanks for putting this out! I'll review it today. |
That's great! Let me update the checklist accordingly. |
|
I suppose we could include the changelog here, but it is only available for the |
|
I'm sorry I didn't review this last week. I will DEFINITELY review today! |
I agree, having a changelog would be great, but I think it would have to involve changing the way the team tracks changes, in order to dynamically present them in a machine-parseable way. |
| globals.printStatus('Flutter is already up to date on channel ${flutterVersion.channel}'); | ||
| globals.printStatus('$flutterVersion'); | ||
| return; | ||
| }else if(verifyOnly){ |
There was a problem hiding this comment.
nit: there should be a space before else.
There was a problem hiding this comment.
Sure, fixing it now.
On second thought, we could use a check whether the user is on the |
That's a good idea. I think you should use this link: https://flutter.dev/docs/development/tools/sdk/release-notes. It doesn't look to me like the actual URLs to the releases is stable, and the github wiki is not consistently maintained. |
christopherfujino
left a comment
There was a problem hiding this comment.
Thanks, this is a really good change! I made one request that modify the information that we provide.
| globals.printStatus('$flutterVersion'); | ||
| return; | ||
| } else if(verifyOnly) { | ||
| globals.printStatus('A new version of Flutter is available!\n'); |
There was a problem hiding this comment.
Can you update this to:
globals.printStatus('A new version of Flutter is available on channel ${flutterVersion.channel}\n');
// TODO(fujino): use a [FlutterVersion] once that class supports arbitrary revisions.
globals.printStatus('The latest revision: $upstreamRevision\n', emphasis: true);
globals.printStatus('Your current version: ${flutterVersion.frameworkRevision}');There was a problem hiding this comment.
Looks like you'll have to update test expectations if you make this change (sorry).
There was a problem hiding this comment.
Can you update this to:
Sure, will do that!
Looks like you'll have to update test expectations if you make this change (sorry).
I'm not quite sure that I follow.
There was a problem hiding this comment.
Oh I get that now, I would have to change the tests, my bad.
There was a problem hiding this comment.
No problem! I just wanted to save you the time in case you missed it, pushed it up to GitHub, and found out 30 minutes later that CI is failing. Because that's basically the story of my life :)
| globals.printStatus('Installed: ${flutterVersion.frameworkRevision}'); | ||
| globals.printStatus('Available: $upstreamRevision\n', emphasis: true); | ||
| globals.printStatus('To upgrade now, run "flutter upgrade".'); | ||
| if(flutterVersion.channel == 'stable'){ |
There was a problem hiding this comment.
nit: if (flutterVersion.channel == 'stable') {
christopherfujino
left a comment
There was a problem hiding this comment.
LGTM, thanks for this contribution!
| } else if (verifyOnly) { | ||
| globals.printStatus('A new version of Flutter is available on channel ${flutterVersion.channel}\n'); | ||
| // TODO(fujino): use a [FlutterVersion] once that class supports arbitrary revisions. | ||
| globals.printStatus('The latest revision: $upstreamRevision\n', emphasis: true); |
There was a problem hiding this comment.
I think the \n has incorrectly remained on line 118.
There was a problem hiding this comment.
|
This pull request is not suitable for automatic merging in its current state.
|
Description
This PR adds a new flag for
flutter upgrade,--verify-only, which will only check for and inform available updates, if any.Adding this flag to
flutter upgradewill not fetch updates.Moreover, if the user is on
stablechannel, it displays an url to see the release notes/changelog:Related Issues
Fixes #67532.
Tests
I added the following tests:
Checklist
Before you create this PR, confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.