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

Only fetch tags when not on dev/beta/stable #53450

Merged
merged 1 commit into from
Mar 28, 2020

Conversation

dnfield
Copy link
Contributor

@dnfield dnfield commented Mar 28, 2020

Description

This patch avoids doing git tag fetches when determining the git version on stable/beta/dev. This way we still fetch tags on random developer branches and on master, where the tag has a bigger impact on the version and may have gotten messed up due to whatever workflow the developer used to checkout their branch, but does not use network bandwidth unnecessarily for most users.

Related Issues

Discussion at #52250

Tests

I added the following tests:

Test that we fetch the tags on master, but not on dev.

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 did all the things.

@fluttergithubbot fluttergithubbot added the tool Affects the "flutter" command-line tool. See also t: labels. label Mar 28, 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

Copy link
Member

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks Dan!

Copy link
Member

@christopherfujino christopherfujino 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 one nit

@@ -722,7 +722,12 @@ class GitTagVersion {

static GitTagVersion determine(ProcessUtils processUtils, {String workingDirectory, bool fetchTags = false}) {
if (fetchTags) {
_runGit('git fetch $_flutterGit --tags', processUtils, workingDirectory);
final String channel = _runGit('git rev-parse --abbrev-ref HEAD', 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't because instantiating that type calls this method

Copy link
Member

@christopherfujino christopherfujino Mar 28, 2020

Choose a reason for hiding this comment

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

doh! lgtm then

@fluttergithubbot fluttergithubbot merged commit c8efcb6 into flutter:master Mar 28, 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.

None yet

6 participants