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

fix: Return resolved endpoint from StubSettings' Builder #2715

Merged
merged 4 commits into from
May 2, 2024

Conversation

lqiu96
Copy link
Contributor

@lqiu96 lqiu96 commented May 2, 2024

No description provided.

@lqiu96 lqiu96 requested a review from blakeli0 May 2, 2024 14:46
@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label May 2, 2024
public String getEndpoint() {
return clientSettingsEndpoint;
return endpointContext.resolvedEndpoint();
Copy link
Collaborator

Choose a reason for hiding this comment

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

A fully compatible solution might be

// For newBuilder() scenario.
if (endpointContext.equals(EndpointContext.getDefaultInstance())) {
  return clientSettingsEndpoint;
}
return endpointContext.resolvedEndpoint();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, I think you are right. A valid StubSettings converted to a Builder will still be able to have the resolved endpoint.

Copy link

sonarcloud bot commented May 2, 2024

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

Failed conditions
28.6% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

Copy link

sonarcloud bot commented May 2, 2024

Quality Gate Passed Quality Gate passed for 'java_showcase_integration_tests'

Issues
2 New issues
0 Accepted issues

Measures
0 Security Hotspots
91.7% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@lqiu96 lqiu96 marked this pull request as ready for review May 2, 2024 19:38
@lqiu96 lqiu96 requested a review from a team as a code owner May 2, 2024 19:38
@lqiu96 lqiu96 added the owlbot:run Add this label to trigger the Owlbot post processor. label May 2, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label May 2, 2024
public static final String GOOGLE_CLOUD_UNIVERSE_DOMAIN = "GOOGLE_CLOUD_UNIVERSE_DOMAIN";
public static final String INVALID_UNIVERSE_DOMAIN_ERROR_TEMPLATE =
"The configured universe domain (%s) does not match the universe domain found in the credentials (%s). If you haven't configured the universe domain explicitly, `googleapis.com` is the default.";
public static final String UNABLE_TO_RETRIEVE_CREDENTIALS_ERROR_MESSAGE =
"Unable to retrieve the Universe Domain from the Credentials.";

public static EndpointContext getDefaultInstance() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this be package private?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm using this inside GrpcCallContext (gax-grpc) and HttpJsonCallContext (gax-httpsjon) and can't access it otherwise.

@lqiu96 lqiu96 requested a review from blakeli0 May 2, 2024 20:11
@lqiu96 lqiu96 merged commit 32c9995 into main May 2, 2024
43 of 44 checks passed
@lqiu96 lqiu96 deleted the stubsettings-builder branch May 2, 2024 20:25
alicejli pushed a commit that referenced this pull request May 2, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>2.40.0</summary>

##
[2.40.0](v2.39.0...v2.40.0)
(2024-05-02)


### Features

* [common-protos] add `Weight` to common types for Shopping APIs to be
used for accounts bundle
([#2699](#2699))
([5bb9770](5bb9770))
* add a CLI tool to validate generation configuration
([#2691](#2691))
([f2ce524](f2ce524))
* Parser to consume the api-versioning value from proto
([#2630](#2630))
([40711fd](40711fd))
* Update Gapic generator and Gax to emit api-versioning via header
([#2671](#2671))
([e63d1b4](e63d1b4))


### Bug Fixes

* change folder prefix for adding headers
([#2688](#2688))
([4e92be8](4e92be8))
* Log HttpJson's async thread pool core size
([#2697](#2697))
([34b4bc3](34b4bc3))
* replace `cfg = "host"` with `cfg = "exec"`
([#2637](#2637))
([6d673f3](6d673f3))
* Return resolved endpoint from StubSettings' Builder
([#2715](#2715))
([32c9995](32c9995))


### Dependencies

* Make opentelemetry-api an optional dependency.
([#2681](#2681))
([3967a19](3967a19))
* update dependency absl-py to v2.1.0
([#2659](#2659))
([cae6d79](cae6d79))
* update dependency gitpython to v3.1.43
([#2656](#2656))
([208bef4](208bef4))
* update dependency lxml to v5.2.1
([#2661](#2661))
([b95ad49](b95ad49))
* update dependency net.bytebuddy:byte-buddy to v1.14.14
([#2703](#2703))
([87069bc](87069bc))
* update dependency typing to v3.10.0.0
([#2663](#2663))
([7fb5653](7fb5653))
* update gapic-showcase to v0.33.0
([#2653](#2653))
([0a71cbf](0a71cbf))


### Documentation

* Add contributing guidelines to PR and issue templates
([#2682](#2682))
([42526dc](42526dc))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
lqiu96 pushed a commit that referenced this pull request May 22, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>2.40.0</summary>

##
[2.40.0](v2.39.0...v2.40.0)
(2024-05-02)


### Features

* [common-protos] add `Weight` to common types for Shopping APIs to be
used for accounts bundle
([#2699](#2699))
([5bb9770](5bb9770))
* add a CLI tool to validate generation configuration
([#2691](#2691))
([f2ce524](f2ce524))
* Parser to consume the api-versioning value from proto
([#2630](#2630))
([40711fd](40711fd))
* Update Gapic generator and Gax to emit api-versioning via header
([#2671](#2671))
([e63d1b4](e63d1b4))


### Bug Fixes

* change folder prefix for adding headers
([#2688](#2688))
([4e92be8](4e92be8))
* Log HttpJson's async thread pool core size
([#2697](#2697))
([34b4bc3](34b4bc3))
* replace `cfg = "host"` with `cfg = "exec"`
([#2637](#2637))
([6d673f3](6d673f3))
* Return resolved endpoint from StubSettings' Builder
([#2715](#2715))
([32c9995](32c9995))


### Dependencies

* Make opentelemetry-api an optional dependency.
([#2681](#2681))
([3967a19](3967a19))
* update dependency absl-py to v2.1.0
([#2659](#2659))
([cae6d79](cae6d79))
* update dependency gitpython to v3.1.43
([#2656](#2656))
([208bef4](208bef4))
* update dependency lxml to v5.2.1
([#2661](#2661))
([b95ad49](b95ad49))
* update dependency net.bytebuddy:byte-buddy to v1.14.14
([#2703](#2703))
([87069bc](87069bc))
* update dependency typing to v3.10.0.0
([#2663](#2663))
([7fb5653](7fb5653))
* update gapic-showcase to v0.33.0
([#2653](#2653))
([0a71cbf](0a71cbf))


### Documentation

* Add contributing guidelines to PR and issue templates
([#2682](#2682))
([42526dc](42526dc))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants