Skip to content

refactor: move jobs out of DaprClientImpl - #1911

Open
javier-aliaga wants to merge 1 commit into
dapr:masterfrom
javier-aliaga:refactor/split-daprclientimpl-jobs
Open

javier-aliaga wants to merge 1 commit into
dapr:masterfrom
javier-aliaga:refactor/split-daprclientimpl-jobs

Conversation

@javier-aliaga

Copy link
Copy Markdown
Contributor

Description

Sixth step of splitting DaprClientImpl into package-private classes, one per building block. This PR moves the jobs API.

  • New package-private class DaprJobsClient holds scheduleJob, getJob and deleteJob, plus getJobFailurePolicy, isUnimplemented and the three request validators. The bodies are unchanged, including the fallback to the Alpha1 RPCs on pre-1.18 sidecars.
  • The public methods on DaprClientImpl keep their signatures and Javadoc, and delegate in one line.
  • No public API change. DaprClientImpl goes from 1,606 to 1,408 lines.

Issue reference

Part of #1875

Checklist

  • Code compiles correctly
  • Created/updated tests. DaprClientGrpcTest covers jobs through the public methods. The 626 sdk unit tests pass unchanged.
  • Extended the documentation. Not needed, internal change.

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

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 were identified in the extracted jobs client and its delegating integration.

No open issues 🎉

What changed in this PR

This pull request extracts the jobs building-block implementation from DaprClientImpl into a package-private DaprJobsClient, preserving the public API and existing RPC fallback behavior.

Changes:

  • Added DaprJobsClient with job scheduling, retrieval, deletion, validation, failure-policy mapping, and fallback logic.
  • Added and initialized a jobsClient delegate in DaprClientImpl.
  • Replaced the jobs method implementations in DaprClientImpl with delegations.
File Description
sdk/​src/​main/​java/​io/​dapr/​client/​DaprJobsClient.java Adds the package-private jobs client containing the extracted jobs API implementation and fallback behavior.
sdk/​src/​main/​java/​io/​dapr/​client/​DaprClientImpl.java Initializes the jobs delegate and forwards the public jobs methods to it.

Review effort: Lite

@javier-aliaga
javier-aliaga marked this pull request as ready for review November 17, 2026 09:24
@javier-aliaga
javier-aliaga requested review from a team as code owners November 17, 2026 09:24
@codecov

codecov Bot commented Nov 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.30435% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.13%. Comparing base (9819808) to head (2b436a5).

Files with missing lines Patch % Lines
...k/src/main/java/io/dapr/client/DaprJobsClient.java 90.99% 9 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1911      +/-   ##
============================================
+ Coverage     82.07%   82.13%   +0.05%     
- Complexity     3761     3765       +4     
============================================
  Files           338      339       +1     
  Lines         11544    11551       +7     
  Branches       1303     1303              
============================================
+ Hits           9475     9487      +12     
+ Misses         1561     1557       -4     
+ 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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants