-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Use an alternative to git describe for master version resolution
#174088
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
Conversation
|
(1) Yes, I think you have it right. When the original logic was written, tagging happened much more frequently since there was a tag for every roll to g3. That was the 'dev' channel, which no longer exists. (2) The new output is definitely less confusing! AFAIK that string is not load bearing, and it's mostly just us maintainers on master channel. (3) Only concern from me about the implementation is whether the additional synchronous calls out to git impact tool startup time (or any other operation where we compute the version). Maybe Gemini can suggest a shorter sequence of commands? =) |
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request replaces git describe with a more explicit sequence of git commands to resolve the framework version. This change improves the logic by using the latest version tag instead of the nearest one. My feedback focuses on improving the correctness and robustness of the new implementation. I've pointed out a potential issue with the commit counting logic and suggested adding checks to handle cases where git commands might fail, which will prevent unnecessary errors and process calls. With these changes, the version resolution will be more reliable.
|
This LGTM, although I'm also no Git master and have no idea if there's a better way to do this. |
|
@stuartmorgan-g brings up a good point (in another chat/thread):
|
|
Re-thinking this. Will send out for review again when ready. |
|
This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
git describe for master version resolution.../flutter-master.version instead of git describe
|
Ok here is my attempt based on some offline discussion with @stuartmorgan-g and others. It's a lot less hacky, but will require a single manual step by the release team. If we like this change, I'll modify the release team documentation and let the team know (in practice I think this is fine, and we could even help automate it at a future point). |
|
Ugh, I missed something. My original workaround ("use the highest tag number") only kicks in if a commit is so new it's not part of any release. That means, it was valid. I'm going to revert back to that point as it in general was more automated. |
68ca683 to
966f99b
Compare
.../flutter-master.version instead of git describegit describe for master version resolution
…lutter#174088) Closes flutter#173904. It's not clear to me how `git describe --tags HEAD` ever ... worked to determine a fallback. From what I can tell, the _intent_ was to use the latest (newest? closest?) tag as the base version, and then append `-{commitCount}-{shortHash}` as the fallback version number when on `master` (or any non-published branch). So, I rewrote the implementation, unfortunately with 4 separate calls out to `git ...` instead of a single one. There are 20+ tests that fail as a result of this change, mostly because they make specific expectations around `git describe` being invoked, and of course that is no longer the case - putting those aside, I'd like to double check that: 1. I understand what the original command was _intending_ to do 2. We like the _output_ of the updated command 3. ... we either are okay with the implementation, or have an alternative in mind (I'm no `git` master) Wdyt? At this commit: ```sh $ flutter-dev --version Flutter 3.36.0-1.0.pre-170 • channel [user-branch] • https://github.com/matanlurey/flutter Framework • revision 250381a (5 minutes ago) • 2025-08-19 18:57:36 -0700 Engine • hash f278b0aa3b8c6732ab636563eb8e896c35fc9c79 (revision 9ac4fac) (2 hours ago) • 2025-08-19 23:42:28.000Z Tools • Dart 3.10.0 (build 3.10.0-115.0.dev) • DevTools 2.49.0 ``` /cc @zanderso @jmagman for historics.
…lutter#174088) Closes flutter#173904. It's not clear to me how `git describe --tags HEAD` ever ... worked to determine a fallback. From what I can tell, the _intent_ was to use the latest (newest? closest?) tag as the base version, and then append `-{commitCount}-{shortHash}` as the fallback version number when on `master` (or any non-published branch). So, I rewrote the implementation, unfortunately with 4 separate calls out to `git ...` instead of a single one. There are 20+ tests that fail as a result of this change, mostly because they make specific expectations around `git describe` being invoked, and of course that is no longer the case - putting those aside, I'd like to double check that: 1. I understand what the original command was _intending_ to do 2. We like the _output_ of the updated command 3. ... we either are okay with the implementation, or have an alternative in mind (I'm no `git` master) Wdyt? At this commit: ```sh $ flutter-dev --version Flutter 3.36.0-1.0.pre-170 • channel [user-branch] • https://github.com/matanlurey/flutter Framework • revision 250381a (5 minutes ago) • 2025-08-19 18:57:36 -0700 Engine • hash f278b0aa3b8c6732ab636563eb8e896c35fc9c79 (revision 9ac4fac) (2 hours ago) • 2025-08-19 23:42:28.000Z Tools • Dart 3.10.0 (build 3.10.0-115.0.dev) • DevTools 2.49.0 ``` /cc @zanderso @jmagman for historics.
flutter/flutter@d2ac021...26bb33b 2025-08-22 [email protected] [HCPP] Clean up overlay layer when last frame had overlay content and current doesn't (flutter/flutter#173881) 2025-08-22 [email protected] Migrate more files to use WidgetStateProperty (flutter/flutter#174176) 2025-08-22 [email protected] Roll Skia from 75fef9fb3ed7 to cb15e1452399 (1 revision) (flutter/flutter#174255) 2025-08-22 [email protected] Roll Skia from 006241a7fbe1 to 75fef9fb3ed7 (1 revision) (flutter/flutter#174254) 2025-08-22 [email protected] Skip wasm build when dry run is disabled and --wasm is not specified. (flutter/flutter#174184) 2025-08-22 [email protected] Roll Dart SDK from c153c5259e62 to 4f9623f024ab (2 revisions) (flutter/flutter#174250) 2025-08-22 [email protected] Roll Skia from d70087007490 to 006241a7fbe1 (2 revisions) (flutter/flutter#174252) 2025-08-22 [email protected] Roll Skia from c09589f7ca69 to d70087007490 (22 revisions) (flutter/flutter#174245) 2025-08-21 [email protected] [ Widget Preview ] Add regression test for issue 173895 (flutter/flutter#174037) 2025-08-21 [email protected] Improve xcresult comment and naming (flutter/flutter#173129) 2025-08-21 [email protected] Update `.gemini/styleguide.md` to encourage `master`-only (flutter/flutter#174065) 2025-08-21 [email protected] [ Widget Preview ] Fix crash when attempting to provide non-const params to a `Preview` (flutter/flutter#174242) 2025-08-21 [email protected] Roll Skia from 721e68fe652a to c09589f7ca69 (12 revisions) (flutter/flutter#174162) 2025-08-21 [email protected] Roll Dart SDK from 0d0a0c394381 to c153c5259e62 (7 revisions) (flutter/flutter#174235) 2025-08-21 [email protected] [ Tool ] Throw `ToolExit` when asset entries use absolute paths (flutter/flutter#174230) 2025-08-21 [email protected] Roll Dart SDK from 0d0a0c394381 to c153c5259e62 (7 revisions) (flutter/flutter#174227) 2025-08-21 [email protected] [ Tool ] Cleanup widget preview and frontend server shutdown (flutter/flutter#173863) 2025-08-21 [email protected] Use an alternative to `git describe` for `master` version resolution (flutter/flutter#174088) 2025-08-21 [email protected] Report a correct display ID in the window metrics event on win32 (flutter/flutter#174156) 2025-08-21 [email protected] Revert "Update the AccessibilityPlugin::Announce method to account fo… (flutter/flutter#174223) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#174088) Closes flutter#173904. It's not clear to me how `git describe --tags HEAD` ever ... worked to determine a fallback. From what I can tell, the _intent_ was to use the latest (newest? closest?) tag as the base version, and then append `-{commitCount}-{shortHash}` as the fallback version number when on `master` (or any non-published branch). So, I rewrote the implementation, unfortunately with 4 separate calls out to `git ...` instead of a single one. There are 20+ tests that fail as a result of this change, mostly because they make specific expectations around `git describe` being invoked, and of course that is no longer the case - putting those aside, I'd like to double check that: 1. I understand what the original command was _intending_ to do 2. We like the _output_ of the updated command 3. ... we either are okay with the implementation, or have an alternative in mind (I'm no `git` master) Wdyt? At this commit: ```sh $ flutter-dev --version Flutter 3.36.0-1.0.pre-170 • channel [user-branch] • https://github.com/matanlurey/flutter Framework • revision 250381a (5 minutes ago) • 2025-08-19 18:57:36 -0700 Engine • hash f278b0aa3b8c6732ab636563eb8e896c35fc9c79 (revision 9ac4fac) (2 hours ago) • 2025-08-19 23:42:28.000Z Tools • Dart 3.10.0 (build 3.10.0-115.0.dev) • DevTools 2.49.0 ``` /cc @zanderso @jmagman for historics.
…lutter#174088) Closes flutter#173904. It's not clear to me how `git describe --tags HEAD` ever ... worked to determine a fallback. From what I can tell, the _intent_ was to use the latest (newest? closest?) tag as the base version, and then append `-{commitCount}-{shortHash}` as the fallback version number when on `master` (or any non-published branch). So, I rewrote the implementation, unfortunately with 4 separate calls out to `git ...` instead of a single one. There are 20+ tests that fail as a result of this change, mostly because they make specific expectations around `git describe` being invoked, and of course that is no longer the case - putting those aside, I'd like to double check that: 1. I understand what the original command was _intending_ to do 2. We like the _output_ of the updated command 3. ... we either are okay with the implementation, or have an alternative in mind (I'm no `git` master) Wdyt? At this commit: ```sh $ flutter-dev --version Flutter 3.36.0-1.0.pre-170 • channel [user-branch] • https://github.com/matanlurey/flutter Framework • revision 250381a (5 minutes ago) • 2025-08-19 18:57:36 -0700 Engine • hash f278b0aa3b8c6732ab636563eb8e896c35fc9c79 (revision 9ac4fac) (2 hours ago) • 2025-08-19 23:42:28.000Z Tools • Dart 3.10.0 (build 3.10.0-115.0.dev) • DevTools 2.49.0 ``` /cc @zanderso @jmagman for historics.
…lutter#174088) Closes flutter#173904. It's not clear to me how `git describe --tags HEAD` ever ... worked to determine a fallback. From what I can tell, the _intent_ was to use the latest (newest? closest?) tag as the base version, and then append `-{commitCount}-{shortHash}` as the fallback version number when on `master` (or any non-published branch). So, I rewrote the implementation, unfortunately with 4 separate calls out to `git ...` instead of a single one. There are 20+ tests that fail as a result of this change, mostly because they make specific expectations around `git describe` being invoked, and of course that is no longer the case - putting those aside, I'd like to double check that: 1. I understand what the original command was _intending_ to do 2. We like the _output_ of the updated command 3. ... we either are okay with the implementation, or have an alternative in mind (I'm no `git` master) Wdyt? At this commit: ```sh $ flutter-dev --version Flutter 3.36.0-1.0.pre-170 • channel [user-branch] • https://github.com/matanlurey/flutter Framework • revision 250381a (5 minutes ago) • 2025-08-19 18:57:36 -0700 Engine • hash f278b0aa3b8c6732ab636563eb8e896c35fc9c79 (revision 9ac4fac) (2 hours ago) • 2025-08-19 23:42:28.000Z Tools • Dart 3.10.0 (build 3.10.0-115.0.dev) • DevTools 2.49.0 ``` /cc @zanderso @jmagman for historics.
…lutter#174088) Closes flutter#173904. It's not clear to me how `git describe --tags HEAD` ever ... worked to determine a fallback. From what I can tell, the _intent_ was to use the latest (newest? closest?) tag as the base version, and then append `-{commitCount}-{shortHash}` as the fallback version number when on `master` (or any non-published branch). So, I rewrote the implementation, unfortunately with 4 separate calls out to `git ...` instead of a single one. There are 20+ tests that fail as a result of this change, mostly because they make specific expectations around `git describe` being invoked, and of course that is no longer the case - putting those aside, I'd like to double check that: 1. I understand what the original command was _intending_ to do 2. We like the _output_ of the updated command 3. ... we either are okay with the implementation, or have an alternative in mind (I'm no `git` master) Wdyt? At this commit: ```sh $ flutter-dev --version Flutter 3.36.0-1.0.pre-170 • channel [user-branch] • https://github.com/matanlurey/flutter Framework • revision 250381a (5 minutes ago) • 2025-08-19 18:57:36 -0700 Engine • hash f278b0aa3b8c6732ab636563eb8e896c35fc9c79 (revision 9ac4fac) (2 hours ago) • 2025-08-19 23:42:28.000Z Tools • Dart 3.10.0 (build 3.10.0-115.0.dev) • DevTools 2.49.0 ``` /cc @zanderso @jmagman for historics.
Closes #173904.
It's not clear to me how
git describe --tags HEADever ... worked to determine a fallback. From what I can tell, the intent was to use the latest (newest? closest?) tag as the base version, and then append-{commitCount}-{shortHash}as the fallback version number when onmaster(or any non-published branch).So, I rewrote the implementation, unfortunately with 4 separate calls out to
git ...instead of a single one.There are 20+ tests that fail as a result of this change, mostly because they make specific expectations around
git describebeing invoked, and of course that is no longer the case - putting those aside, I'd like to double check that:gitmaster)Wdyt?
At this commit:
$ flutter-dev --version Flutter 3.36.0-1.0.pre-170 • channel [user-branch] • https://github.com/matanlurey/flutter Framework • revision 250381a185 (5 minutes ago) • 2025-08-19 18:57:36 -0700 Engine • hash f278b0aa3b8c6732ab636563eb8e896c35fc9c79 (revision 9ac4facf7e) (2 hours ago) • 2025-08-19 23:42:28.000Z Tools • Dart 3.10.0 (build 3.10.0-115.0.dev) • DevTools 2.49.0/cc @zanderso @jmagman for historics.