Skip to content

Conversation

@rajveermalviya
Copy link
Member

@rajveermalviya rajveermalviya commented Nov 20, 2025

Stacked on top of #2009

Since flutter/flutter@e45fd36aa the flutter tool now uses a combination of git commands, instead of using the result of git describe to generate the version string.

So, we update the check to use the same commands here, and then do some transformations to match the string from the flutter tool:
https://github.com/flutter/flutter/blob/9f383e099/packages/flutter_tools/lib/src/version.dart#L1162

Fixes: #1851

@chrisbobbe
Copy link
Collaborator

Hmm CI is failing, could you take a look?

@rajveermalviya rajveermalviya force-pushed the pr-flutter-version-check branch from 5f5471e to fd5eb30 Compare December 10, 2025 13:20
@chrisbobbe
Copy link
Collaborator

Hmm looks like CI is failing again.

@rajveermalviya rajveermalviya marked this pull request as draft December 11, 2025 17:15
See:
    https://github.com/actions/checkout/blob/8e8c483db/action.yml#L74-L76

Without this change, the main branch is not fetched when the
current branch is non-main. We need this because soon we will run
the `flutter_version` suite in CI only when there are changes in
`pubspec.yaml` or `tools/check` files. For that, we need the `main`
branch to be able to calculate the file diff.

Otherwise the suite will fail when calling `git_base_commit` saying:

    fatal: Not a valid object name refs/remotes/origin/main
Flutter's new versioning depends on the latest tag pushed upstream.
And we are going to add the check for Flutter version string back
soon. To avoid frequent CI failures that may be caused by a new tag
being pushed upstream, run the flutter_version check in CI only
when there are changes in the `pubspec.yaml` or `tools/check` files.
Since flutter/flutter@e45fd36aa
the flutter tool now uses a combination of git commands, instead of
using the result of `git describe` to generate the version string.

So, we update the check to use the same commands here, and then do
some transformations to match the string from the flutter tool:
  https://github.com/flutter/flutter/blob/9f383e099/packages/flutter_tools/lib/src/version.dart#L1162

Fixes: zulip#1851
@rajveermalviya rajveermalviya force-pushed the pr-flutter-version-check branch from fd5eb30 to 5389e66 Compare December 15, 2025 16:58
@rajveermalviya rajveermalviya marked this pull request as ready for review December 15, 2025 16:59
@rajveermalviya rajveermalviya added the maintainer review PR ready for review by Zulip maintainers label Dec 15, 2025
@rajveermalviya
Copy link
Member Author

@chrisbobbe This PR is ready for review now, PTAL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer review PR ready for review by Zulip maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update the flutter_version check to follow upstream

2 participants