Skip to content

[ Tool ] Ensure flutter.version.json is regenerated on upgrade#180857

Merged
auto-submit[bot] merged 2 commits into
flutter:masterfrom
bkonyi:issue-178772-incorrect-version
Jan 14, 2026
Merged

[ Tool ] Ensure flutter.version.json is regenerated on upgrade#180857
auto-submit[bot] merged 2 commits into
flutter:masterfrom
bkonyi:issue-178772-incorrect-version

Conversation

@bkonyi

@bkonyi bkonyi commented Jan 12, 2026

Copy link
Copy Markdown
Contributor

The tool performs various checks to determine whether or not to regenerate version information as part of a flutter upgrade instead of just regenerating flutter.version.json as part of each flutter upgrade. This has lead to some situations where the actual framework version doesn't match that reported by the flutter.version.json.

This change updates flutter upgrade to always regenerate flutter.version.json after checking out the new version of the framework to ensure that it contains the latest version information.

Fixes #178926

The tool performs various checks to determine whether or not to
regenerate version information as part of a `flutter upgrade` instead of
just regenerating `flutter.version.json` as part of each `flutter
upgrade`. This has lead to some situations where the actual framework
version doesn't match that reported by the `flutter.version.json`.

This change updates `flutter upgrade` to always regenerate
`flutter.version.json` after checking out the new version of the
framework to ensure that it contains the latest version information.

Fixes flutter#178926
@bkonyi bkonyi requested a review from reidbaker January 12, 2026 18:19
@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jan 12, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 addresses an issue where flutter.version.json was not consistently regenerated during a flutter upgrade, potentially causing version mismatches. The change ensures the version file is always updated after checking out a new framework version by introducing and calling a new updateVersionFile method. The implementation includes a clean refactoring in _FlutterVersionGit and adds a new test to verify the fix. The changes are logical and well-implemented. My feedback is focused on adding documentation for new public members to align with the repository's style guide.

Comment thread packages/flutter_tools/lib/src/version.dart Outdated
Comment thread packages/flutter_tools/test/src/fakes.dart Outdated
@bkonyi bkonyi requested a review from jtmcdole January 14, 2026 15:41

@jtmcdole jtmcdole left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 14, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Jan 14, 2026
Merged via the queue into flutter:master with commit 8af1837 Jan 14, 2026
141 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jan 14, 2026
patrickBillingsley pushed a commit to patrickBillingsley/flutter that referenced this pull request Jan 14, 2026
…tter#180857)

The tool performs various checks to determine whether or not to
regenerate version information as part of a `flutter upgrade` instead of
just regenerating `flutter.version.json` as part of each `flutter
upgrade`. This has lead to some situations where the actual framework
version doesn't match that reported by the `flutter.version.json`.

This change updates `flutter upgrade` to always regenerate
`flutter.version.json` after checking out the new version of the
framework to ensure that it contains the latest version information.

Fixes flutter#178926
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 15, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 15, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 15, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 15, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 15, 2026
ikramhasan pushed a commit to ikramhasan/flutter that referenced this pull request Jan 15, 2026
…tter#180857)

The tool performs various checks to determine whether or not to
regenerate version information as part of a `flutter upgrade` instead of
just regenerating `flutter.version.json` as part of each `flutter
upgrade`. This has lead to some situations where the actual framework
version doesn't match that reported by the `flutter.version.json`.

This change updates `flutter upgrade` to always regenerate
`flutter.version.json` after checking out the new version of the
framework to ensure that it contains the latest version information.

Fixes flutter#178926
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 16, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 16, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 16, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 16, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 16, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 16, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 16, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 17, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 17, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 17, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 18, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 18, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 19, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 19, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 19, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 20, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 20, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 20, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 20, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 20, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 21, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 21, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 21, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 22, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 22, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 22, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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.

Framework and engine flutter doctor mismatch possible

2 participants