-
Notifications
You must be signed in to change notification settings - Fork 620
Custom Endpoint Support #1630
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
Comments
Small title change to make sure it's clear we want to support "http://any-uri" as opposed to only official service emulators. |
@danoscarmike might also be interested in the idea like this. |
I'm would be super excited to see this feature merged in the next release (custom endpoints are very very helpful for people who operate behind forward proxies). I can open a PR in the next days that puts a function very similar to {Datastore|PubSub}.prototype.determineBaseUrl_ in common.utils and then use it across the different services. Rodrigo |
Are these individual environment variables? That seems lousy. I would much rather have this be a parameter that can be passed to clients. Individual environment variables means we are always chasing the full list of APIs; a consistent parameters is a one-and-done. |
PubSub does expose a parameter (vs. other services that use environment variables): I prefer the parameter approach as well. @lukesneeringer any other comments on the suggested changes? I can start writing some code for GCE |
The other primary comment I have is whether or not the client objects wrap a common object (I think they do). If they do, then the best answer is to place the It looks like it needs to be explicitly passed -- see here in Spanner, for instance. That value just needs to change to |
I believe this was originally a @jgeewax request to have env vars for each. I think the nice part of env vars is you don't have to modify your code depending on where your app is running. Either way, we should expose at least an override via |
You can always have your code set a value based on your own environment variable. Not so much the converse. If you are in a situation where environment variables are inconvenient, there is not much you can do. |
Silly question. I'm extracting determineBaseUrl in
to pickup my local changes. I'm not 100% sure how the publishing process works for this project. Should I submit a PR for the changes in common and common-grpc first and then bump the version in the other service packages before submitting the "actual" changes or is there a clever way of building everything that I'm missing out? |
It's fine to put it in one PR. We don't have automated releases, so I'll be manually testing / publishing anyway :) Just a tip, we have an npm run script that you can run from the root directory of the project: $ npm run link-common |
Just opened a PR. A few things: I only added support for bigquery, bigtable, compute, datastore, dns and language since the change set is already getting big. If everything looks OK, I can continue with the 2nd half. The build is failing because there are changes under common that are not picked up by the build. Should the build do It has the |
@alexander-fenster do we still want environment variable support for endpoints, or is an option, i.e. |
We have 3 different API types: Not supported
Already supported!
Does anyone have thoughts on how we should support this concept of a custom API endpoint? |
I might be a little bit out of context, but having a possibility to override the endpoint via the environment variable might be valuable (e.g. for testing purposes). I don't think it's a high priority request though. |
So... good news! This is now a high priority thing 🙃 Let's track it over in #2928 |
This issue also covered env vars to change the API endpoint, which was a Googler-requested feature at one point. I can see the value for the user, but it would also be the same as a small modification the user can make themselves with the same net effect: $ echo $GOOGLE_CLOUD_BIGQUERY_ENDPOINT
https://my-custom-endpoint new Storage({
apiEndpoint: process.env.GOOGLE_CLOUD_BIGQUERY_ENDPOINT
}) |
That's a really good question :) I've never heard this request. Is this primarily a testing thing? (cc @broady) |
Uh oh!
There was an error while loading. Please reload this page.
Let's add support for any custom endpoint across the board. We already have support for Datastore, PubSub and (soon) Bigtable. For the most part supporting them has just been some minor configuration changes, so we should be able to support it everywhere.
We should have a setting, e.g.
options.apiEndpoint = 'http://localhost:8888
as well as environment variables.The text was updated successfully, but these errors were encountered: