Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Workflow] Deprecate MultipleStateMarkingStore and SingleStateMarkingStore in favor of MethodMarkingStore #30551

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

Merged
merged 1 commit into from
Mar 22, 2019

Conversation

lyrixx
Copy link
Member

@lyrixx lyrixx commented Mar 13, 2019

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets
License MIT
Doc PR

@nicolas-grekas nicolas-grekas added this to the next milestone Mar 13, 2019
@lyrixx lyrixx force-pushed the w-deprecate-marking-store branch 7 times, most recently from cde1f17 to e95c3a4 Compare March 13, 2019 17:24
@lyrixx
Copy link
Member Author

lyrixx commented Mar 13, 2019

@nicolas-grekas I don't understand the failure.


1) Symfony\Bridge\Twig\Tests\Extension\WorkflowExtensionTest::testCanTransition
Symfony\Component\Workflow\Exception\LogicException: The method "stdClass::getMarking()" does not exists.
/home/travis/build/symfony/symfony/src/Symfony/Bridge/Twig/vendor/symfony/workflow/MarkingStore/MethodMarkingStore.php:54
/home/travis/build/symfony/symfony/src/Symfony/Bridge/Twig/vendor/symfony/workflow/Workflow.php:49
/home/travis/build/symfony/symfony/src/Symfony/Bridge/Twig/vendor/symfony/workflow/Workflow.php:90
/home/travis/build/symfony/symfony/src/Symfony/Bridge/Twig/Extension/WorkflowExtension.php:55
/home/travis/build/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/WorkflowExtensionTest.php:68

I do not use anymore stdClass anymore.

Do you have an idea ?

@nicolas-grekas
Copy link
Member

The bridge 4.2 is loaded with workflow 4.3 and this fails.

@lyrixx lyrixx force-pushed the w-deprecate-marking-store branch 3 times, most recently from 8e34c44 to a2c4ffb Compare March 13, 2019 19:44
@lyrixx
Copy link
Member Author

lyrixx commented Mar 13, 2019

Okay. Got it. old components are tested against master (this PR) (see this )

@lyrixx lyrixx force-pushed the w-deprecate-marking-store branch 4 times, most recently from 81c0274 to 262b9eb Compare March 16, 2019 01:18
@lyrixx
Copy link
Member Author

lyrixx commented Mar 17, 2019

This PR is now ready

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

+1 with minor comments, thanks.

@lyrixx lyrixx force-pushed the w-deprecate-marking-store branch from bb776b7 to 4d58beb Compare March 22, 2019 14:53
@lyrixx lyrixx merged commit 4d58beb into symfony:master Mar 22, 2019
lyrixx added a commit that referenced this pull request Mar 22, 2019
…eStateMarkingStore in favor of MethodMarkingStore (lyrixx)

This PR was merged into the 4.3-dev branch.

Discussion
----------

[Workflow] Deprecate MultipleStateMarkingStore and SingleStateMarkingStore in favor of MethodMarkingStore

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

4d58beb [Workflow] Deprecate MultipleStateMarkingStore and SingleStateMarkingStore in favor of MethodMarkingStore
@lyrixx lyrixx deleted the w-deprecate-marking-store branch March 22, 2019 15:05
marking_store:
type: method
arguments:
- true
Copy link
Contributor

Choose a reason for hiding this comment

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

I am coming to this late because it was merged yesterday, but in my opinion the DX of this change is not good.

Reading the YAML config file, the meaning of this first argument is not clear (what does true mean?).

For specifying a custom property name (as I do) with a multiple state workflow, I now need to remember to do:

framework:
    workflows:
        article:
            marking_store:
                type: method
                arguments:
                    - false
                    - myColumnName

This being YAML, can we use named arguments here? The code would then become:

framework:
    workflows:
        article:
            marking_store:
                type: method
                arguments:
                    singleState: false
                    property: myColumnName

Copy link
Contributor

Choose a reason for hiding this comment

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

I fully agree with that I was about to open an issue for it. We should only rely on the type (workflow or state_machine) and don't care about that argument. so we could simplify by:

framework:
    workflows:
        article:
            type: state_machine
            marking_store:
                type: method
                property: myColumnName

Copy link
Member

Choose a reason for hiding this comment

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

Please don't discuss on closed issues/PR

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes I've just opened #30656.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants