Skip to content

fix(storage): make GrpcStorageOptions.Builder host configuration consistent with HttpStorageOptions.Builder - #15223

Closed
nidhiii-27 wants to merge 2 commits into
mainfrom
fix-grpc-storage-options-custom-host-universe-domain
Closed

nidhiii-27 wants to merge 2 commits into
mainfrom
fix-grpc-storage-options-custom-host-universe-domain

Conversation

@nidhiii-27

@nidhiii-27 nidhiii-27 commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

GrpcStorageOptions.Builder now tracks whether a host was explicitly set via setHost(...) and overrides getDefaultHost() to return the default storage endpoint. Explicitly configured hosts are retained when universeDomain is set, while default hosts continue to resolve from universeDomain across build(), toBuilder(), and Java serialization round-trips. New unit tests in StorageOptionsBuilderTest cover explicit host retention, universeDomain host resolution, setHost(null) resets, and serialization behavior.

@nidhiii-27 nidhiii-27 added ai-generated Pull Request generated by AI storage-bug-immunity labels Nov 25, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a customHostConfigured flag in GrpcStorageOptions to track whether a custom host has been explicitly set, allowing the host to be dynamically resolved based on the universe domain when no custom host is provided. It also adds comprehensive unit tests to verify host resolution, resetting, and serialization behavior. The reviewer suggests optimizing the build() method to avoid a redundant second instantiation of GrpcStorageOptions when both customHostConfigured is false and universeDomain is null.

@nidhiii-27 nidhiii-27 changed the title fix(storage): preserve explicit custom host in GrpcStorageOptions when universeDomain is set fix(storage): make GrpcStorageOptions.Builder host configuration consistent with HttpStorageOptions.Builder Nov 25, 2026
…n universeDomain is set

Track whether a custom host was explicitly configured on GrpcStorageOptions.Builder so GrpcStorageOptions.Builder.build() preserves explicitly configured custom hosts when universeDomain is set, while continuing to resolve the default host from universeDomain when no custom host is configured.

[Generated-by: AI]
…ault build()

Only call super.setHost() and re-instantiate GrpcStorageOptions when !customHostConfigured and the resolved host differs from options.getHost(), avoiding a redundant second instantiation in the default case.

[Generated-by: AI]
@nidhiii-27
nidhiii-27 force-pushed the fix-grpc-storage-options-custom-host-universe-domain branch from 3913887 to 571106d Compare November 25, 2026 10:14
@nidhiii-27

Copy link
Copy Markdown
Contributor Author

Superseded by #15238, which covers this case.

@nidhiii-27 nidhiii-27 closed this Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Pull Request generated by AI storage-bug-immunity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant