feat: expose orchestration context name - #373
Open
wangbill (YunchuWang) wants to merge 1 commit into
Open
wangbill (YunchuWang) wants to merge 1 commit into
wangbill (YunchuWang) wants to merge 1 commit into
Conversation
Expose the recorded logical orchestration name before invocation and during replay, including the classic Functions context. Preserve runtime constructor arguments and document the custom-context source compatibility impact. 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
No unresolved review issues were identified, and the supplied tests cover the changed behavior.
Review effort: Lite
Findings: None
What changed in this PR
Adds replay-safe logical orchestration names to core and classic Durable Functions contexts.
Changes:
- Adds getter-only
OrchestrationContext.name. - Initializes the name from execution history.
- Forwards it through
context.df.name. - Adds tests and changelog updates.
| File | Description |
|---|---|
packages/durabletask-js/test/orchestration_executor.spec.ts |
Tests initialization, replay, aliases, and getter behavior. |
packages/durabletask-js/src/worker/runtime-orchestration-context.ts |
Stores and exposes the orchestration name. |
packages/durabletask-js/src/worker/orchestration-executor.ts |
Initializes the name from execution history. |
packages/durabletask-js/src/task/context/orchestration-context.ts |
Defines the public name getter. |
packages/azure-functions-durable/test/unit/orchestration-context.spec.ts |
Tests classic context integration. |
packages/azure-functions-durable/src/orchestration-context.ts |
Forwards the name through context.df. |
packages/azure-functions-durable/CHANGELOG.md |
Documents the classic API addition. |
CHANGELOG.md |
Documents the core API and breaking change. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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?
OrchestrationContext.name, populated fromExecutionStarted.namebefore invoking user code. Logical aliases and case survive replay, including one implementation registered under two names.context.df.name; do not change registration, version dispatch, orInvocationContext.functionName.Why is this change needed?
TaskOrchestrationContext.Nameand invocation-name-backed implementation, rather than deriving identity from the JavaScript function.Issues / work items
Project checklist
CHANGELOG.mdOrchestrationContextsubclasses and typed test doubles must provide the new abstractnamegetter/property.RuntimeOrchestrationContextconstructor arguments are unchanged; manually constructed contexts return""until history initializes them.AI-assisted code disclosure (required)
Was an AI tool used? (select one)
If AI was used:
AI verification (required if AI was used):
Human attestations above are intentionally unchecked; automated evidence follows.
Testing
Automated tests
nameassignment on all three context types (expected TS2540).Manual validation (only if runtime/behavior changed)
Notes for reviewers