Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request enhances run and debug session analytics by reporting the specific IntelliJ executor and the Flutter build mode (debug, profile, or release). It introduces helper methods executorFor and buildModeFor in Analytics.kt to map and resolve these values, updates the run and attach configurations to pass this data, and adds comprehensive unit tests. Feedback focuses on a critical issue where buildModeFor expects a non-null Array<String> for extraArgs. If the parsed arguments from the launch fields are null, this will cause a NullPointerException before the try-catch block in recordRunOrDebugSession is reached, potentially crashing the launch process. It is recommended to make extraArgs nullable, update the tests to verify null safety, and update the documentation in ABOUT.md accordingly.
Part of flutter/dash-devexp-internal#193.
Flutter run, attach and test session events now say which executor launched them (
run,debug,coverage,profilerorother), and app and attach sessions say which Flutter build mode they run in (debug,profileorrelease). Until now, a profile or release run looked the same as any other run, and the Android Profiler and Run with Coverage both showed up as plainrun_session.Details
executor: mapped to a fixed value, never the raw executor id (other plugins can define executors). Note thatexecutor=debug(liketype=debug_session) means a debugger is attached, whilebuildMode=debugmeans a debug (JIT) build.buildMode: decided atgetStatetime, where the environment'sFlutterLaunchModeisn't final yet:--release/--profileflags in the configuration's extra args set it: additional args forflutter run, attach args forflutter attach. The args themselves are never sent.profile(it only switches the environment's mode later, inLaunchState.launch).FlutterLaunchMode, which is what the Run Profile/Release actions set.recordRunOrDebugSessionruns ingetState, so it now catches all Throwables, likeAnalytics.report, and can't fail a launch. A null executor id maps toother.SessionDataTestcovers the event shape (including the project, which events need to be delivered), the executor mapping, and each build-mode source.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).