Skip to content

[tool] Migrate SymbolizeCommand to modular dependency injection - #190744

Merged
auto-submit[bot] merged 63 commits into
flutter:masterfrom
bkonyi:di/04-symbolize
Aug 28, 2026
Merged

auto-submit[bot] merged 63 commits into
flutter:masterfrom
bkonyi:di/04-symbolize

Conversation

@bkonyi

@bkonyi bkonyi commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Part 5 of the modular dependency injection migration.

Migrates SymbolizeCommand to explicit constructor dependency injection via ToolContext, removing ambient access from FlutterCommand and adding hermetic unit tests.

Part of #47161

@bkonyi
bkonyi requested review from a team as code owners August 7, 2026 20:58
@bkonyi
bkonyi requested review from reidbaker and removed request for a team August 7, 2026 20:58
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Aug 7, 2026
@github-actions github-actions Bot added tool Affects the "flutter" command-line tool. See also t: labels. team-android Owned by Android platform team team-ios Owned by iOS platform team team-macos Owned by the macOS platform team labels Aug 7, 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 refactors dependency injection in flutter_tools by introducing structured context containers (ToolContext, AndroidContext, AppleContext) and a bootstrapping mechanism (ToolDependencies) to manage tool dependencies instead of relying on global state. Commands such as CleanCommand, ConfigCommand, and SymbolizeCommand are updated to receive their dependencies via these contexts, and tests are refactored to use hermetic testWithoutContext setups. Feedback on the changes suggests using the local finalShutdownHooks reference during file system initialization to prevent duplicate hook instances, and utilizing finalSystemClock.now() instead of DateTime.now() to maintain a mockable time source.

Comment thread packages/flutter_tools/lib/src/context/tool_dependencies.dart Outdated
Comment thread packages/flutter_tools/lib/src/context/tool_dependencies.dart Outdated
@bkonyi
bkonyi force-pushed the di/04-symbolize branch 2 times, most recently from 21b5ea2 to 2c011ef Compare August 11, 2026 19:48
bkonyi added 4 commits August 12, 2026 17:19
# Conflicts:
#	packages/flutter_tools/lib/src/context/tool_dependencies.dart
#	packages/flutter_tools/test/general.shard/context/dependency_injection_test.dart
@bkonyi
bkonyi marked this pull request as ready for review August 28, 2026 14:43

@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 refactors ConfigCommand and SymbolizeCommand to explicitly receive and resolve their dependencies via ToolContext rather than relying on global variables. Consequently, associated unit tests have been migrated from testUsingContext to testWithoutContext using injected fakes. Feedback on the changes includes a suggestion to simplify the createConfigCommand helper in config_test.dart by defaulting to setup instance variables, and a recommendation to correct a test assertion in symbolize_test.dart to ensure it validates the actual injection of ToolContext rather than just checking the command name.

Comment thread packages/flutter_tools/test/commands.shard/hermetic/config_test.dart Outdated
@bkonyi
bkonyi requested review from chingjun and loic-sharma August 28, 2026 16:36

@loic-sharma loic-sharma 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 Aug 28, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Aug 28, 2026
Merged via the queue into flutter:master with commit 4301cf5 Aug 28, 2026
23 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 28, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Aug 30, 2026
flutter/flutter@8d8c1aa...c978386

