Skip to content

Add Failure Policy for Jobs SDK #1448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Aug 5, 2025

Conversation

siri-varma
Copy link
Contributor

@siri-varma siri-varma commented Jul 13, 2025

Description

Add Failure Policy for the Job

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #1429

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@siri-varma siri-varma requested review from a team as code owners July 13, 2025 22:06
Signed-off-by: sirivarma <[email protected]>
Signed-off-by: sirivarma <[email protected]>
@siri-varma siri-varma changed the title Users/svegiraju/add failure policy Add Failure Policy for Jobs SDK Jul 13, 2025
@siri-varma
Copy link
Contributor Author

siri-varma commented Jul 13, 2025

The integration test will fail because a version of dapr that supports failures policy has not been released yet.

Copy link
Contributor

@artur-ciocanu artur-ciocanu left a comment

Choose a reason for hiding this comment

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

@siri-varma nice patch! I have added some comments, mostly around naming convention.

@artur-ciocanu
Copy link
Contributor

@siri-varma could you please check why the some tests are failing:

Error:  Errors: 
Error:    BindingIT.httpOutputBindingError:46 » Runtime org.opentest4j.AssertionFailedError: expected: <404> but was: <403>
Error:    BindingIT.httpOutputBindingErrorIgnoredByComponent:69 » Runtime org.opentest4j.AssertionFailedError: expected: <404> but was: <403>
Error:    DaprJobsIT.testJobScheduleCreationWithConstantFailurePolicy:194 NullPointer Cannot invoke "io.dapr.client.domain.FailurePolicy.getFailurePolicyKind()" because the return value of "io.dapr.client.domain.GetJobResponse.getFailurePolicy()" is null
Error:    DaprJobsIT.testJobScheduleCreationWithDropFailurePolicy:172 NullPointer Cannot invoke "io.dapr.client.domain.FailurePolicy.getFailurePolicyKind()" because the return value of "io.dapr.client.domain.GetJobResponse.getFailurePolicy()" is null

siri-varma and others added 3 commits July 19, 2025 13:40
* upgrading to 1.15.7

Signed-off-by: salaboy <[email protected]>

* using DAPR VERSION

Signed-off-by: salaboy <[email protected]>

---------

Signed-off-by: salaboy <[email protected]>
Signed-off-by: siri-varma <[email protected]>
Signed-off-by: siri-varma <[email protected]>
@siri-varma siri-varma force-pushed the users/svegiraju/add-failure-policy branch from b97a600 to 6a07cb3 Compare July 21, 2025 17:07
@siri-varma
Copy link
Contributor Author

siri-varma commented Jul 21, 2025

@artur-ciocanu Once a new version with the required protos comes out, the integration tests should succeed.

Signed-off-by: sirivarma <[email protected]>
Signed-off-by: sirivarma <[email protected]>
Signed-off-by: sirivarma <[email protected]>
@siri-varma
Copy link
Contributor Author

@dapr/approvers-java-sdk This PR is ready for review. Thank you.

@siri-varma
Copy link
Contributor Author

Fixed all the merge conflicts

Copy link
Contributor

@artur-ciocanu artur-ciocanu left a comment

Choose a reason for hiding this comment

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

@siri-varma overall looks good, but I think the code that deals with failure policy could be a little bit simple. Ideally you should use helper methods and ensure that you leverage early returns to avoid all those nested if/else.

@siri-varma
Copy link
Contributor Author

@artur-ciocanu Addressed all the comments

Copy link
Contributor

@artur-ciocanu artur-ciocanu left a comment

Choose a reason for hiding this comment

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

Nice patch! Thank you.

@dapr-bot dapr-bot merged commit 4ee6be0 into dapr:master Aug 5, 2025
12 of 15 checks passed
Copy link

codecov bot commented Aug 5, 2025

Codecov Report

❌ Patch coverage is 98.03922% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 78.73%. Comparing base (d759c53) to head (28017f8).
⚠️ Report is 190 commits behind head on master.

Files with missing lines Patch % Lines
...ain/java/io/dapr/client/domain/GetJobResponse.java 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1448      +/-   ##
============================================
+ Coverage     76.91%   78.73%   +1.81%     
- Complexity     1592     1918     +326     
============================================
  Files           145      237      +92     
  Lines          4843     5924    +1081     
  Branches        562      610      +48     
============================================
+ Hits           3725     4664     +939     
- Misses          821      938     +117     
- Partials        297      322      +25     

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

@siri-varma siri-varma deleted the users/svegiraju/add-failure-policy branch August 5, 2025 18:40
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.

Add support for Jobs FailurePolicy
4 participants