Skip to content

[Workflow] Introduce concept of SupportStrategyInterface #21334

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 2 commits into from
Jan 18, 2017

Conversation

lyrixx
Copy link
Member

@lyrixx lyrixx commented Jan 18, 2017

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

@@ -293,7 +292,12 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode)
->end()
->end()
->end()
->scalarNode('initial_place')->defaultNull()->end()
->scalarNode('support_strategy')
->cannotBeEmpty()
Copy link
Member

Choose a reason for hiding this comment

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

This looks wrong to me in case you are using the supports option.

Copy link
Member Author

Choose a reason for hiding this comment

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

1/ cannotBeEmpty != required
2/ I have added tests on it ;)

Copy link
Member

Choose a reason for hiding this comment

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

Oops, you're right.

Copy link
Member

Choose a reason for hiding this comment

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

@lyrixx this forbids resetting it to null in a subsequent config file though

Copy link
Member Author

Choose a reason for hiding this comment

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

I saw your comment in the previous PR. But I don't see a valid use case here.

@lyrixx lyrixx force-pushed the workflow-SupportStrategyInterface branch from 710c29e to 3c0e49f Compare January 18, 2017 14:42
@@ -232,7 +232,8 @@
<xsd:complexType name="workflow">
<xsd:sequence>
<xsd:element name="marking-store" type="marking_store" />
<xsd:element name="support" type="xsd:string" minOccurs="1" maxOccurs="unbounded" />
<xsd:element name="support" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="support-strategy" type="xsd:string" minOccurs="0" maxOccurs="1" />
Copy link
Member

Choose a reason for hiding this comment

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

this should be an attribute, not a child element, as having several ones does not make any sense

Copy link
Member Author

Choose a reason for hiding this comment

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

minOccurs="0" maxOccurs="1" it's already bounded. so it's not possible to have many element.
I did not set an attribute to be consistent with support.

Copy link
Member

Choose a reason for hiding this comment

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

but this is inconsistent with all configuration we have in Symfony. We use a child element only for complex values (array nodes in the Configuration class)

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, I will update it ;)

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

@lyrixx lyrixx force-pushed the workflow-SupportStrategyInterface branch from 3c0e49f to 134a58b Compare January 18, 2017 16:03
@lyrixx
Copy link
Member Author

lyrixx commented Jan 18, 2017

👍 (for the initial part)

@stof
Copy link
Member

stof commented Jan 18, 2017

👍

-----

* Deprecated class name support in `WorkflowRegistry::add()` as second parameter.
Wrap the class name in an instance of ClassInstanceSupportStrategy instead.
Copy link
Member

Choose a reason for hiding this comment

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

You should probably mention the new support_strategy option as well (not sure if it makes sense to do it here as it's related to the config in FrameworkBundle).

Copy link
Member

Choose a reason for hiding this comment

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

Actually, this should be added to the docs instead.

@fabpot
Copy link
Member

fabpot commented Jan 18, 2017

Thank you @lyrixx.

@fabpot
Copy link
Member

fabpot commented Jan 18, 2017

Thank you @andesk for the initial work on this.

@fabpot fabpot merged commit 134a58b into symfony:master Jan 18, 2017
fabpot added a commit that referenced this pull request Jan 18, 2017
…ce (andesk, lyrixx)

This PR was merged into the 3.3-dev branch.

Discussion
----------

 [Workflow] Introduce concept of SupportStrategyInterface

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

Commits
-------

134a58b [Workflow] Fixed code and tests
1843012 [Workflow] Introduce concept of SupprtStrategyInterface to allow other support checks than class instance
@andesk
Copy link
Contributor

andesk commented Jan 18, 2017

👍

Thank you for taking over, @lyrixx :)

@lyrixx lyrixx deleted the workflow-SupportStrategyInterface branch January 18, 2017 22:07
lyrixx added a commit that referenced this pull request Apr 5, 2017
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Workflow] sync the changelog

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #20751, #21334, #21933, #21935, #21950
| License       | MIT
| Doc PR        |

Commits
-------

98a18ee [Workflow] sync the changelog
@fabpot fabpot mentioned this pull request May 1, 2017
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.

6 participants