Skip to content

Commit 8d0df7d

Browse files
authored
[flutter_tools] Explicitly track host CPU architecture in command result analytics (flutter#191836)
Upgrades `package:unified_analytics` to `8.0.18` and passes `globals.os.hostPlatform.platformName` to `Event.flutterCommandResult` to explicitly track host architecture across all host operating systems. Fixes flutter#191765 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent d6ffa40 commit 8d0df7d

5 files changed

Lines changed: 13 additions & 5 deletions

File tree

‎packages/flutter_tools/lib/src/runner/flutter_command.dart‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1531,8 +1531,9 @@ abstract class FlutterCommand extends Command<void> {
15311531
Event.flutterCommandResult(
15321532
commandPath: commandPath,
15331533
result: commandResult.toString(),
1534-
maxRss: maxRss,
15351534
commandHasTerminal: hasTerminal,
1535+
hostArch: _os.hostPlatform.cliName,
1536+
maxRss: maxRss,
15361537
),
15371538
);
15381539

‎packages/flutter_tools/lib/src/runner/flutter_command_runner.dart‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@ class FlutterCommandRunner extends CommandRunner<void> {
605605
commandPath: 'version',
606606
result: 'success',
607607
commandHasTerminal: stdio.hasTerminal,
608+
hostArch: _toolContext.os.hostPlatform.cliName,
608609
),
609610
);
610611
final FlutterVersion version = flutterVersion.fetchTagsAndGetVersion(clock: systemClock);

‎packages/flutter_tools/test/commands.shard/permeable/build_appbundle_test.dart‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ void main() {
308308
commandPath: 'create',
309309
result: 'success',
310310
commandHasTerminal: false,
311+
hostArch: globals.os.hostPlatform.cliName,
311312
maxRss: processInfo.maxRss,
312313
),
313314
),

‎packages/flutter_tools/test/general.shard/runner/flutter_command_runner_test.dart‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ void main() {
212212
commandPath: 'version',
213213
result: 'success',
214214
commandHasTerminal: false,
215+
hostArch: globals.os.hostPlatform.cliName,
215216
),
216217
),
217218
);

‎packages/flutter_tools/test/general.shard/runner/flutter_command_test.dart‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,9 @@ void main() {
425425
Event.flutterCommandResult(
426426
commandPath: 'dummy',
427427
result: 'success',
428-
maxRss: 10,
429428
commandHasTerminal: false,
429+
hostArch: globals.os.hostPlatform.cliName,
430+
maxRss: 10,
430431
),
431432
),
432433
);
@@ -449,8 +450,9 @@ void main() {
449450
Event.flutterCommandResult(
450451
commandPath: 'dummy',
451452
result: 'warning',
452-
maxRss: 10,
453453
commandHasTerminal: false,
454+
hostArch: globals.os.hostPlatform.cliName,
455+
maxRss: 10,
454456
),
455457
),
456458
);
@@ -472,8 +474,9 @@ void main() {
472474
Event.flutterCommandResult(
473475
commandPath: 'dummy',
474476
result: 'fail',
475-
maxRss: 10,
476477
commandHasTerminal: false,
478+
hostArch: globals.os.hostPlatform.cliName,
479+
maxRss: 10,
477480
),
478481
),
479482
);
@@ -578,8 +581,9 @@ void main() {
578581
Event.flutterCommandResult(
579582
commandPath: 'dummy',
580583
result: 'killed',
581-
maxRss: 10,
582584
commandHasTerminal: false,
585+
hostArch: globals.os.hostPlatform.cliName,
586+
maxRss: 10,
583587
),
584588
),
585589
);

0 commit comments

Comments
 (0)