Skip to content

Added method to customize x-build-info#655

Merged
alex268 merged 2 commits into
ydb-platform:masterfrom
alex268:master
May 27, 2026
Merged

Added method to customize x-build-info#655
alex268 merged 2 commits into
ydb-platform:masterfrom
alex268:master

Conversation

@alex268
Copy link
Copy Markdown
Member

@alex268 alex268 commented May 27, 2026

No description provided.

Comment thread core/src/main/java/tech/ydb/core/grpc/GrpcTransportBuilder.java
Comment thread core/src/main/java/tech/ydb/core/grpc/GrpcTransportBuilder.java
@robot-vibe-db
Copy link
Copy Markdown

robot-vibe-db Bot commented May 27, 2026

AI Review Summary

Verdict: ✅ No critical issues found

Critical issues

No critical issues found.

Other findings

  • Major | Medium: Renaming public method getVersionString()getBuildInfo() is a source-incompatible API change; consider keeping the old method as @Deprecated for a release cycle — core/src/main/java/tech/ydb/core/grpc/GrpcTransportBuilder.java:130
  • Minor | High: withExtraBuildInfo() lacks null/empty validation, unlike every other with* method in the builder; passing null silently produces "...;null" in the gRPC header — core/src/main/java/tech/ydb/core/grpc/GrpcTransportBuilder.java:436

This review was generated automatically. Critical issues require attention; other findings are advisory.
If this comment was useful, please give it a 👍 — it helps us improve the review bot.

@robot-vibe-db
Copy link
Copy Markdown

robot-vibe-db Bot commented May 27, 2026

Full analysis log

Analysis performed by claude, claude-opus-4-6.

@alex268 alex268 requested a review from pnv1 May 27, 2026 15:17
private Supplier<ScheduledExecutorService> schedulerFactory = YdbSchedulerFactory::createScheduler;
private String localDc;
private String buildInfo = Version.getVersion().map(version -> "ydb-java-sdk/" + version)
.orElse(Version.UNKNOWN_VERSION);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Этот orElse на ошибку getVersion()? Тогда, может, надо так?
.orElse("ydb-java-sdk/" + Version.UNKNOWN_VERSION);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ну я оставил как было. Эта ветка по идее никогда не срабатывает, но можно и слетать проверку

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 a buildInfo field, plus a new getBuildInfo() accessor (with getVersionString() deprecated).
  • Updated header injection to use GrpcTransportBuilder.getBuildInfo() when populating x-ydb-sdk-build-info.
  • Added a unit test asserting correct concatenation behavior, and aligned TestTicker package/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-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 71.46%. Comparing base (0c6df79) to head (4d761c5).

Files with missing lines Patch % Lines
.../java/tech/ydb/core/grpc/GrpcTransportBuilder.java 85.71% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alex268 alex268 merged commit fdecb35 into ydb-platform:master May 27, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants