Skip to content

[flutter_tools] Migrate DriveCommand, FlutterDriverFactory, and WebDriverService to constructor DI - #193543

Merged
auto-submit[bot] merged 10 commits into
flutter:masterfrom
bkonyi:di/22b-2-drive-and-web-driver
Oct 3, 2026
Merged

auto-submit[bot] merged 10 commits into
flutter:masterfrom
bkonyi:di/22b-2-drive-and-web-driver

Conversation

@bkonyi

@bkonyi bkonyi commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Migrates DriveCommand, FlutterDriverFactory, and WebDriverService to explicit constructor dependency injection via ToolContext, Analytics, BuildSystem, and BuildTargets.

Fork diff: bkonyi/flutter@master...di/22b-2-drive-and-web-driver

Part of #188471

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.

@bkonyi bkonyi added the CICD Run CI/CD label Sep 30, 2026
@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Sep 30, 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 across several Flutter tool commands and services, including the daemon and drive commands, by explicitly passing buildSystem, buildTargets, analytics, and xcode dependencies rather than relying on global state. In web_driver_service.dart, the platform parameter in getDesiredCapabilities is now required. Feedback on these changes highlights a compilation error in web_driver_service.dart where platform was removed from the ToolContext destructuring in startTest but is now required by getDesiredCapabilities.

# Conflicts:
#	packages/flutter_tools/test/general.shard/drive/web_driver_service_test.dart
@bkonyi
bkonyi requested review from a team as code owners September 30, 2026 04:12
@github-actions github-actions Bot added team-ios Owned by iOS platform team team-macos Owned by the macOS platform team labels Sep 30, 2026
…web-driver

# Conflicts:
#	packages/flutter_tools/test/general.shard/drive/web_driver_service_test.dart
@github-actions github-actions Bot removed team-ios Owned by iOS platform team team-macos Owned by the macOS platform team labels Oct 2, 2026
@bkonyi
bkonyi requested review from chingjun and dcharkes October 2, 2026 18:47
@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 3280748 Oct 3, 2026
22 of 23 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 3, 2026
suryaKommana2662 pushed a commit to suryaKommana2662/flutter that referenced this pull request Oct 29, 2026
…iverService to constructor DI (flutter#193543)

Migrates `DriveCommand`, `FlutterDriverFactory`, and `WebDriverService`
to explicit constructor dependency injection via `ToolContext`,
`Analytics`, `BuildSystem`, and `BuildTargets`.

Fork diff:
bkonyi/flutter@master...di/22b-2-drive-and-web-driver

Part of flutter#188471

## 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.
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