Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Description Enhancer integration #29

Merged
merged 4 commits into from
Jun 20, 2016
Merged

Description Enhancer integration #29

merged 4 commits into from
Jun 20, 2016

Conversation

dantleech
Copy link
Member

Integrates description enhancers (replaces #26 ).

cmf_resource:
    description:
        enhancers: [ "sonata_admin", "foobar" ]

@dantleech dantleech mentioned this pull request May 28, 2016
@dantleech dantleech closed this May 28, 2016
@dantleech dantleech removed the wip/poc label May 28, 2016
@dantleech dantleech reopened this May 28, 2016
@dantleech dantleech force-pushed the description_enhancers branch 2 times, most recently from d72e4f5 to ea041bf Compare May 28, 2016 13:54
foreach ($inactiveEnhancers as $inactiveEnhancer) {
$container->removeDefinition($serviceId);
unset($enhancers[$inactiveEnhancer]);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This shifts the responsiblity of marking the services as private

Copy link
Member

Choose a reason for hiding this comment

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

I would not do this, it'll add unexpected behaviour. (and marking all services private by default is a very good practice)

Btw, the current code doesn't work, $serviceId will always have the same value (the last value of the previous loop) as it isn't used in this foreach loop.

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 can imagine people running into problems and we answer them with "you must mark the service as private" . But such cases should be rare, I don't care very much, will change it.

Copy link
Member

@dbu dbu May 31, 2016 via email

Choose a reason for hiding this comment

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

Copy link
Member Author

@dantleech dantleech May 31, 2016

Choose a reason for hiding this comment

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

We need to remove the unused enhancers because they may contain references to services which don't exist (e.g. sonata.admin_pool)- and I believe that will cause the container to fail.

@wouterj
Copy link
Member

wouterj commented May 29, 2016

The XSD file also has to be updated.


</services>
</container>

Copy link
Member Author

Choose a reason for hiding this comment

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

dd

@dantleech dantleech force-pushed the description_enhancers branch 2 times, most recently from c757e3a to b0a30c5 Compare June 5, 2016 10:16
@dantleech
Copy link
Member Author

The XSD file also has to be updated.

@wouterj I don't think we have one yet.

"symfony-cmf/resource": "^1.0"
"symfony/options-resolver": "^2.7|3.*",
"symfony-cmf/resource": "dev-admin_metadata",
"puli/repository": "@beta"
Copy link
Member Author

@dantleech dantleech Jun 5, 2016

Choose a reason for hiding this comment

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

I'm not sure we can avoid doing this. The packages minimum-stability is dev, so the implicit Puli version is dev-master, which is "behind" @beta (it has Resource instead of PuliResource). If we remove the minimum-stability then we still need to specify the unstable @beta version.

Copy link
Member

Choose a reason for hiding this comment

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

The problem here is that both 1.1 and 1.0 aren't stable of Puli. Our version constraint in symfony-cmf/resource is something like ^1.0.0-betaN. As dev versions are allowed, puli will use 1.1.0-dev (as it's the highest dev version in the version constraint).

If we would do ~1.0.0-betaN in symfony-cmf/resource, things work as expected (it'll install the 1.0 dev branch and not master).

Copy link
Member Author

@dantleech dantleech Jun 15, 2016

Choose a reason for hiding this comment

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

nope, still doesn't work. installs dev-master, at least with ^, do you think it will work differently with ~ ?

@dantleech
Copy link
Member Author

Happy for this to be merged once #29 is done (and the composer.json has been updated here).

<tag name="cmf_resource.description.enhancer" alias="sonata_admin" />
</service>

<service id="cmf_resource.description.enhancer.sylius_resource" class="Symfony\Cmf\Component\Resource\Description\Enhancer\Sylius\ResourceEnhancer">
Copy link
Member

Choose a reason for hiding this comment

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

let's make all these services private.

@dantleech
Copy link
Member Author

Updated

@dantleech
Copy link
Member Author

@wouterj good to merge?

xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<parameters>
<parameter key="cmf_resource.registry.container.class"></parameter>
Copy link
Member

Choose a reason for hiding this comment

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

should be removed

@wouterj wouterj merged commit 20eee84 into master Jun 20, 2016
@wouterj wouterj deleted the description_enhancers branch June 20, 2016 08:26
@wouterj wouterj removed the wip/poc label Jun 20, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants