-
Notifications
You must be signed in to change notification settings - Fork 40
Workflow Versioning #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…rom previous iterations Signed-off-by: Whit Waldo <[email protected]>
Generally support this proposal as it seems to offer some basic but useful versioning capabilities that people can easily grok. Great to see the actual end-user Developer experience thoughtfully considered. |
Thanks for the proposal! A few thoughts and questions:
|
Signed-off-by: Whit Waldo <[email protected]>
Signed-off-by: Whit Waldo <[email protected]>
Signed-off-by: Whit Waldo <[email protected]>
…tegy Signed-off-by: Whit Waldo <[email protected]>
…ately in another proposal already Signed-off-by: Whit Waldo <[email protected]>
…d runtime Signed-off-by: Whit Waldo <[email protected]>
Thank you for reviewing my proposal and giving it some consideration. I certainly appreciate your time! As a key differentiator to this proposal over most others provided in To that end then, the precise particulars of how this works would be entirely up to the SDK maintainers and contributors. That said, In the effort to bring some clarity to the proposal, I've answered your questions in light of how I would build this in the .NET SDK.
This is entirely up to each SDK to handle as their maintainers see fit though my guidance would be no, this should never be a default. I would consider it to be a potential breaking change (as I have no idea what anyone has named their workflows to date or if they have some sort of versioning implementation in place already). I would, however, feel fine adding a new method for I've modified the example in the "SDK Example" section to reflect this.
Because versioning requires an explicit opt-in (either at the application or per-type basis), the developer would need to add the appropriate annotation to the workflow registration accordingly. At that point, it depends on the specified strategy. If the developer has opted into the
Exactly.
There's no shape necessary (or possible) as that call is made to the runtime to invoke In other words, another app would never call into I've updated the whole proposal to be a little clearer on this point.
This is a helper mechanism that allows a developer to opt into versioning for all types (e.g.,
Deletion safety aside, I do think there are many excellent opportunities to use source generators and Roslyn Analyzers throughout this in the .NET implementation, but again, the availability of such tooling would vary by SDK:
|
Thank you for the responses. I would like to hear your thoughts about an alternative approach to workflow registration with the goal of making simpler the transition of a workflow to another version, as well as to provide freedom of naming conventions to the SDK users. I was thinking we could expose something along this lines:
Both This would allow the user use any naming they prefer, and to have multiple versions of the same workflow. Even they could rename the old workflow to something like In terms of implementation, I can think of three situations we need to handle:
|
My key objection to your proposal is the requirement that all versioned types be registered directly with the runtime and the implication that it's strictly up to the runtime to decide which type to invoke and when. My approach centers on the following high-level observations:
As such, my approach goes out of its way to avoid making this require any substantial changes to the runtime. Your approach offloads versioning to the runtime. There are precious few benefits to having the runtime manage versioning logic. The only one that comes to mind is the centralization (and thus standardization) of the capability, but building on my observations, I see several meaningful cons to this approach:
All that to say that with regards to the situations you cited, here would be my preferred SDK-first approach:
But that's it - in any other situation that doesn't involve replay, Dapr simply calls the registered type as it does today an it's up to the SDK to route accordingly and respond with the name of the type it selected. This way daprd needn't know:
|
Thanks for your response. My approach is also SDK-only. When I talk about workflow registration, that would be at the SDK level. The SDK would get registered all the versions of a workflow, but will only register with the runtime once. The runtime would not need to change at all, the So, if we have the following:
Only Please re-read my previous comment with this in mind :) |
Following our sync on Discord, I think you might understand better why I'm pushing for the version I am. By using a string value when starting a new workflow (and thus receiving it from runtime for any in-progress workflow to ensure the app runs the consistent type each time under a terminal state), the logic becomes simple:
Please let me know if you have any other questions in light of our conversation this morning! |
In light of the discussion around variations of workflow re-runs and the community ask for versioning, I wanted to introduce a new proposal that marries @JoshVanL 's Rerun from Activity proposal to a versioning migration scheme that addresses the issue I raised in one of the comments regarding base type inconsistency in running ad-hoc workflows against versioned underlying types.
I've gone through a couple iterations of this with others and this is the most recent version of the idea. Because the runtime isn't familiar with the type implementations of the workflows themselves in the application, this instead leans more on minor state changes on the workflow actor and changes to workflow resolution at the SDKs themselves than the runtime. At some point, following some feedback on this, I'd like to move ahead with a POC to prove out the concept, but I wanted to toss it out there first to see if I'm missing anything really obvious.
I've written this proposal assuming that we're wanting to move forward with both the Multi-App Workflows and the Rerun from Activity proposals to accommodate both in a way that enables all three concepts.
Thank you for the consideration!