Repository navigation
Add Event.migrateEvent for the dart migrate tool. - #2682
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for tracking dart migrate events by introducing the Event.migrateEvent constructor and the corresponding DashEvent.migrateEvent enum value. It also includes unit tests to verify the construction of these events and updates the test counter for accounted events. There are no review comments, and the changes look clean and well-tested, so I have no additional feedback to provide.
PR HealthCoverage ✔️
This check for test coverage is informational (issues shown here will not fail the PR). This check can be disabled by tagging the PR with License Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
This check can be disabled by tagging the PR with Breaking changes ✔️
This check can be disabled by tagging the PR with Unused Dependencies ✔️
For details on how to fix these, see dependency_validator. This check can be disabled by tagging the PR with
API leaks
|
| Package | Leaked API symbol | Leaking sources |
|---|---|---|
| unified_analytics | Condition | survey_handler.dart::Survey::conditionList survey_handler.dart::Survey::new::conditionList |
| unified_analytics | PersistedSurvey | survey_handler.dart::SurveyHandler::fetchPersistedSurveys |
| unified_analytics | GAClient | analytics.dart::Analytics::fake::gaClient analytics.dart::AnalyticsImpl::new::gaClient |
| unified_analytics | UserProperty | analytics.dart::FakeAnalytics::userProperty |
This check can be disabled by tagging the PR with skip-leaking-check.
Changelog Entry ✔️
| Package | Changed Files |
|---|
Changes to files need to be accounted for in their respective changelogs.
This check can be disabled by tagging the PR with skip-changelog-check (for example, for non-user-visible changes when the package version is already at -wip).
|
|
||
| /// Event that is emitted by the analysis server for `dart migrate`. | ||
| /// | ||
| /// * [type] - the kind of migrate event. |
There was a problem hiding this comment.
can you give an example in the dartdoc of what a couple values for this may be?
There was a problem hiding this comment.
Done.
Each run event will contain fromVersion, toVersion and flags and steps. Essentially covering the initial command run the user did.
Each round event will contain the information for each version n -> version n+1 bump and how long that took.
We may also need a step event to measure success/failure within each step and how long the step took.
Anyways, I'll hold off from making the comment too specific for now. I can circle back once we have those analytics created and submitted.
kenzieschmoll
left a comment
There was a problem hiding this comment.
LGTM with one comment
Roll `tools_rev` to c1471db9c0fead64394eab4834d0fb640403b42a and replace `dartdev`'s duplicate `_isRunningOnBot` implementation with `Analytics.isBot` from `package:unified_analytics`, which ignores falsy `CI` and `BOT` environment values (`false`, `0`, empty). Rolling `package:unified_analytics` also defaults `Analytics.agent` to `AiAgent.detectAgentName(Platform.environment)` for SDK tools such as `analysis_server` and `dtd` when `agent` is omitted, and tightens `AiAgent.cursor` detection. tools (https://github.com/dart-lang/tools/compare/350bde5..c1471db): c1471db9 Fri Oct 16 09:35:21 2026 -0700 Kevin Moore [unified_analytics] Fix Cursor agent check, default agent & add isBot (dart-lang/tools#2687) 2d0d09a1 Fri Oct 16 15:37:59 2026 +0000 Phil Quitslund [unified_analytics] Prepare for 8.1.0 release (dart-lang/tools#2684) 7ea42bf6 Thu Oct 15 11:13:58 2026 -0700 Kallen Tu Add Event.migrateEvent for the dart migrate tool. (dart-lang/tools#2682) 4eaf46ba Wed Oct 14 18:18:45 2026 +0000 Kevin Moore [markdown] Fix LinkParser edge cases and BlockParser retreat loop (dart-lang/tools#2631) 03f7124a Wed Oct 14 11:15:00 2026 -0700 Kevin Moore [markdown] Add tool/update_spec_tests.dart and sync GFM 0.29.0.gfm.13 spec stats (dart-lang/tools#2666) e0c90075 Tue Oct 13 16:16:23 2026 -0700 Morgan :) [code_builder] publish 4.13.0 (dart-lang/tools#2663) Fixes #64594 Fixes #64591 TEST=pkg/dartdev/test/analytics_test.dart Change-Id: I71026772917d60df2ef144cc5527be9002f087f6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/565421 Commit-Queue: Kevin Moore <[email protected]> Reviewed-by: Keerti Parthasarathy <[email protected]>
(Coded with the help of Claude. Let me know if there's anything missing!)
Adds a
migrate_eventDashEvent and a genericEvent.migrateEventconstructor for the analysis server to report ondart migrate.The constructor takes a
type, which identifies the kind of migrate event, andCustomMetricsholding that event's data. The analysis server defines the event types and their data, so it can add more migrate analytics without another change to this package.