-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Workflow] Introduce a Workflow interface, type-hint against it in Registry #23910
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
Comments
The decoration argument make sens ; I'm 👍 Do you want to create the PR? |
Sure, not a problem. Would this count as a BC? |
It's not a BC break. |
In fact, changing some of the type hints to accept |
Ouch. You are right :( How can we do ? |
We would have to first deprecate passing a Workflow that doesn't implement WorkflowInterface everywhere the typehint should change, or flag |
OK, what's the proper action here? I'll create the PR. |
Ah... nevermind, we are talking about a method, I thought a constructor. Then a possible path would be to deprecate the whole |
@chalasr, can't we accept both in the add method and add a deprecation when we pass a Workflow that does not implement the interface ? Just like the supportStrategy. |
@Simperfit nope, because removing the current typehint to allow both would break any subclass of Registry overriding the |
So, how do we tackle this? I'm guessing introducing the interface, attaching to workflow and testing the instance in all places that accept Workflow? |
@dkarlovi We can't remove/change the |
Unless we want to break BC for this, I think we can close. |
IMO it could be worth the little BC. |
Agree with @Simperfit, otherwise you're locked-in to current state "forever" without a clear way forward in the future, and we're talking about only two usage occurrences here AFAIK. If decided to do it in the future, it'll only be as complex or more so, not less. |
Another approach is to rename the method. What do you think ? |
@lyrixx 👍 The most annoying is |
Wahoo, that so much work :/ |
I can do it, what's the scope exactly? |
I think it's too late for 3.4. If I'm right, PR should be submitted against master. |
Thanks for the list @chalasr, I'll start on it this week. |
This PR was merged into the 4.1-dev branch. Discussion ---------- [Workflow] Introduce a Workflow interface | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #23910 | License | MIT | Doc PR | todo @chalasr I think all the points you made in 23910 has been done. Needs to update the docs too. Commits ------- e8351d8 [Workflow] Introduce a Workflow interface
Workflow\Registry
accepts only instances ofWorflow\Workflow
which makes decorating workflows awkward. It would allow for more flexibility if an interface was introduced here.The text was updated successfully, but these errors were encountered: