Skip to content

Add continue-as-new version support - #254

Merged
andystaples merged 2 commits into
mainfrom
andystaples-add-continue-as-new-version
Aug 13, 2026
Merged

Add continue-as-new version support#254
andystaples merged 2 commits into
mainfrom
andystaples-add-continue-as-new-version

Conversation

@andystaples

Copy link
Copy Markdown
Contributor

Summary

  • add an optional new_version argument to OrchestrationContext.continue_as_new()
  • serialize supplied versions into CompleteOrchestrationAction.newVersion
  • document the API and test supplied and omitted versions

Closes #127

Testing

  • python -m pytest tests\durabletask\test_orchestration_executor.py -k continue_as_new
  • python -m flake8 durabletask
  • python -m flake8 tests\durabletask

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: df26610a-beb4-44ea-a04a-6aedeb316d2a
Copilot AI lite review requested due to automatic review settings August 10, 2026 17:12

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.

Pull request overview

This PR adds orchestration version migration support to the core durabletask SDK by extending OrchestrationContext.continue_as_new() to accept an optional new_version, then wiring that value through to the CompleteOrchestrationAction.newVersion protobuf field.

Changes:

  • Added a new_version: str | None = None keyword argument to OrchestrationContext.continue_as_new().
  • Persisted and serialized the supplied version into the complete-orchestration action sent to the backend.
  • Expanded unit test coverage and documented the change in the root changelog.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/durabletask/test_orchestration_executor.py Adds parametrized test coverage for continued-as-new with and without new_version.
durabletask/worker.py Tracks new_version during continue-as-new and forwards it into the completion action.
durabletask/task.py Extends the public OrchestrationContext.continue_as_new() API and documents the new parameter.
durabletask/internal/helpers.py Adds new_version support to the completion-action builder and maps it to newVersion.
CHANGELOG.md Documents the new user-facing API capability under ## Unreleased.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

complete_action = get_and_validate_complete_orchestration_action_list(1, actions)
assert complete_action.orchestrationStatus == pb.ORCHESTRATION_STATUS_CONTINUED_AS_NEW
assert complete_action.result.value == json.dumps(2)
assert complete_action.HasField("newVersion") is (new_version is not None)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated to use equality comparison.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: df26610a-beb4-44ea-a04a-6aedeb316d2a

@berndverst Bernd Verst (berndverst) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed the complete diff and surrounding execution/versioning paths. The implementation correctly omits newVersion when unspecified (preserving the current version) and sets it only for the next continue-as-new generation; replay behavior and provider inheritance remain intact. No new abstract member is introduced. Targeted executor and Azure Functions compatibility tests, affected-file flake8, and strict Pyright on the changed source files passed. No actionable findings.

@andystaples
andystaples merged commit d71af0f into main Aug 13, 2026
27 of 29 checks passed
@andystaples
andystaples deleted the andystaples-add-continue-as-new-version branch August 13, 2026 16:37
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.

continue_as_new does not support specifying a new orchestration version

3 participants