Skip to content

Conversation

@dnfield
Copy link
Contributor

@dnfield dnfield commented Mar 6, 2020

Description

Fixes #15529 by running git fetch https://github.com/flutter/flutter --tags before trying to use tags to describe the current version.

If there is no network connection, the command just silently fails and we're no worse than we used to be. If there is a network connection, this will end up pulling down tags, and potentially updating the FETCH_HEAD.

Related Issues

Fixes #15529
additional context at #50577

Tests

I added the following tests:

Updated version_test.dart to handle the new invocation of git.
Added a test that asserts we fetch the tags when we try to determine the version.

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.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read Handling breaking changes.

  • No, no existing tests failed, so this is not a breaking change.

@fluttergithubbot fluttergithubbot added the tool Affects the "flutter" command-line tool. See also t: labels. label Mar 6, 2020
Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nit

final String hash;

static GitTagVersion determine(ProcessUtils processUtils, [String workingDirectory]) {
_runGit('git fetch https://github.com/flutter/flutter --tags', processUtils, workingDirectory);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind making the repo URL a constant and adopting in fetchRemoteFrameworkCommitDate()?

'https://github.com/flutter/flutter.git',

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@fluttergithubbot fluttergithubbot merged commit 20bf43b into flutter:master Mar 6, 2020
jonahwilliams pushed a commit that referenced this pull request Mar 6, 2020
jonahwilliams pushed a commit that referenced this pull request Mar 6, 2020
@dnfield dnfield deleted the fix_version branch March 6, 2020 21:21
dnfield added a commit to dnfield/flutter that referenced this pull request Mar 6, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

For devs who git pull instead of flutter upgrade, version calculation is wrong

4 participants