Skip to content

[flutter_tools] Share Analytics.isBot and make isRunningOnBot sync - #194744

Merged
auto-submit[bot] merged 10 commits into
flutter:masterfrom
kevmoo:sync-bot-detector-194405
Nov 9, 2026
Merged

auto-submit[bot] merged 10 commits into
flutter:masterfrom
kevmoo:sync-bot-detector-194405

Conversation

@kevmoo

@kevmoo kevmoo commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Delegates BotDetector.isRunningOnBot to Analytics.isBot and converts BotDetector.isRunningOnBot and globals.isRunningOnBot from Future<bool> to synchronous bool.

Fixes #194405

Pre-launch Checklist

Bumps unified_analytics to 8.2.0, delegates BotDetector.isRunningOnBot
to Analytics.isBot, and converts BotDetector.isRunningOnBot and
globals.isRunningOnBot from Future<bool> to synchronous bool.

Fixes flutter#194405
@kevmoo
kevmoo requested review from a team as code owners October 19, 2026 15:00
@kevmoo
kevmoo requested review from gmackall and removed request for a team October 19, 2026 15:00
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Oct 19, 2026
@github-actions github-actions Bot added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. platform-macos Building on or for macOS specifically a: desktop Running on desktop team-android Owned by Android platform team team-ios Owned by iOS platform team team-macos Owned by the macOS platform team labels Oct 19, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors BotDetector.isRunningOnBot to be synchronous, returning bool instead of Future<bool>, and delegates environment checks to Analytics.isBot from the updated unified_analytics package (version 8.2.0). This change propagates across the codebase, removing unnecessary await keywords and simplifying context runner initialization. Feedback suggests localizing _platform.environment to a local variable in BotDetector.isRunningOnBot to improve readability and avoid repeated lookups.

@kevmoo
kevmoo marked this pull request as draft October 19, 2026 15:04
…94405

Resolves packages/flutter_tools/pubspec.yaml and pubspec.lock to origin/master
(unified_analytics 8.2.0 rolled in flutter#194819) and caches _platform.environment
locally in BotDetector.isRunningOnBot.
@kevmoo
kevmoo marked this pull request as ready for review October 21, 2026 21:10

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors BotDetector.isRunningOnBot from an asynchronous getter returning Future<bool> to a synchronous getter returning bool, delegating the environment check to Analytics.isBot from package:unified_analytics. Consequently, all asynchronous calls to this getter across the codebase, including tests and helper methods, have been updated to run synchronously. Feedback on the changes points out that runInContext in context_runner.dart is still marked async but no longer contains any await expressions, which will trigger an unnecessary_async warning; adding await to the context.run call is suggested to resolve this.

@github-actions github-actions Bot removed platform-ios iOS applications specifically platform-macos Building on or for macOS specifically a: desktop Running on desktop team-ios Owned by iOS platform team team-macos Owned by the macOS platform team labels Oct 29, 2026
@github-actions github-actions Bot added platform-ios iOS applications specifically platform-macos Building on or for macOS specifically a: desktop Running on desktop labels Oct 29, 2026
@github-actions github-actions Bot added team-ios Owned by iOS platform team team-macos Owned by the macOS platform team labels Oct 29, 2026
@cbracken

cbracken commented Nov 5, 2026

Copy link
Copy Markdown
Member

@kevmoo looks like there are some merge conflicts to resolve.
/cc @vashworth (for iOS) @bkonyi (for tool)

@cbracken
cbracken requested a review from vashworth November 5, 2026 22:31
bkonyi
bkonyi previously approved these changes Nov 6, 2026

@bkonyi bkonyi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kevmoo

kevmoo commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged master to resolve a conflict in runner.dart (one-line: !await botDetector.isRunningOnBot → !botDetector.isRunningOnBot); no other changes. Re-requesting since the push dismissed the approval.

@kevmoo
kevmoo requested a review from bkonyi November 6, 2026 20:07
@kevmoo kevmoo added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 9, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Nov 9, 2026
Merged via the queue into flutter:master with commit 368b7ae Nov 9, 2026
21 checks passed
@kevmoo
kevmoo deleted the sync-bot-detector-194405 branch November 9, 2026 20:48
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Nov 10, 2026
flutter/flutter@d463821...fffd8c2

2026-11-10 [email protected] Roll Fuchsia Test Scripts from 8QcsP_SmbsT09VgUs... to PXc5D7S_q6sIYpfFJ... (flutter/flutter#196273)
2026-11-10 [email protected] [web] Accept the capped letter spacing line shift in kitchensink (flutter/flutter#196148)
2026-11-10 [email protected] Fix Vulkan MSAA diagonal seam in FramebufferBlend (flutter/flutter#196197)
2026-11-10 [email protected] Read back images on the raster thread on OpenGLES (flutter/flutter#195927)
2026-11-10 [email protected] [web] Unify ui.Paint across CanvasKit and Skwasm (flutter/flutter#196071)
2026-11-10 [email protected] Roll Fuchsia Test Scripts from p3N3B-Kchh1bthB6n... to 8QcsP_SmbsT09VgUs... (flutter/flutter#196249)
2026-11-09 [email protected] [Impeller] Reland clipped BackdropFilter square corners fix (flutter/flutter#195716)
2026-11-09 [email protected] [web] Recreate canvas and context on CkOffscreenSurface resize to fix WebGL clipping (flutter/flutter#192769)
2026-11-09 [email protected] Roll Dart SDK from ee0f66fa0ad2 to a2baae273bb2 (1 revision) (flutter/flutter#196245)
2026-11-09 [email protected] Add Mac web_tool_tests_1_2 and _2_2 in bringup (flutter/flutter#196241)
2026-11-09 [email protected] Roll pub packages (flutter/flutter#196246)
2026-11-09 [email protected] Increase number of 'Windows tool_integration_tests' subshards (flutter/flutter#196243)
2026-11-09 [email protected] Roll Fuchsia Test Scripts from Jo-ZgQSNDuPsjlZ4s... to p3N3B-Kchh1bthB6n... (flutter/flutter#196238)
2026-11-09 [email protected] Skip UIScene pre-migration test cases on Xcode 27 (flutter/flutter#194755)
2026-11-09 [email protected] [flutter_tools] Share Analytics.isBot and make isRunningOnBot sync (flutter/flutter#194744)
2026-11-09 [email protected] [flutter_tools] Retry chromedriver startup when its port is taken (flutter/flutter#196150)
2026-11-09 [email protected] Remove unused vulkan_provider.cc (flutter/flutter#195513)
2026-11-09 [email protected] Roll Dart SDK from 3b174b7217fe to ee0f66fa0ad2 (13 revisions) (flutter/flutter#196217)
2026-11-09 [email protected] Goma is dead, long live RBE! (Take 2) (flutter/flutter#196212)
2026-11-09 [email protected] Split DevTools customer tests into its own customer_testing_devtools shard (flutter/flutter#195871)
2026-11-09 [email protected] Split mac_host_{debug,profile,release}_arm64_tests into one step per type (flutter/flutter#196031)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: desktop Running on desktop autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD platform-ios iOS applications specifically platform-macos Building on or for macOS specifically team-android Owned by Android platform team team-ios Owned by iOS platform team team-macos Owned by the macOS platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[flutter_tools] Remove AzureDetector IMDS probe from BotDetector

3 participants