2026-08-30 [email protected] Roll Skia from ce359c7fbfe6 to 588b550a4dd8 (1 revision) (flutter/flutter#192040)
2026-08-30 [email protected] Roll Skia from 3ae8e3d1e335 to ce359c7fbfe6 (1 revision) (flutter/flutter#192037)
2026-08-30 [email protected] Roll Fuchsia Linux SDK from J123CwfDPYyVDpkMl... to o9DikEfRoFyVK3LKD... (flutter/flutter#192031)
2026-08-29 [email protected] Make the AbsorbPointer sample show the difference from IgnorePointer (flutter/flutter#188940)
2026-08-29 [email protected] Roll Dart SDK from 391ff83cd1d3 to 76abdf94faa8 (1 revision) (flutter/flutter#192021)
2026-08-29 [email protected] Roll Skia from b392fb672d13 to 3ae8e3d1e335 (1 revision) (flutter/flutter#192020)
2026-08-29 [email protected] Roll Skia from 0b4249b26b38 to b392fb672d13 (6 revisions) (flutter/flutter#192016)
2026-08-29 [email protected] Fixes for texture-backed gradients (flutter/flutter#191925)
2026-08-29 [email protected] Roll Dart SDK from ae63a6eca3f1 to 391ff83cd1d3 (3 revisions) (flutter/flutter#192010)
2026-08-29 [email protected] Fix Android license detection for cmdline-tools 23.0+ (flutter/flutter#191554)
2026-08-29 [email protected] [flutter_tools] Pause web server requests until initial compilation finishes (flutter/flutter#191990)
2026-08-28 [email protected] fix(workflow): Mac Verify Binaries needs `Linux mac_android_aot_engine` (flutter/flutter#191999)
2026-08-28 [email protected] Roll Fuchsia Linux SDK from dDxH8G5cDBP602eyG... to J123CwfDPYyVDpkMl... (flutter/flutter#191984)
2026-08-28 [email protected] Update scheduled workflow for more tasks, add goldctl update (flutter/flutter#191991)
2026-08-28 [email protected] Update no-main-prs to leave a comment (flutter/flutter#191973)
2026-08-28 [email protected] [AGP 9.1.0 Migration #4] Replace plugin build-type copy with initWith on public DSL (flutter/flutter#191606)
2026-08-28 [email protected] Roll Skia from fe0b9a5261f9 to 0b4249b26b38 (1 revision) (flutter/flutter#191974)
2026-08-28 [email protected] [UIScene] Migrate dev/benchmarks/macrobenchmarks to UIScene lifecycle (flutter/flutter#191648)
2026-08-28 [email protected] Uiscene migrate remaining apps (flutter/flutter#191652)
2026-08-28 [email protected] [tool] Migrate SymbolizeCommand to modular dependency injection (flutter/flutter#190744)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
bkonyi added a commit to bkonyi/flutter that referenced this pull request Sep 2, 2026
…r#190751)

## Summary

Part 6 of the modular dependency injection migration.

Migrates `ChannelCommand` to explicit constructor dependency injection
via `ToolContext`, removing ambient access from `FlutterCommand` and
adding hermetic unit tests.

Stacked on flutter#190744
Compare:
di/04-symbolize...di/05-channel

Part of flutter#47161
victorsanni pushed a commit to victorsanni/packages that referenced this pull request Sep 9, 2026
…r#12693)

flutter/flutter@8d8c1aa...c978386

2026-08-30 [email protected] Roll Skia from ce359c7fbfe6 to 588b550a4dd8 (1 revision) (flutter/flutter#192040)
2026-08-30 [email protected] Roll Skia from 3ae8e3d1e335 to ce359c7fbfe6 (1 revision) (flutter/flutter#192037)
2026-08-30 [email protected] Roll Fuchsia Linux SDK from J123CwfDPYyVDpkMl... to o9DikEfRoFyVK3LKD... (flutter/flutter#192031)
2026-08-29 [email protected] Make the AbsorbPointer sample show the difference from IgnorePointer (flutter/flutter#188940)
2026-08-29 [email protected] Roll Dart SDK from 391ff83cd1d3 to 76abdf94faa8 (1 revision) (flutter/flutter#192021)
2026-08-29 [email protected] Roll Skia from b392fb672d13 to 3ae8e3d1e335 (1 revision) (flutter/flutter#192020)
2026-08-29 [email protected] Roll Skia from 0b4249b26b38 to b392fb672d13 (6 revisions) (flutter/flutter#192016)
2026-08-29 [email protected] Fixes for texture-backed gradients (flutter/flutter#191925)
2026-08-29 [email protected] Roll Dart SDK from ae63a6eca3f1 to 391ff83cd1d3 (3 revisions) (flutter/flutter#192010)
2026-08-29 [email protected] Fix Android license detection for cmdline-tools 23.0+ (flutter/flutter#191554)
2026-08-29 [email protected] [flutter_tools] Pause web server requests until initial compilation finishes (flutter/flutter#191990)
2026-08-28 [email protected] fix(workflow): Mac Verify Binaries needs `Linux mac_android_aot_engine` (flutter/flutter#191999)
2026-08-28 [email protected] Roll Fuchsia Linux SDK from dDxH8G5cDBP602eyG... to J123CwfDPYyVDpkMl... (flutter/flutter#191984)
2026-08-28 [email protected] Update scheduled workflow for more tasks, add goldctl update (flutter/flutter#191991)
2026-08-28 [email protected] Update no-main-prs to leave a comment (flutter/flutter#191973)
2026-08-28 [email protected] [AGP 9.1.0 Migration flutter#4] Replace plugin build-type copy with initWith on public DSL (flutter/flutter#191606)
2026-08-28 [email protected] Roll Skia from fe0b9a5261f9 to 0b4249b26b38 (1 revision) (flutter/flutter#191974)
2026-08-28 [email protected] [UIScene] Migrate dev/benchmarks/macrobenchmarks to UIScene lifecycle (flutter/flutter#191648)
2026-08-28 [email protected] Uiscene migrate remaining apps (flutter/flutter#191652)
2026-08-28 [email protected] [tool] Migrate SymbolizeCommand to modular dependency injection (flutter/flutter#190744)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
victorsanni pushed a commit to victorsanni/packages that referenced this pull request Sep 9, 2026
…r#12693)

flutter/flutter@8d8c1aa...c978386

2026-08-30 [email protected] Roll Skia from ce359c7fbfe6 to 588b550a4dd8 (1 revision) (flutter/flutter#192040)
2026-08-30 [email protected] Roll Skia from 3ae8e3d1e335 to ce359c7fbfe6 (1 revision) (flutter/flutter#192037)
2026-08-30 [email protected] Roll Fuchsia Linux SDK from J123CwfDPYyVDpkMl... to o9DikEfRoFyVK3LKD... (flutter/flutter#192031)
2026-08-29 [email protected] Make the AbsorbPointer sample show the difference from IgnorePointer (flutter/flutter#188940)
2026-08-29 [email protected] Roll Dart SDK from 391ff83cd1d3 to 76abdf94faa8 (1 revision) (flutter/flutter#192021)
2026-08-29 [email protected] Roll Skia from b392fb672d13 to 3ae8e3d1e335 (1 revision) (flutter/flutter#192020)
2026-08-29 [email protected] Roll Skia from 0b4249b26b38 to b392fb672d13 (6 revisions) (flutter/flutter#192016)
2026-08-29 [email protected] Fixes for texture-backed gradients (flutter/flutter#191925)
2026-08-29 [email protected] Roll Dart SDK from ae63a6eca3f1 to 391ff83cd1d3 (3 revisions) (flutter/flutter#192010)
2026-08-29 [email protected] Fix Android license detection for cmdline-tools 23.0+ (flutter/flutter#191554)
2026-08-29 [email protected] [flutter_tools] Pause web server requests until initial compilation finishes (flutter/flutter#191990)
2026-08-28 [email protected] fix(workflow): Mac Verify Binaries needs `Linux mac_android_aot_engine` (flutter/flutter#191999)
2026-08-28 [email protected] Roll Fuchsia Linux SDK from dDxH8G5cDBP602eyG... to J123CwfDPYyVDpkMl... (flutter/flutter#191984)
2026-08-28 [email protected] Update scheduled workflow for more tasks, add goldctl update (flutter/flutter#191991)
2026-08-28 [email protected] Update no-main-prs to leave a comment (flutter/flutter#191973)
2026-08-28 [email protected] [AGP 9.1.0 Migration flutter#4] Replace plugin build-type copy with initWith on public DSL (flutter/flutter#191606)
2026-08-28 [email protected] Roll Skia from fe0b9a5261f9 to 0b4249b26b38 (1 revision) (flutter/flutter#191974)
2026-08-28 [email protected] [UIScene] Migrate dev/benchmarks/macrobenchmarks to UIScene lifecycle (flutter/flutter#191648)
2026-08-28 [email protected] Uiscene migrate remaining apps (flutter/flutter#191652)
2026-08-28 [email protected] [tool] Migrate SymbolizeCommand to modular dependency injection (flutter/flutter#190744)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.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.

2 participants