[default values] Send client version via User-Agent header#636
Open
cbb330 wants to merge 1 commit into
Open
Conversation
The OpenHouse client sets User-Agent: openhouse-java-client/<version> on every outbound request, set once in WebClientFactory.getWebClient() (tables/jobs/housetables). Version resolves: explicit setClientVersion() override, then the secureclient jar manifest Implementation-Version, then "unknown"; build.gradle stamps the manifest. OpenHouseCatalog reads a "client-version" catalog property and calls setClientVersion() on the ApiClient factory -- mirroring how it already handles "client-name" -- so callers set the version via a property rather than touching the factory directly (which is compileOnly/relocated downstream).
87705cd to
ace2096
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
We're rolling out strip protection for default-value tables: the server blocks commits that would silently drop a column's declared default. The guard decides from the committed schema — not from the client version.
To expand it safely from a pilot group to the whole datalake, we need to watch which client versions are committing, to track two signals:
The version is observability only; it never gates a commit.
This PR (observability only)
This does not prevent stripping and is not an input to any guard; it makes the client version reliable to read so those two signals can be measured. The OpenHouse Java client now sets an explicit
User-Agent: openhouse-java-client/<version>on every outbound request, set once in the sharedWebClientFactory.getWebClient()so the tables, jobs, and housetables clients are all covered. Version resolves:setClientVersion(...)override,Implementation-Version,"unknown".build.gradlestampsImplementation-Versioninto the jar manifest so the fallback is meaningful in packaged builds.The
OpenHouseCatalognow also reads aclient-versioncatalog property and callssetClientVersion(...)(next to its existingclient-namehandling), so consumers set the version via a property rather than touching the relocated/compileOnlyfactory directly. li-openhouse#2147 sets that property from the build-time-baked runtime version.The
OpenHouseCatalogalso reads aclient-versioncatalog property and callssetClientVersion(...)(next to its existingclient-namehandling), so consumers set the version via a property instead of touching the relocated/compileOnlyfactory directly. li-openhouse#2147 sets that property from the build-time-baked runtime version.Why not rely on the transport's default
Previously these requests carried reactor-netty's default
User-Agent: ReactorNetty/<version>, where<version>isgetImplementationVersion()on whatever jar provides reactor-netty's classes. That depends entirely on how the OpenHouse client is packaged, so one token means different things:1.0.x) — never the OpenHouse client's;Implementation-Version, i.e. the runtime's version — or, if the fat jar carries no version, nothing (ReactorNetty/dev).So you can't tell what a
ReactorNetty/<version>even refers to, and the thin runtime never reports the OpenHouse version at all. Setting our ownopenhouse-java-client/<version>User-Agent makes it explicit and unambiguous across both packagings. For shaded runtimes, callers should additionally pass an explicitsetClientVersion(...), since jar-manifest introspection is unreliable once shaded.Testing
TablesApiClientFactoryTest.testSetClientVersionCalled.:client:secureclient:testand:client:secureclient:spotlessCheckpass.Follow-ups (separate changes)
X-Client-Name(engine/app), which the server already reads for theclient_namemetric.