Skip to content

[tool] Migrate DevFS to modular dependency injection - #192836

Merged
auto-submit[bot] merged 5 commits into
flutter:masterfrom
bkonyi:di/23a-devfs
Sep 18, 2026
Merged

auto-submit[bot] merged 5 commits into
flutter:masterfrom
bkonyi:di/23a-devfs

Conversation

@bkonyi

@bkonyi bkonyi commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Part 23a of the modular dependency injection migration.

@bkonyi bkonyi added tool Affects the "flutter" command-line tool. See also t: labels. CICD Run CI/CD labels Sep 15, 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 the flutter_tools codebase to improve dependency injection by explicitly passing required services (such as FileSystem, Logger, Artifacts, Platform, and ProcessManager) through constructors instead of relying on global state. This change affects several classes, including FlutterDevice, ResidentRunner, HotRunner, ColdRunner, TestCommand, and FlutterTestRunner. The review comments highlight opportunities to further optimize these changes by passing existing Config instances instead of defaulting to Config.test() and by reducing state duplication when instantiating OperatingSystemUtils.

@flutter-dashboard

Copy link
Copy Markdown

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #192836 at sha 8a7608e

@flutter-dashboard flutter-dashboard Bot added the will affect goldens Changes to golden files label Sep 17, 2026
@bkonyi
bkonyi requested a review from dcharkes September 17, 2026 18:12
required ProcessManager processManager,
required Artifacts artifacts,
required BuildMode buildMode,
required ToolContext toolContext,

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.

For my understanding:
Interesting there's a ton of properties in here that are all set at the same time.
Is it usually the case that none of these change individually?
I suspect the answer is that none of them changes individually because they were globals so they're likely singletons (except for mocks in tests).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, these instances were all singletons before or created early on in the process and passed around as parameters. We'll never replace these instances with new ones.

@bkonyi bkonyi removed the will affect goldens Changes to golden files label Sep 17, 2026
@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 17, 2026
@flutter-dashboard

Copy link
Copy Markdown

Golden file changes are available for triage from new commit, Click here to view.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #192836 at sha 3d421ee

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. will affect goldens Changes to golden files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants