Skip to content

Conversation

@zanderso
Copy link
Member

@zanderso zanderso commented Feb 11, 2020

Description

This PR attempts to teach the BotDetector to recognize when the tool is running in the cloud on Azure. This is accomplished by querying the Azure Instance Metadata Service via the non-routable IP address 169.254.169.254. If we don't get a socket connection to that address within one second, this PR assumes that the tool is not on Azure.

Refactorings to support the bot detector now being async are also included.

Related Issues

#4709

Tests

I added the following tests:

Test in bot_detector_test.dart.

Breaking Change

Did any tests fail when you ran them? Please read [Handling breaking changes].

  • No, no existing tests failed, so this is not a breaking change.
  • Yes, this is a breaking change. If not, delete the remainder of this section.

@zanderso zanderso added tool Affects the "flutter" command-line tool. See also t: labels. work in progress; do not review labels Feb 11, 2020
Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

Choose a reason for hiding this comment

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

Make this public and @visibleForTesting so you can unit test it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahh, right. Done.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants