.NET: [BREAKING] Unify ExecutorIsh and ExecutorRegistration, unify/simplify APIs#1637
Conversation
8d015db to
b2978c4
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR removes the ExecutorIsh type and unifies its functionality with ExecutorRegistration, now implemented as a record-based type hierarchy. The change simplifies the API by normalizing extension methods to .AsExecutor() and .RegisterExecutor(), while obsoleting older methods like .ConfigureFactory() and .ConfigureSubworkflow().
Key Changes:
- Replaced
ExecutorIshwith an abstractExecutorRegistrationrecord class hierarchy - Added concrete registration types:
ExecutorInstanceRegistration,SubworkflowRegistration,RequestPortRegistration,AIAgentRegistration,PlaceholderRegistration, andConfiguredExecutorRegistration - Updated all extension methods to use
.AsExecutor()and.RegisterExecutor()naming conventions
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| ExecutorIsh.cs | Deleted file - entire ExecutorIsh type removed |
| ExecutorRegistration.cs | Converted from internal sealed class to public abstract record class with type hierarchy |
| ExecutorRegistrationExtensions.cs | New file containing unified extension methods for creating registrations |
| ExecutorInstanceRegistration.cs | New registration type for executor instances |
| SubworkflowRegistration.cs | New registration type for workflows used as executors |
| RequestPortRegistration.cs | New registration type for request ports |
| AIAgentRegistration.cs | New registration type for AI agents |
| PlaceholderRegistration.cs | New registration type for unbound executor references |
| ConfiguredExecutorRegistration.cs | New registration type for configured executors |
| WorkflowBuilder.cs | Updated to use ExecutorRegistration instead of ExecutorIsh |
| Workflow.cs | Updated property names and reset logic for new registration model |
| Sample files | Updated to use new .AsExecutor() and .RegisterExecutor() methods |
b2978c4 to
8549eae
Compare
8549eae to
240deb3
Compare
|
Good riddance |
|
For thew new public registration types, is there sample debt being incurred here? If so, can some issues be created to track new samples that might be desired? |
|
Are there any patterns here that should be channeled back into the python platform? @ekzhu? |
|
Do we have tests that cover the issues being closed? |
240deb3 to
7cab9ad
Compare
83af7d5 to
c45bb5c
Compare
c45bb5c to
6bcac73
Compare
6bcac73 to
42cde51
Compare
* Switch to more modern Record type-tree for Sum Types * Unify APIs for getting ExecutorBinding * Fix an issue where workflows consisting entirely of cross-run shareable executors which are not instance-resettable do not properly clear state when running non-concurrently.
42cde51 to
a333131
Compare
|
I hope this is an OK place to ask this, but I'm seeing that in these changes in I don't know if that's a bug, or if it's not intended that one would set both the |
|
Looks like #1840 addressed the issue I was having. |
Concurrent run support was recently added to workflows, but Orchestrations did not fully update to support it. A few executors were missing Cross-Run Shareable annotations, and the ConcurrentEnd executor needed to be factory-instantiated. This also ports the fix for microsoft#1613 from microsoft#1637, to avoid waiting on that PR.
…mplify APIs (microsoft#1637) * refactor: Unify ExecutorIsh and ExecutorRegistration => ExecutorBinding * Switch to more modern Record type-tree for Sum Types * Unify APIs for getting ExecutorBinding * Fix an issue where workflows consisting entirely of cross-run shareable executors which are not instance-resettable do not properly clear state when running non-concurrently. * feat: Simplify function-to-executor pattern * refactor: Normalize API naming
Motivation and Context
ExecutorIsh, a type built to work around the lack of full support for anonymous discriminated unions in .NET, leads to confusion, and makes it difficult to find how to integrateExecutor-like types into a workflow. It also duplicates some functionality withExecutorRegistration, and now that something broke in F#'s ability to feed the auto-cast types toWorkflowBuilderthe value of the split between the two is lowered.Description
ExecutorIshandExecutorRegistration, relying on the record type hierarchy for sum-type-like behaviourExecutorRegistrations:.AsExecutor()and.RegisterExecutor()Breaking:
ExecutorIshtype, in favour ofExecutorRegistration.ConfigureFactory()and.ConfigureSubworkflow()extension methods in favour of.RegisterExecutor()and.AsExecutor(), respectivelyRelevant Issues:
Contribution Checklist