[analytics] propagate env to sub-tools#8976
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request integrates analytics environment updates into several command-line execution paths within the Flutter plugin. Specifically, it adds calls to Analytics.updateEnvironment() in FlutterDoctorAction, FlutterReloadManager, BazelTestFields, and DeviceDaemon to ensure the environment is correctly configured before running external processes. I have no feedback to provide.
helin24
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up from #8966 which introduced support for propagating the standard JetBrains telemetry environment variables (
DASH__*andFLUTTER_HOST) via theAnalytics.updateEnvironment(commandLine)utility, this updates four additional spots where standalone processes are spawned manually using theGeneralCommandLineclass, ensuring environment variables are propagated correctly in those contexts as well.Fixes: #8975
Changes
1. Device Daemon Spawning (
src/io/flutter/run/daemon/DeviceDaemon.java)Analytics.updateEnvironment(result)inside thetoCommandLine()helper before returning theGeneralCommandLineinstance. This ensures the backgroundflutter daemonprocess runs with propagated telemetry parameters.2. Bazel Test Execution (
src/io/flutter/run/bazelTest/BazelTestFields.java)Analytics.updateEnvironment(commandLine)in thegetLaunchCommand(...)method before returning the constructed command line, allowing the Bazel test runner process to receive the telemetry variables.3. Bazel Flutter Doctor Execution (
src/io/flutter/actions/FlutterDoctorAction.java)Analytics.updateEnvironment(cmdLine)inrunWorkspaceFlutterDoctorScript(...)before spawning the workspace-specific doctor script.4. Bazel File Synchronization (
src/io/flutter/run/FlutterReloadManager.java)Analytics.updateEnvironment(commandLine)in thesyncFiles()helper to propagate the environment variables to the Bazel file synchronization script during reload events.Review the contribution guidelines below:
AUTHORSfile.CHANGELOG.mdif appropriate.Contribution guidelines:
our contributor guide and
the Flutter organization contributor guide
for general expectations for PRs.
dart format.practices (discussion).