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

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

Closed
tvolkert opened this issue Mar 14, 2018 · 4 comments · Fixed by #52062 or #52141
Closed

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

tvolkert opened this issue Mar 14, 2018 · 4 comments · Fixed by #52062 or #52141
Assignees
Labels
tool Affects the "flutter" command-line tool. See also t: labels.
Milestone

Comments

@tvolkert
Copy link
Contributor

tvolkert commented Mar 14, 2018

Steps to Reproduce

# Fetch remote refs on March 6 and not since
$ git pull upstream master
$ git reset --hard 4c7cc73
$ flutter doctor

Expected Behavior

Because version 0.2.1 has been tagged at 6f5bcb9, the version should be v0.2.2-pre.45

Actual Behavior

The version is reported as v0.1.9-pre.124, which indicates that the last tag the tool sees is v0.1.8. Looking at the contents of my local tags confirms this:

$ ll .git/refs/tags/
total 224
drwxr-xr-x  30 tvolkert  eng  960 Mar  6 10:35 .
drwxr-xr-x   6 tvolkert  eng  192 Mar  6 10:36 ..
-rw-r--r--   1 tvolkert  eng   41 Feb  7 09:41 v0.0.10
-rw-r--r--   1 tvolkert  eng   41 Feb  7 09:41 v0.0.11
-rw-r--r--   1 tvolkert  eng   41 Feb  7 09:41 v0.0.12
-rw-r--r--   1 tvolkert  eng   41 Feb  7 09:41 v0.0.13
-rw-r--r--   1 tvolkert  eng   41 Feb  7 09:41 v0.0.14
-rw-r--r--   1 tvolkert  eng   41 Feb  7 09:41 v0.0.15
-rw-r--r--   1 tvolkert  eng   41 Feb  7 09:41 v0.0.16
-rw-r--r--   1 tvolkert  eng   41 Feb  7 09:41 v0.0.17
-rw-r--r--   1 tvolkert  eng   41 Feb  7 09:41 v0.0.18
-rw-r--r--   1 tvolkert  eng   41 Feb  7 09:41 v0.0.19
-rw-r--r--   1 tvolkert  eng   41 Feb  7 09:41 v0.0.20
-rw-r--r--   1 tvolkert  eng   41 Feb  7 09:41 v0.0.21
-rw-r--r--   1 tvolkert  eng   41 Feb  7 09:41 v0.0.22
-rw-r--r--   1 tvolkert  eng   41 Feb  7 09:41 v0.0.23
-rw-r--r--   1 tvolkert  eng   41 Feb  7 16:52 v0.0.24
-rw-r--r--   1 tvolkert  eng   41 Feb  7 09:41 v0.0.6
-rw-r--r--   1 tvolkert  eng   41 Feb  7 09:41 v0.0.7
-rw-r--r--   1 tvolkert  eng   41 Feb  7 09:41 v0.0.8
-rw-r--r--   1 tvolkert  eng   41 Feb  7 09:41 v0.0.9
-rw-r--r--   1 tvolkert  eng   41 Feb 26 11:38 v0.1.0
-rw-r--r--   1 tvolkert  eng   41 Feb 26 11:38 v0.1.1
-rw-r--r--   1 tvolkert  eng   41 Feb 26 11:38 v0.1.2
-rw-r--r--   1 tvolkert  eng   41 Feb 26 11:38 v0.1.3
-rw-r--r--   1 tvolkert  eng   41 Feb 26 11:38 v0.1.4
-rw-r--r--   1 tvolkert  eng   41 Feb 26 11:38 v0.1.5
-rw-r--r--   1 tvolkert  eng   41 Feb 26 11:38 v0.1.6
-rw-r--r--   1 tvolkert  eng   41 Mar  1 08:25 v0.1.7
-rw-r--r--   1 tvolkert  eng   41 Mar  6 10:35 v0.1.8

The only way I see to solve this is to make flutter doctor fetch upstream refs, but that could have unintended consequences... @Hixie thoughts?


Edit by @christopherfujino
As this issue has had a complicated history of related PRs and issues, I've listed the ones that I could find here for reference:

03/14/2018 - Issue #15529 - this issue
03/05/2020 - PR #52062 - First fix for version command
03/06/2020 - Issue #52121 - Regression caused by #52062
03/06/2020 - PR #52128 - Revert of #52062
03/06/2020 - PR #52141 - Second fix, reland but only in doctor
03/06/2020 - Issue #52161 - flutter version command hangs on dev 1.15.18
03/08/2020 - PR #52212 - Third fix, for version command
03/09/2020 - PR #52250 - Fourth fix, for upgrade/build ios commands

@tvolkert tvolkert added the tool Affects the "flutter" command-line tool. See also t: labels. label Mar 14, 2018
@tvolkert tvolkert added this to the No milestone necessary milestone Mar 14, 2018
@jmagman jmagman added this to Awaiting triage in Tools - installer / upgrade review Jan 10, 2020
@jmagman jmagman added this to Awaiting triage in Tools - doctor review via automation Jan 10, 2020
@jmagman jmagman removed this from Awaiting triage in Tools - installer / upgrade review Jan 10, 2020
@christopherfujino christopherfujino moved this from Awaiting triage to Engineer reviewed in Tools - doctor review Mar 5, 2020
@dnfield
Copy link
Contributor

dnfield commented Mar 6, 2020

From #50577, this impacts people on CI perhaps when they follow this workflow or some similar one. CI will fail analysis because the version calculation looks all wrong and the version constraints don't work anymore.

@dnfield dnfield modified the milestones: No milestone necessary, Goals Mar 6, 2020
@dnfield
Copy link
Contributor

dnfield commented Mar 6, 2020

Changing milestone to goals because this impacts contributors on a semi-frequent basis, and it's difficult to explain how to fix (or even why it needs to be worked around).

@dnfield dnfield self-assigned this Mar 6, 2020
@dnfield dnfield modified the milestones: Goals, March 2020 Mar 6, 2020
@dnfield
Copy link
Contributor

dnfield commented Mar 6, 2020

Change is getting reverted because it regressed performance too much. I'll try to find a more optimal implementation if possible.

@lock
Copy link

lock bot commented Apr 26, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@lock lock bot locked and limited conversation to collaborators Apr 26, 2020
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
Tools - doctor review
  
Engineer reviewed
2 participants