Conversation
Signed-off-by: Ninad Kale <ninadkale200@gmail.com>
acroca
left a comment
There was a problem hiding this comment.
Thank you for the contribution.
Fix lint errors 🙏
There was a problem hiding this comment.
Pull request overview
Adds support for configuring an actor reminder “failure policy” in the Python SDK, allowing callers to control retry/drop behavior when reminder ticks fail, and serializing that policy into the reminder registration payload sent to the Dapr runtime.
Changes:
- Introduces
ActorReminderFailurePolicy(drop / constant retry) and unit tests for it. - Extends reminder registration (
Actor.register_reminder,MockActor.register_reminder,ActorReminderData) to accept and serializefailure_policy. - Adds reminder-data serialization tests covering
failurePolicyinclusion/omission.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
dapr/actor/runtime/_failure_policy.py |
New policy model with serialization to the Dapr reminder JSON shape. |
dapr/actor/runtime/_reminder_data.py |
Stores/serializes failure_policy in reminder payload. |
dapr/actor/runtime/actor.py |
Adds failure_policy parameter to reminder registration API and includes it in request body. |
dapr/actor/runtime/mock_actor.py |
Mirrors reminder registration signature in the test/mock actor runtime. |
dapr/actor/__init__.py |
Re-exports ActorReminderFailurePolicy as part of the public actor package surface. |
tests/actor/test_failure_policy.py |
New unit tests for ActorReminderFailurePolicy. |
tests/actor/test_reminder_data.py |
New tests ensuring failurePolicy is (not) emitted by ActorReminderData.as_dict(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Copilot's suggestion 1 Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Ninad Kale <145228622+1Ninad@users.noreply.github.com>
Signed-off-by: Ninad Kale <ninadkale200@gmail.com>
Fixed lint errors and addressed Copilot suggestions. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #953 +/- ##
==========================================
+ Coverage 86.63% 89.04% +2.41%
==========================================
Files 84 104 +20
Lines 4473 7383 +2910
==========================================
+ Hits 3875 6574 +2699
- Misses 598 809 +211 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
acroca
left a comment
There was a problem hiding this comment.
LGTM, just a small comment :)
Thanks!
There was a problem hiding this comment.
Pull request overview
Adds support for configuring Dapr actor reminder failure handling via an optional failure_policy parameter, serializing it into the reminder registration payload sent to the Dapr runtime.
Changes:
- Introduces
ActorReminderFailurePolicy(drop / constant) and wiring into reminder payloads. - Extends
Actor.register_reminder()andMockActor.register_reminder()to acceptfailure_policy. - Adds/extends unit tests for reminder data and failure policy behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
dapr/actor/runtime/_failure_policy.py |
New failure policy model with as_dict() serialization. |
dapr/actor/runtime/_reminder_data.py |
Adds failurePolicy field to reminder payload dict; normalizes empty reminder state handling. |
dapr/actor/runtime/actor.py |
Adds failure_policy arg to register_reminder() and includes it in serialized request body. |
dapr/actor/runtime/mock_actor.py |
Mirrors register_reminder() signature and stores policy in mock reminder data. |
dapr/actor/__init__.py |
Exposes ActorReminderFailurePolicy from dapr.actor. |
tests/actor/test_failure_policy.py |
New tests for policy factories, serialization, and validation. |
tests/actor/test_reminder_data.py |
Adds tests covering reminder dict serialization with/without failurePolicy. |
tests/actor/test_actor.py |
Adds test ensuring reminder registration payload includes failurePolicy. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I noticed Copilot left a few suggestions. Should I go ahead and address those Copilot suggestions in this PR, or leave it as is? |
I think the suggestions are useful |
Done. |
Signed-off-by: Ninad Kale <ninadkale200@gmail.com>
Description
Adds an optional failure_policy parameter to register_reminder() so actors can control what happens when a reminder fails to fire. The policy serialises into the existing JSON body the SDK already sends to the Dapr runtime.
Issue reference
closes: #896
Checklist