Skip to content

[flutter_tools] forward --offline flag to pub.get in update-packages - #193619

Merged
auto-submit[bot] merged 1 commit into
flutter:masterfrom
bkonyi:issue-193423
Oct 3, 2026
Merged

auto-submit[bot] merged 1 commit into
flutter:masterfrom
bkonyi:issue-193423

Conversation

@bkonyi

@bkonyi bkonyi commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

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. Forward offline through _pubGet to pub.get so that pub does not attempt network operations in offline environments.

Fixes #193423

Pre-launch Checklist

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

When running `flutter update-packages --offline`, the offline flag was parsed
and used to validate incompatible option combinations, but was not forwarded
to the underlying `pub.get` invocations. Forward the parameter so that pub
does not attempt network operations in offline environments.

Fixes flutter#193423
@bkonyi bkonyi added the CICD Run CI/CD label Oct 1, 2026
@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Oct 1, 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 the --offline flag in the update-packages command, propagating the offline setting to all internal pub get calls. It also updates the test suite to verify that the offline flag is correctly passed. There are no review comments, and I have no feedback to provide.

@bkonyi
bkonyi requested a review from chingjun October 2, 2026 15:29
@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 2, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Oct 2, 2026
Merged via the queue into flutter:master with commit de6c00b Oct 3, 2026
27 of 28 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 3, 2026
@cbracken

cbracken commented Oct 5, 2026

Copy link
Copy Markdown
Member

Reason for revert: info • Use 'const' with the constructor to improve performance. Try adding the 'const' keyword to the constructor invocation • packages/flutter_tools/test/commands.shard/hermetic/update_packages_test.dart:315:24 • prefer_const_constructors

@cbracken cbracken added the revert Autorevert PR (with "Reason for revert:" comment) label Oct 5, 2026
@flutteractionsbot

Copy link
Copy Markdown
Contributor

Successfully created revert PR: #193808

@flutteractionsbot flutteractionsbot removed the revert Autorevert PR (with "Reason for revert:" comment) label Oct 5, 2026
dayanruben pushed a commit to dayanruben/flutter that referenced this pull request Oct 5, 2026
…ackages (flutter#193808)

Reverts: [[flutter_tools] forward --offline flag to pub.get in
update-packages](flutter#193619)

Initiated by: @cbracken

Reason for reverting: info • Use 'const' with the constructor to improve
performance. Try adding the 'const' keyword to the constructor
invocation •
packages/flutter_tools/test/commands.shard/hermetic/update_packages_test.dart:315:24
• prefer_const_constructors

Original PR Author: @bkonyi

Reviewed By: @chingjun

The original PR description is provided below:

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. Forward `offline` through
`_pubGet` 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.
opensource-fork-sync Bot pushed a commit to cla7aye15I4nd/opensource-flutter__flutter that referenced this pull request Oct 23, 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
suryaKommana2662 pushed a commit to suryaKommana2662/flutter that referenced this pull request Oct 29, 2026
…lutter#193619)

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. Forward `offline` through
`_pubGet` 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.
suryaKommana2662 pushed a commit to suryaKommana2662/flutter that referenced this pull request Oct 29, 2026
…ackages (flutter#193808)

Reverts: [[flutter_tools] forward --offline flag to pub.get in
update-packages](flutter#193619)

Initiated by: @cbracken

Reason for reverting: info • Use 'const' with the constructor to improve
performance. Try adding the 'const' keyword to the constructor
invocation •
packages/flutter_tools/test/commands.shard/hermetic/update_packages_test.dart:315:24
• prefer_const_constructors

Original PR Author: @bkonyi

Reviewed By: @chingjun

The original PR description is provided below:

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. Forward `offline` through
`_pubGet` 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.
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

4 participants