Skip to content

refactor: move bindings out of DaprClientImpl - #1924

Open
javier-aliaga wants to merge 3 commits into
dapr:masterfrom
javier-aliaga:refactor/client-bindings
Open

javier-aliaga wants to merge 3 commits into
dapr:masterfrom
javier-aliaga:refactor/client-bindings

Conversation

@javier-aliaga

@javier-aliaga javier-aliaga commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Description

Tenth step of splitting DaprClientImpl into package-private classes, one per building block. This PR moves bindings.

  • New package-private class DaprBindingsClient holds invokeBinding. The body is unchanged.
  • The public method on DaprClientImpl keeps its signature and annotations, and delegates in one line.
  • No public API change. DaprClientImpl goes from 983 to 926 lines.

It also raises the timeout of the "Validate Javadocs generation" job from 6 to 10 minutes. The job normally takes 5 to 6 minutes, and the setup-java cache upload after the last step adds about 30 seconds, so slower runs got cancelled even though every step passed.

This PR does not depend on #1918. Both can merge in either order.

Issue reference

Part of #1875

Checklist

  • Code compiles correctly
  • Created/updated tests. Three new tests in DaprClientGrpcTest cover a request with no data, a binding response with an error statusCode, and a deserialization failure. The 673 sdk unit tests pass.
  • Extended the documentation. Not needed, internal change.

Signed-off-by: Javier Aliaga <javier@diagrid.io>
…e failure

Signed-off-by: Javier Aliaga <javier@diagrid.io>
Copilot AI lite review requested due to automatic review settings November 30, 2026 09:34

Copilot AI 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.

🟢 Approval recommended

The review reports no active issues, while the refactoring preserves the public API and adds coverage for key binding edge cases.

No open issues 🎉

What changed in this PR

This PR continues the internal decomposition of DaprClientImpl by moving output-binding invocation logic into a package-private DaprBindingsClient while preserving the existing public API and behavior.

Changes:

  • Added DaprBindingsClient to encapsulate binding request serialization, gRPC invocation, response handling, and deserialization.
  • Updated DaprClientImpl to initialize the bindings client and delegate invokeBinding.
  • Added tests covering null request data, binding error status codes, and deserialization failures.
File Description
sdk/​src/​test/​java/​io/​dapr/​client/​DaprClientGrpcTest.java Adds coverage for binding requests with null data, error status codes, and deserialization failures.
sdk/​src/​main/​java/​io/​dapr/​client/​DaprClientImpl.java Initializes DaprBindingsClient and delegates the public invokeBinding method.
sdk/​src/​main/​java/​io/​dapr/​client/​DaprBindingsClient.java Adds a package-private client containing the extracted output-binding invocation logic.

Review effort: Lite

@javier-aliaga
javier-aliaga marked this pull request as ready for review November 30, 2026 09:38
@javier-aliaga
javier-aliaga requested review from a team as code owners November 30, 2026 09:38
Signed-off-by: Javier Aliaga <javier@diagrid.io>
Copilot AI lite review requested due to automatic review settings November 30, 2026 11:24

Copilot AI 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.

🟢 Approval recommended

No active review issues are identified, and the changes are focused on refactoring binding invocation while preserving the public API and adding edge-case coverage.

No open issues 🎉

Review effort: Lite

@@ -18,7 +18,7 @@ jobs:
build:
name: "Validate Javadocs generation"
runs-on: oracle-vm-4cpu-16gb-arm64

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.

I am wondering why we had to increase the timeout

@artur-ciocanu artur-ciocanu 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.

Love it!

@codecov

codecov Bot commented Nov 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.36842% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.91%. Comparing base (02a69d7) to head (a33c358).

Files with missing lines Patch % Lines
...c/main/java/io/dapr/client/DaprBindingsClient.java 97.22% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1924      +/-   ##
============================================
+ Coverage     82.66%   82.91%   +0.25%     
- Complexity     3966     3978      +12     
============================================
  Files           359      360       +1     
  Lines         11965    11971       +6     
  Branches       1339     1339              
============================================
+ Hits           9891     9926      +35     
+ Misses         1567     1541      -26     
+ Partials        507      504       -3     

☔ View full report in Codecov by Harness.
📢 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.

This branch has not been deployed

No deployments
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.

3 participants