Skip to content

refactor: move configuration, secrets, lock and metadata out of DaprClientImpl - #1915

Merged
dapr-bot merged 1 commit into
dapr:masterfrom
javier-aliaga:refactor/client-config-secrets-lock-metadata
Nov 22, 2026
Merged

dapr-bot merged 1 commit into
dapr:masterfrom
javier-aliaga:refactor/client-config-secrets-lock-metadata

Conversation

@javier-aliaga

Copy link
Copy Markdown
Contributor

Description

Eighth step of splitting DaprClientImpl into package-private classes, one per building block. This PR moves the secrets, distributed lock, configuration and metadata APIs.

  • Four new package-private classes, one per building block:
    • DaprSecretsClient: getSecret, getBulkSecret
    • DaprLockClient: tryLock, unlock (alpha)
    • DaprConfigurationClient: get, subscribe and unsubscribe configuration
    • DaprMetadataClient: getMetadata and the mapping of its gRPC response to DaprMetadata
  • The method bodies are unchanged.
  • The public methods on DaprClientImpl keep their signatures and Javadoc, and delegate in one line.
  • No public API change. DaprClientImpl goes from 1,339 to 983 lines.

Issue reference

Part of #1875

Checklist

  • Code compiles correctly
  • Created/updated tests. DaprClientGrpcTest and DaprPreviewClientGrpcTest cover these APIs through the public methods. The 670 sdk unit tests pass unchanged.
  • Extended the documentation. Not needed, internal change.

…lientImpl

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

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 remain, and the refactoring preserves the existing public API through focused client implementations and delegation.

No open issues 🎉

What changed in this PR

This pull request continues the internal decomposition of DaprClientImpl by moving secrets, distributed lock, configuration, and metadata implementations into dedicated package-private clients while preserving the existing public API and behavior.

Changes:

  • Added dedicated clients for secrets, locks, configuration, and metadata operations.
  • Moved metadata response mapping and related helper methods into DaprMetadataClient.
  • Replaced the corresponding DaprClientImpl implementations with one-line delegates.
File Description
sdk/​src/​main/​java/​io/​dapr/​client/​DaprSecretsClient.java Implements secret and bulk-secret gRPC operations.
sdk/​src/​main/​java/​io/​dapr/​client/​DaprMetadataClient.java Implements metadata retrieval and gRPC response mapping.
sdk/​src/​main/​java/​io/​dapr/​client/​DaprLockClient.java Implements distributed lock and unlock operations.
sdk/​src/​main/​java/​io/​dapr/​client/​DaprConfigurationClient.java Implements configuration retrieval, subscription, and unsubscription.
sdk/​src/​main/​java/​io/​dapr/​client/​DaprClientImpl.java Initializes the new clients and delegates the corresponding public methods.

Review effort: Lite

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

❤️ @javier-aliaga please take a look at coverage.

@codecov

codecov Bot commented Nov 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.82996% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.66%. Comparing base (546cf28) to head (193e004).

Files with missing lines Patch % Lines
...k/src/main/java/io/dapr/client/DaprLockClient.java 58.49% 15 Missing and 7 partials ⚠️
...rc/main/java/io/dapr/client/DaprSecretsClient.java 86.66% 4 Missing and 2 partials ⚠️
...c/main/java/io/dapr/client/DaprMetadataClient.java 94.02% 3 Missing and 1 partial ⚠️
...n/java/io/dapr/client/DaprConfigurationClient.java 95.71% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1915      +/-   ##
============================================
- Coverage     82.67%   82.66%   -0.01%     
- Complexity     3954     3966      +12     
============================================
  Files           355      359       +4     
  Lines         11941    11965      +24     
  Branches       1339     1339              
============================================
+ Hits           9872     9891      +19     
- Misses         1561     1567       +6     
+ Partials        508      507       -1     

☔ 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.

@dapr-bot
dapr-bot merged commit f19b986 into dapr:master Nov 22, 2026
18 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