Repository navigation
feat: add orchestration state status predicates - #376
Merged
wangbill (YunchuWang) merged 1 commit intoOct 1, 2026
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e0af01a5-0dfa-4e71-a660-c4186e65d7e0
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation matches the documented .NET semantics and has comprehensive focused tests.
Review effort: Balanced
Findings: None
What changed in this PR
Adds .NET-aligned runtime-status predicates to OrchestrationState.
Changes:
- Adds getter-only
isRunningandisCompletedproperties. - Tests all statuses, mutation behavior, and getter-only semantics.
- Documents the public API addition.
| File | Description |
|---|---|
packages/durabletask-js/src/orchestration/orchestration-state.ts |
Implements status predicates. |
packages/durabletask-js/test/orchestration-state.spec.ts |
Adds predicate regression tests. |
CHANGELOG.md |
Records the new API. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
kaibocai (kaibocai)
approved these changes
Sep 29, 2026
wangbill (YunchuWang)
deleted the
yunchuwang-orchestration-status-predicates
branch
October 1, 2026 18:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
What changed?
OrchestrationState.isRunningandisCompleted, computed from the current mutableruntimeStatus.isRunningis true only forRUNNING.isCompletedis true only forCOMPLETED,FAILED, orTERMINATED: completion does not imply success.PENDING,SUSPENDED,CONTINUED_AS_NEW, andCANCELEDreturn false for both.Why is this change needed?
Issues / work items
Project checklist
CHANGELOG.mdAI-assisted code disclosure (required)
Was an AI tool used? (select one)
If AI was used:
CHANGELOG.md.AI verification (required if AI was used):
Human attestations above are intentionally left for the reviewer.
Testing
Automated tests
orchestration-state.spec.ts,new-orchestration-state.spec.ts, andtest-client-serialization.spec.ts.npm run build:coreand a public declaration consumer type-check passed, including boolean reads, rejected writes, and the client return type.git diff --checkpassed. Added-code Prettier comparison passed against the base; two pre-existing wrapping differences remain untouched, and CRLF is preserved.Manual validation (only if runtime/behavior changed)
Notes for reviewers
CANCELEDis deliberately excluded to preserve the exact .NET predicate semantics.