Skip to content
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: Remove setting the default endpoint in StubSettings #2348

Merged
merged 2 commits into from
Jan 9, 2024

Conversation

lqiu96
Copy link
Contributor

@lqiu96 lqiu96 commented Jan 5, 2024

What does this do

  1. This change removes the concept of a having a default endpoint. For GAPICs, the EndpointContext will resolve the endpoint. If there are no user configurations, the endpoint will resolve to {serviceName}.googleapis.com.
  2. StubSettings' getEndpoint() will return the user set endpoint. If the user does not set an endpoint, the method will return the endpoint set by the service.

Showcase

Showcase Clients do not have a valid serviceName and cannot construct an endpoint via the EndpointContext without an explicit endpoint input. To run these locally, we must configure the endpoint explicitly to point to localhost:7469 for gRPC and http://localhost:7469 for httpjson.

Google Cloud Libraries

For Google Cloud client libraries, the service name is stored in the EndpointContext and parsed from the proto or service yaml file.

BEGIN_COMMIT_OVERRIDE
feat: Do not set the default endpoint in StubSettings
feat: StubSettings' getEndpoint() will return the service's pre-configured endpoint if there are no user configurations
END_COMMIT_OVERRIDE

@lqiu96 lqiu96 requested a review from a team as a code owner January 5, 2024 21:25
@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Jan 5, 2024
@lqiu96 lqiu96 requested a review from blakeli0 January 5, 2024 21:35
@blakeli0
Copy link
Collaborator

blakeli0 commented Jan 8, 2024

Removing setting the default endpoint maybe breaking for customers, especially for some handwritten libraries like Bigtable, can you please verify? If yes, I don't think we want to change it until getResolvedEndpoint() is introduced publicly. Then we can probably move EndpointContext to StubSettings and do something like setEndpoint(endpointContext.getResolvedEndpoint()).

@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Jan 9, 2024
@lqiu96 lqiu96 force-pushed the remove-setting-getDefaultEndpoint branch from c826fe6 to fd024d5 Compare January 9, 2024 18:06
Copy link

sonarcloud bot commented Jan 9, 2024

Quality Gate Failed Quality Gate failed for 'gapic-generator-java-root'

Failed conditions

54.8% Coverage on New Code (required ≥ 80%)
44.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Jan 9, 2024

Quality Gate Failed Quality Gate failed for 'java_showcase_integration_tests'

Failed conditions

30.0% Coverage on New Code (required ≥ 80%)
54.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

Copy link
Collaborator

@blakeli0 blakeli0 left a comment

Choose a reason for hiding this comment

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

LGTM. Before merging, please update the PR title and description to reflect the new changes, and change the type of the PR from chore to feat.

@lqiu96 lqiu96 changed the title chore: Remove setting the default endpoint in StubSettings feat: Remove setting the default endpoint in StubSettings Jan 9, 2024
@lqiu96 lqiu96 merged commit 97ae228 into main Jan 9, 2024
37 of 39 checks passed
@lqiu96 lqiu96 deleted the remove-setting-getDefaultEndpoint branch January 9, 2024 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants