Skip to content

Reland "[flutter_tools] forward --offline flag to pub.get in update-packages" - #193838

Merged
auto-submit[bot] merged 5 commits into
flutter:masterfrom
bkonyi:reland_pr_193808
Oct 23, 2026
Merged

auto-submit[bot] merged 5 commits into
flutter:masterfrom
bkonyi:reland_pr_193808

Conversation

@bkonyi

@bkonyi bkonyi commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Relands #193619 (reverted in #193808) with const added to DelegatingToolContext() in update_packages_test.dart to satisfy prefer_const_constructors.

When running flutter update-packages --offline, the --offline flag was parsed and used to validate incompatible option combinations (such as --force-upgrade and --cherry-pick-package), but was not forwarded to the underlying pub.get invocations. Read boolArg(_keyOffline) in _pubGet and forward it to pub.get so that pub does not attempt network operations in offline environments.

Fixes #193423

Pre-launch Checklist

…ackages"

Relands flutter#193619 (reverted in flutter#193808) with `const DelegatingToolContext()` in `update_packages_test.dart` to satisfy `prefer_const_constructors`.

Fixes flutter#193423
@bkonyi bkonyi added CICD Run CI/CD tool Affects the "flutter" command-line tool. See also t: labels. labels Oct 5, 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 adds support for an --offline flag in the UpdatePackagesCommand by passing the offline state to the _pubGet helper and the underlying pub.get call, along with corresponding tests. Feedback suggests simplifying the _pubGet helper method and its call sites by directly accessing the inherited offline instance property instead of passing it as an explicit parameter.

bkonyi added 2 commits October 5, 2026 17:50
Simplifies `_pubGet` and its call sites in `UpdatePackagesCommand.runCommand` by reading `boolArg(_keyOffline)` directly inside `_pubGet` instead of threading an `offline` parameter.
# Conflicts:
#	packages/flutter_tools/lib/src/commands/update_packages.dart
#	packages/flutter_tools/test/commands.shard/hermetic/update_packages_test.dart
@bkonyi
bkonyi marked this pull request as draft October 15, 2026 21:48
@bkonyi bkonyi closed this Oct 16, 2026
@bkonyi bkonyi reopened this Oct 16, 2026
@fluttergithubbot

Copy link
Copy Markdown
Contributor

An existing Git SHA, 6cb79c4368bd9918e47e7ac98ca2dc7f7d556d63, was detected, and no actions were taken.

To re-trigger presubmits after closing or re-opeing a PR, or pushing a HEAD commit (i.e. with --force) that already was pushed before, push a blank commit (git commit --allow-empty -m "Trigger Build") or rebase to continue.

@bkonyi
bkonyi marked this pull request as ready for review October 16, 2026 19:53
@bkonyi
bkonyi requested a review from chingjun October 16, 2026 19:53

@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 updates the _pubGet method in UpdatePackagesCommand to use named parameters, including a new offline parameter derived from command-line arguments. It also updates the _FakePub test utility to record these calls and adds test cases to verify that the offline flag is correctly passed. I have no feedback to provide.

@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 20, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Oct 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 21, 2026
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 21, 2026
@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 23, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 23, 2026
@auto-submit

auto-submit Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/193838, because The base commit of the PR is older than 7 days and can not be merged. Please merge the latest changes from the main into this branch and resubmit the PR.

@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 23, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Oct 23, 2026
Merged via the queue into flutter:master with commit b92c68c Oct 23, 2026
23 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 23, 2026
suryaKommana2662 pushed a commit to suryaKommana2662/flutter that referenced this pull request Oct 29, 2026
…ackages" (flutter#193838)

Relands flutter#193619 (reverted in
flutter#193808) with `const` added to
`DelegatingToolContext()` in `update_packages_test.dart` to satisfy
`prefer_const_constructors`.

When running `flutter update-packages --offline`, the `--offline` flag
was parsed and used to validate incompatible option combinations (such
as `--force-upgrade` and `--cherry-pick-package`), but was not forwarded
to the underlying `pub.get` invocations. Read `boolArg(_keyOffline)` in
`_pubGet` and forward it to `pub.get` so that `pub` does not attempt
network operations in offline environments.

Fixes flutter#193423

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[breaking change policy]: https://flutter.dev/to/breaking-changes
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
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 update-packages --offline does not pass --offline to pub

3 participants