Skip to content

[analytics] propagate env to sub-tools#8976

Merged
pq merged 1 commit into
flutter:mainfrom
pq:analytics_envProp
May 20, 2026
Merged

[analytics] propagate env to sub-tools#8976
pq merged 1 commit into
flutter:mainfrom
pq:analytics_envProp

Conversation

@pq
Copy link
Copy Markdown
Collaborator

@pq pq commented May 20, 2026

Follow-up from #8966 which introduced support for propagating the standard JetBrains telemetry environment variables (DASH__* and FLUTTER_HOST) via the Analytics.updateEnvironment(commandLine) utility, this updates four additional spots where standalone processes are spawned manually using the GeneralCommandLine class, 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)

  • Modification: Invoked Analytics.updateEnvironment(result) inside the toCommandLine() helper before returning the GeneralCommandLine instance. This ensures the background flutter daemon process runs with propagated telemetry parameters.

2. Bazel Test Execution (src/io/flutter/run/bazelTest/BazelTestFields.java)

  • Modification: Invoked Analytics.updateEnvironment(commandLine) in the getLaunchCommand(...) 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)

  • Modification: Invoked Analytics.updateEnvironment(cmdLine) in runWorkspaceFlutterDoctorScript(...) before spawning the workspace-specific doctor script.

4. Bazel File Synchronization (src/io/flutter/run/FlutterReloadManager.java)

  • Modification: Invoked Analytics.updateEnvironment(commandLine) in the syncFiles() helper to propagate the environment variables to the Bazel file synchronization script during reload events.

Review the contribution guidelines below:

  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
  • I've included the required information in the description above.
  • My up-to-date information is in the AUTHORS file.
  • I've updated CHANGELOG.md if appropriate.
Contribution guidelines:
  • See
    our contributor guide and
    the Flutter organization contributor guide
    for general expectations for PRs.
  • Larger or significant changes should be discussed in an issue before creating a PR.
  • Dart contributions to our repos should follow the Dart style guide and use
    dart format.
  • Java and Kotlin contributions should strive to follow Java and Kotlin best
    practices (discussion).

@pq pq requested a review from helin24 May 20, 2026 03:41
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

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

@pq pq merged commit 3ca3bb2 into flutter:main May 20, 2026
8 checks passed
@pq pq deleted the analytics_envProp branch May 20, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[analytics] add missing sub-tool env propagation

2 participants