-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle][Config] Move ConfigCachePass from FrameworkBundle to Config #21375
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
Conversation
Thanks for working on this @Deamon. Tests were broken before this PR, they have been fixed meantime, could you rebase against master so we could see if builds are green? Also I suggest to wait that at least one of the opened PRs on this subject is merged before moving the remaining passes of the todo list, the goal has been validated by maintainers but the approach might still be challenged, it would be too bad to rework several PRs in this case. |
64a0100
to
2056aaa
Compare
@chalasr, it's a pleasure :) I pushed again but it fails, I might need to update a constraint in a composer.json file somewhere maybe this one : |
@Deamon It fails because of:
This trait is part of the DI component since 3.2, so what is needed is to add
Since it must be ok to use the DI component along with the Config one without using the compiler pass introduced here, this one should not involve any conflict AFAIK. |
e4f886d
to
e9941f1
Compare
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ValidateWorkflowsPass; | ||
use Symfony\Component\Config\DependencyInjection\Compiler\ConfigCachePass; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be Symfony\Component\Config\DependencyInjection\ConfigCachePass
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed,
thanks for the review!
e9941f1
to
0c69d9c
Compare
@daemon The existing PRs regarding the same ticket have been merged, we are now sure about the right approach: add a constructor to the moved compiler pass (the new one) taking the service id in which collected services are injected as argument defaulting to the service id used in the framework (here Would you mind rebasing this and make the change? |
@chalasr I'll do that ASAP |
728ad3e
to
4ce7db9
Compare
@chalasr, PR rebased and updated with a constructor inspired from other PR and your suggestions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
@@ -17,7 +17,8 @@ | |||
], | |||
"require": { | |||
"php": ">=5.5.9", | |||
"symfony/filesystem": "~2.8|~3.0" | |||
"symfony/filesystem": "~2.8|~3.0", | |||
"symfony/dependency-injection": "~3.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO that's not a hard dependency as the Config component itself does not require the DependencyInjection component to be installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed, only a dev requirement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put this in require because we use the "PriorityTaggedServiceTrait" from DependencyInjection here.
I add it to make tests passes on PHP7.1 (travis job).
If it needs to be in require-dev even with this, I change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can skip tests when the trait is not available. And we should probably add a conflict rule for versions of the DependencyInjection component before 3.2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xabbuh are you sure for the conflict? People can use DI but not the pass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true, but it will then lead to errors when you decide to use the pass and didn't update the DI version before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I wasn't sure that it's more important than broad compatibility. Fixed it for existing passes in #21779.
We can skip tests when the trait is not available
Adding the conflict avoids the need for skipping tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok I'll push in a minute the require in dev and the conflict section
4ce7db9
to
b0c76b9
Compare
👍 Status: Reviewed |
|
||
public function process(ContainerBuilder $container) | ||
{ | ||
$resourceCheckers = $this->findAndSortTaggedServices('config_cache.resource_checker', $container); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'config_cache.resource_checker'
should be $this->resourceCheckerTag
return; | ||
} | ||
|
||
$container->getDefinition('config_cache_factory')->replaceArgument(0, $resourceCheckers); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'config_cache_factory'
should be $this->factoryServiceId
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ValidateWorkflowsPass; | ||
use Symfony\Component\Config\DependencyInjection\Compiler\ConfigCachePass; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be Symfony\Component\Config\DependencyInjection\ConfigCachePass
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Config\Tests\DependencyInjection\Compiler; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be Symfony\Component\Config\Tests\DependencyInjection;
This PR was merged into the 3.3-dev branch. Discussion ---------- [Form][Serializer] Add missing conflicts for DI | Q | A | ------------- | --- | Branch? | master | Tests pass? | yes | Fixed tickets | #21375 (comment) | License | MIT They make use of `PriorityTaggedServiceTrait` which is available since 3.2 only Commits ------- ddae4ef [Form][Serializer] Add missing conflicts for DI
9dc062b
to
1c3afb7
Compare
@chalasr everything has been corrected. |
1c3afb7
to
bce445f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Build failure is unrelated
Thank you @Deamon. |
…ameworkBundle to Config (Deamon) This PR was merged into the 3.3-dev branch. Discussion ---------- [FrameworkBundle][Config] Move ConfigCachePass from FrameworkBundle to Config | Q | A | ------------- | --- | Branch? | master<!--see comment below--> | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | yes | Tests pass? | yes/no | Fixed tickets | - <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | <!--highly recommended for new features--> This MR is part of the #21284 todo list <!-- - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. - Please fill in this template according to the PR you're about to submit. - Replace this comment by a description of what your PR is solving. --> Commits ------- bce445f Move ConfigCachePass from FrameworkBundle to Config
This MR is part of the #21284 todo list