Repository navigation
[analytics]Use unified_analytics getEnvironment() for deep link flutt… - #10077
Merged
Merged
Conversation
keertip
requested review from
a team,
bkonyi and
kenzieschmoll
as code owners
November 6, 2026 20:54
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates DeeplinkManager to construct the environment for started flutter processes using getEnvironment() from package:unified_analytics (upgraded to ^8.4.0), ensuring correct handling of root tools and inherited analytics suppression. Unit tests have been added to verify this behavior. The reviewer suggested declaring the _ideToDashTool map as static const instead of static final to avoid runtime initialization.
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 #10051. Resolves the TODO for #9702.
DeeplinkManagerbuilt the environment for theflutter analyzeprocesses it starts by hand, with a string map from the?ide=query parameter toDASH__TOOLlabels. It now usesgetEnvironment()frompackage:unified_analytics8.4.0, which is now possible because the repo requires Dart ^3.11.0.Changes
DeeplinkManager.buildEnvironment(), marked@visibleForTesting:getEnvironment(currentTool: DashTool.devtools, suppressAnalytics: ...), which passes on this process's root tool fromDASH__TOOL(falling back todevtools) and setsDASH__SUPPRESS_ANALYTICS.DASH__TOOLwhen?ide=names a known IDE, because the IDE that opened DevTools is the user's entry point for the request. The IDE map now usesDashToolvalues.DASH__SUPPRESS_ANALYTICS=truewhensuppressAnalyticsis true. On its own,getEnvironment()lets an inheritedDASH__SUPPRESS_ANALYTICS=false(whichdartsets for its child processes) win.devtools_sharednow depends onunified_analytics: ^8.4.0, anddevtools_appmoves from^7.0.0to^8.4.0. The Dart SDK already pins 8.4.0.Behavior changes
?ide=value now passes on the inherited root tool instead of alwaysdevtools.suppressAnalytics: false, an inheritedDASH__SUPPRESS_ANALYTICS=trueis passed on instead of being reset tofalse.Follow-up
dart-lang/tools#2803 adds
fallbackRootTooltogetEnvironment(), so the IDE override here can be replaced with a single call.Testing
buildEnvironmenttests: IDE mapping, unknown or missing IDE, root-tool validity, suppression, and environment pass-through.dart analyze --fatal-infosanddart testinpackages/devtools_shared: all pass.