Added method to customize x-build-info#655
Conversation
AI Review SummaryVerdict: ✅ No critical issues found Critical issuesNo critical issues found. Other findings
This review was generated automatically. Critical issues require attention; other findings are advisory. |
|
Analysis performed by claude, claude-opus-4-6. |
| private Supplier<ScheduledExecutorService> schedulerFactory = YdbSchedulerFactory::createScheduler; | ||
| private String localDc; | ||
| private String buildInfo = Version.getVersion().map(version -> "ydb-java-sdk/" + version) | ||
| .orElse(Version.UNKNOWN_VERSION); |
There was a problem hiding this comment.
Этот orElse на ошибку getVersion()? Тогда, может, надо так?
.orElse("ydb-java-sdk/" + Version.UNKNOWN_VERSION);
There was a problem hiding this comment.
Ну я оставил как было. Эта ветка по идее никогда не срабатывает, но можно и слетать проверку
There was a problem hiding this comment.
Pull request overview
This PR adds support for appending additional build-identifying segments to the x-ydb-sdk-build-info header sent by the gRPC transport, allowing higher-level libraries/integrations to include their own version identifiers alongside the SDK version.
Changes:
- Added
GrpcTransportBuilder.withExtraBuildInfo(...)and abuildInfofield, plus a newgetBuildInfo()accessor (withgetVersionString()deprecated). - Updated header injection to use
GrpcTransportBuilder.getBuildInfo()when populatingx-ydb-sdk-build-info. - Added a unit test asserting correct concatenation behavior, and aligned
TestTickerpackage/imports with its test package.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| core/src/main/java/tech/ydb/core/grpc/GrpcTransportBuilder.java | Introduces buildInfo state and withExtraBuildInfo(...) API; deprecates getVersionString() in favor of getBuildInfo(). |
| core/src/main/java/tech/ydb/core/grpc/YdbHeaders.java | Switches build info header population to builder.getBuildInfo(). |
| core/src/test/java/tech/ydb/core/impl/pool/DefaultChannelFactoryTest.java | Adds coverage for semicolon-concatenated build info header values. |
| core/src/test/java/tech/ydb/core/impl/pool/TestTicker.java | Fixes package declaration to match file location/package usage. |
| core/src/test/java/tech/ydb/core/impl/pool/PriorityPickerTest.java | Removes stale TestTicker import after package alignment. |
| core/src/test/java/tech/ydb/core/impl/pool/EndpointPoolTest.java | Removes stale TestTicker import after package alignment. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #655 +/- ##
============================================
+ Coverage 71.45% 71.46% +0.01%
- Complexity 3374 3377 +3
============================================
Files 379 379
Lines 15929 15933 +4
Branches 1670 1670
============================================
+ Hits 11382 11387 +5
+ Misses 3899 3898 -1
Partials 648 648 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.