Add suspend and resume reasons - #250
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 941fc052-b910-42af-93fa-4f00138813ab
There was a problem hiding this comment.
Pull request overview
This PR adds suspend/resume “reason” parity with the .NET client across the core Durable Task Python clients and the Azure Functions Durable compatibility client, ensuring the optional reason is serialized and preserved.
Changes:
- Added keyword-only optional
reasonparameters to sync/asyncsuspend_orchestrationandresume_orchestrationAPIs and serialized them into the protobuf requests. - Updated Azure Functions Durable v1-compat
suspend()/resume()deprecated aliases to forward the provided reason. - Added unit tests and changelog entries covering both populated and omitted reasons.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| durabletask/client.py | Adds optional keyword-only reason to suspend/resume APIs and serializes it into SuspendRequest/ResumeRequest. |
| tests/durabletask/test_client.py | Adds tests validating reason serialization and omission behavior for sync and async clients. |
| tests/azure-functions-durable/test_client_compat.py | Updates compat tests to ensure deprecated v1 methods forward reason to the new APIs. |
| azure-functions-durable/azure/durable_functions/client.py | Forwards v1 deprecated reason argument to durabletask suspend/resume APIs instead of discarding it. |
| CHANGELOG.md | Documents the new optional suspend/resume reason parameters in the core SDK changelog under Unreleased. |
| azure-functions-durable/CHANGELOG.md | Documents the v1 compat fix to forward suspend/resume reasons under Unreleased. |
Suppressed comments (1)
tests/durabletask/test_client.py:1279
- Test name grammar: "include" should be "includes" (third-person singular) for readability/consistency.
async def test_async_suspend_resume_orchestration_include_optional_reason():
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 941fc052-b910-42af-93fa-4f00138813ab
Bernd Verst (berndverst)
left a comment
There was a problem hiding this comment.
Please address the inline compatibility, in-memory backend, and package changelog gaps before merging.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 941fc052-b910-42af-93fa-4f00138813ab
Updated instructions for creating a dedicated release PR to ensure proper versioning and compatibility.
Bernd Verst (berndverst)
left a comment
There was a problem hiding this comment.
Second-pass review of 54bd23c completed. The prior dependency-release, in-memory history, and Azure Managed changelog findings are resolved, and no new actionable issues were found. Targeted sync/async and compatibility tests, affected-file Flake8, strict source Pyright, and packaged-type Pyright checks pass.
Summary
Closes #223