Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Workflow] Fixed marking state on leave and enter events#21793

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
lyrixx merged 1 commit intosymfony:3.2fromHeahDude:fix/workflow-enter
Mar 8, 2017

Conversation

@HeahDude
Copy link
Contributor

QA
Branch?3.2
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets~
LicenseMIT
Doc PRrelated tosymfony/symfony-docs#7528

It seems weird to me to dispatch an event while the marking is not yet marked by the new places.
The event is still "marked" by old places when leaving occurs, my guess is that the symmetry should be mirrored.

Do you agree? Should I add a test?

@HeahDude
Copy link
ContributorAuthor

@stof@lyrixx, what do you think of this? I've pushed a second commit to preserve the original order of the events.

I would also note that the marking has lost its original places for very specific "leave" events, but at this stage it may be ok to only deal with the last part of the event name or should this be fixed too?

@nicolas-grekasnicolas-grekas added this to the3.2 milestoneFeb 28, 2017
@fabpot
Copy link
Member

ping@lyrixx


privatefunctionenter($subject,Transition$transition,Marking$marking)
{
$entered =array();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This array is useless.

Copy link
Member

@lyrixxlyrixx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I really fail to see what is the real issue here: People relies on the event name, not the current marking.
More over it's a kind of BC.
Finally, if you update this method you have to update others method to mimic this behaviour.
So for me it's a 👎 is this state.

@xabbuh
Copy link
Member

@HeahDude You said this is supposed to fix a bug. If you, can you add a test case that clarifies the behaviour you expected? As for now I tend to agree with@lyrixx that there is nothing to fix.

@HeahDude
Copy link
ContributorAuthor

I've updated the PR with a first commit that adds failing tests, please look at it separately as it marks the ones actually failing without the following patches.

Then I'll try to both clarify what I stated before and to answer@lyrixx's comment:

I really fail to see what is the real issue here: People relies on the event name, not the current marking.

Ok, anyway the marking is available as part of the event object and its state should be consistent during the cycle of the workflow. Currently only the transition event is.

Events are not all named and when multiple places are left or entered the information may be lost at some point.

More over it's a kind of BC.

Every bug fix is a kind of BC break, more or less, since a thing that was happening doesn't anymore.

Finally, if you update this method you have to update others method to mimic this behaviour.

I take that as a "yes" to what I said above:

I would also note that the marking has lost its original places for very specific "leave" events, but at this stage it may be ok to only deal with the last part of the event name or should this be fixed too?

Hence the new third commit of this PR to fix the "leave" related events.

I have no hard feeling about this, but while documenting it in the docs PR linked in the description, it felt just weird to explain it as is.

Thanks for your reviews.

@HeahDude
Copy link
ContributorAuthor

(Tests failure are unrelated).


privatefunctionenter($subject,Transition$transition,Marking$marking)
{
foreach ($enter =$transition->getTos()as$place) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

enter ->places ? because right now, it has the same name as the method. It's weird to me. And So update the$from from theleave method to be consistent.

@HeahDude
Copy link
ContributorAuthor

Fixed, rebased and squashed!

@HeahDudeHeahDudeforce-pushed thefix/workflow-enter branch 4 times, most recently from2237b0a to0fd621cCompareMarch 7, 2017 13:18
@HeahDude
Copy link
ContributorAuthor

I've just merged@lyrixx patch for tests coding style.

This one should be ready now. Thanks!

privatefunctionenter($subject,Transition$transition,Marking$marking)
{
foreach ($places =$transition->getTos()as$place) {
$marking->mark($place);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is a bit weird to me. The event is namedenter and notentered. So for me the event should be dispatchedbefore the actual marking.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I agree (theworkflow.entered event was added in#20787 by the way)

HeahDude reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I've missed that! Thanks

@HeahDude
Copy link
ContributorAuthor

Last comments addressed.

@HeahDudeHeahDude changed the title[Workflow] Fixed marking state on enter events[Workflow] Fixed marking state on leave and enter eventsMar 8, 2017
@lyrixx
Copy link
Member

👍

Copy link
Member

@xabbuhxabbuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

👍

@lyrixx
Copy link
Member

Thanks Jules.

@lyrixxlyrixx merged commit175858a intosymfony:3.2Mar 8, 2017
lyrixx added a commit that referenced this pull requestMar 8, 2017
…HeahDude)This PR was merged into the 3.2 branch.Discussion----------[Workflow] Fixed marking state on leave and enter events| Q             | A| ------------- | ---| Branch?       | 3.2| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | ~| License       | MIT| Doc PR        | related tosymfony/symfony-docs#7528It seems weird to me to dispatch an event while the marking is not yet marked by the new places.The event is still "marked" by old places when leaving occurs, my guess is that the symmetry should be mirrored.Do you agree? Should I add a test?Commits-------175858a [Workflow] Fixed marking state on leave and enter events
@HeahDude
Copy link
ContributorAuthor

Thank you for reviewing and merging.

@HeahDudeHeahDude deleted the fix/workflow-enter branchMarch 8, 2017 20:08
@fabpotfabpot mentioned this pull requestMar 9, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@lyrixxlyrixxlyrixx left review comments

@xabbuhxabbuhxabbuh approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

3.2

Development

Successfully merging this pull request may close these issues.

6 participants

@HeahDude@fabpot@xabbuh@lyrixx@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp