-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: Update Emulator configuration function #719
Conversation
Investigating why the code changes didn't update the integration tests goldens!! |
Integration test files are manually updated, introduced some errors to see if the cache delete takes effect. Apparently, the integration tests are running irrespective of the code changes!! PS: Command used to rotate the cache key: cc: @bshaffer |
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.
This looks great! Only suggestion is we should use the noal-coalescing assignment operator (??=
) to ensure that these are defaults that can be overwritten by the user.
See #720 where I've added the operator to the AST
$options['apiEndpoint'] = $emulatorHost; | ||
$options['transportConfig']['grpc']['stubOpts']['credentials'] = ChannelCredentials::createInsecure(); | ||
$options['credentials'] = new InsecureCredentialsWrapper(); |
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.
The only problem I see is that where before this was providing default values, it's now overwriting any user-supplied values. What if we use ??=
instead?
$options['apiEndpoint'] = $emulatorHost; | |
$options['transportConfig']['grpc']['stubOpts']['credentials'] = ChannelCredentials::createInsecure(); | |
$options['credentials'] = new InsecureCredentialsWrapper(); | |
$options['apiEndpoint'] ??= $emulatorHost; | |
$options['transportConfig']['grpc']['stubOpts']['credentials'] ??= ChannelCredentials::createInsecure(); | |
$options['credentials'] ??= new InsecureCredentialsWrapper(); |
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.
Once the customer set the emulator environment variable, endpoint and credentials should be REPLACED to the emulator end point. WDYT?
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 personally don't like that, I think they should just be defaults... I don't ever think an environment variable should REPLACE something in code - they should always function as a default
Resolves #717
BEGIN_COMMIT_OVERRIDE
feat: add emulator support for Bigtable and Spanner clients (#719)
END_COMMIT_OVERRIDE