-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Remove getInfoHostString and use connectable hostnames. #5079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1e11fb4
to
dcd8c87
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll want to manually test some webframeworks stuff here for sanity.
496ab9a
to
fa56b2f
Compare
const emulators: EmulatorInfo[] = []; | ||
if (experiments.isEnabled("webframeworks")) { | ||
for (const e of EMULATORS_SUPPORTED_BY_UI) { | ||
// TODO: Double check if this actually works -- we're early in the startup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add name/ldap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know the right contact yet but I've started a thread for it internally. If I cannot identify a contact, then I'll just create an internal bug for this TODO.
src/emulator/functionsEmulator.ts
Outdated
setEnvVarsForEmulators(envs); | ||
const eventarcEmulator = this.getEmulatorInfo(Emulators.EVENTARC); | ||
if (eventarcEmulator) { | ||
// TODO: Why do we set the protocol here, but no protocol during emulators:exec? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add name/ldap
Question: What's the semantic difference between "isRunning" and "getInfo" when checking if an Emulator is running/active/enabled - is info populated before isRunning? Why switch from one to the other? |
It is more or less equivalent, and there's no actual difference in timing. But Deeper reason: When using Future consideration: I'm about to create follow-up PRs to change the way emulator listens on hosts (with DNS in mind) and it is necessary to audit the situations where the Side benefit: |
82c9224
to
531baf1
Compare
Codecov ReportBase: 55.75% // Head: 55.95% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #5079 +/- ##
==========================================
+ Coverage 55.75% 55.95% +0.20%
==========================================
Files 305 306 +1
Lines 20529 20469 -60
Branches 4145 4132 -13
==========================================
+ Hits 11445 11454 +9
+ Misses 8101 8039 -62
+ Partials 983 976 -7
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
855eeb9
to
ef03ec7
Compare
…consider emulators running remotely. (#5269) #5079 refactored the way to set environment variables on Functions Emulator. As implemented, the refactored function does not consider "remote" emulators i.e. emulator started by another instance of `emulators:start` command. This broke users who relies this to connect `functions:shell` command to the remote emulators. Fixes #5225
Description
This is a refactor with a subtle behavior change to use correctly-formatted URLs with hostname fixes. This marks the start of a quest to fix IPv6 and DNS related problems.
When given a
0.0.0.0
hostname, we'll try to connect over127.0.0.1
instead to make sure max client compatibility.EmulatorRegistry.getInfo
now returns the transformed hostname by default, since this is usually the desirable behavior. A new helper method is added for creating an API client to an emulator -- a common enough pattern that worth standardizing. This PR also usesEmulatorRegistry.url
for most URL constructions and has removedgetInfoHostString
, which causes more confusions than it helps.Scenarios Tested
Unit test added for the new
connectableHostname
helper.Basic manual testing like starting the emulators.
I'll rely on our CI to catch any remaining errors.
Sample Commands
N/A