Skip to content

[Tool] Ignore pubspec.lock dirty checkout modifications on non-stable channels#184997

Merged
auto-submit[bot] merged 4 commits into
flutter:masterfrom
bkonyi:ignore_pubspec_lock_upgrade
Apr 28, 2026
Merged

[Tool] Ignore pubspec.lock dirty checkout modifications on non-stable channels#184997
auto-submit[bot] merged 4 commits into
flutter:masterfrom
bkonyi:ignore_pubspec_lock_upgrade

Conversation

@bkonyi
Copy link
Copy Markdown
Contributor

@bkonyi bkonyi commented Apr 13, 2026

On non-stable branches like master or main, dev Dart SDK constraints are automatically written into pubspec.lock files during internal operations. This modified lock file blocks automatic upgrades. This commit filters lock files out of dirty checkout calculations when channel is not stable.

Fixes #178777

… channels

On non-stable branches like master or main, dev Dart SDK constraints are automatically written into pubspec.lock files during internal operations. This modified lock file blocks automatic upgrades. This commit filters lock files out of dirty checkout calculations when channel is not stable.

Fixes flutter#178777
@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Apr 13, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a 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 modifies the upgrade command to allow local changes to pubspec.lock files during upgrades on non-stable branches. The hasUncommittedChanges method was updated to evaluate the Flutter channel and filter git status output accordingly. Feedback suggests refining the file name matching logic to ensure it only targets pubspec.lock and not other files with similar suffixes.

// These files are automatically updated with the active Dart SDK dev
// constraints during internal tool operations, and should not block
// the automatic upgrade workflow.
if (!trimmed.endsWith('pubspec.lock')) {
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.

medium

The check trimmed.endsWith('pubspec.lock') is slightly too permissive as it could match files like another_pubspec.lock or not_a_pubspec.lock. It is safer to check for the exact filename by ensuring it is preceded by a directory separator or a space (which separates the git status code from the path in git status -s output).

Suggested change
if (!trimmed.endsWith('pubspec.lock')) {
if (!trimmed.endsWith('/pubspec.lock') && !trimmed.endsWith(' pubspec.lock')) {

@bkonyi bkonyi added the CICD Run CI/CD label Apr 16, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 20, 2026
@bkonyi bkonyi added the CICD Run CI/CD label Apr 21, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 21, 2026
@bkonyi bkonyi added the CICD Run CI/CD label Apr 21, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 28, 2026
@bkonyi bkonyi added the CICD Run CI/CD label Apr 28, 2026
@bkonyi bkonyi requested a review from chingjun April 28, 2026 15:51
@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 28, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Apr 28, 2026
Merged via the queue into flutter:master with commit 251b0d2 Apr 28, 2026
159 of 160 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flutter master branch shows repeated local changes in pubspec.lock after every upgrade

2 participants