Update env for calling tools#8966
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request integrates Analytics.updateEnvironment calls into various command-line generation methods across the Flutter plugin, including SdkFields, BazelFields, DevToolsServerTask, and FlutterCommand. A review comment points out a redundant call to Analytics.updateEnvironment in SdkFields.java, as the command-line object is already updated within the FlutterCommand class.
4 tasks
pq
added a commit
that referenced
this pull request
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: - [x] I’ve reviewed the contributor guide and applied the relevant portions to this PR. - [x] I've included the required information in the description above. - [x] My up-to-date information is in the `AUTHORS` file. - [x] I've updated `CHANGELOG.md` if appropriate. <details> <summary>Contribution guidelines:</summary><br> - See our [contributor guide](../CONTRIBUTING.md) and the [Flutter organization contributor guide]([https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md) 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](https://dart.dev/guides/language/effective-dart) and use `dart format`. - Java and Kotlin contributions should strive to follow Java and Kotlin best practices ([discussion](#8098)). </details>
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.
Fixes #8850
I verified by putting
System.out.println(commandLine.getEnvironment());inSdkFieldsand checking that the new values are present, i.e.: