Skip to content

[FrameworkBundle][Routing][Translation][Workflow] Move some compiler passes from FrameworkBundle to components #52032

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
Oct 19, 2023

Conversation

fancyweb
Copy link
Contributor

Q A
Branch? 6.4
Bug fix? no
New feature? no
Deprecations? yes
Tickets -
License MIT

Move AddExpressionLanguageProvidersPass to symfony/routing
Move DataCollectorTranslatorPass and LoggingTranslatorPass to symfony/translation
Move WorkflowGuardListenerPass to symfony/workflow

@fancyweb fancyweb force-pushed the fwb/move-workflow-cp branch from 058c80e to d6e5b16 Compare October 13, 2023 10:08
@@ -157,7 +157,7 @@ public function build(ContainerBuilder $container)
$this->addCompilerPassIfExists($container, TranslatorPass::class, PassConfig::TYPE_BEFORE_OPTIMIZATION, -32);
$this->addCompilerPassIfExists($container, TranslatorPathsPass::class, PassConfig::TYPE_AFTER_REMOVING);
$container->addCompilerPass(new LoggingTranslatorPass());
$container->addCompilerPass(new AddExpressionLanguageProvidersPass(false));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's no constructor so the argument is unused.

@fancyweb fancyweb force-pushed the fwb/move-workflow-cp branch 2 times, most recently from 5041b7d to ed7a6ff Compare October 18, 2023 07:25
@nicolas-grekas nicolas-grekas added the ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" label Oct 18, 2023
@fancyweb fancyweb force-pushed the fwb/move-workflow-cp branch from 722d04e to 9bde6ce Compare October 18, 2023 16:23
@nicolas-grekas
Copy link
Member

Thank you @fancyweb.

@nicolas-grekas nicolas-grekas merged commit f5178e0 into symfony:6.4 Oct 19, 2023
@fancyweb fancyweb deleted the fwb/move-workflow-cp branch October 19, 2023 15:16
@PhilETaylor
Copy link
Contributor

Think this broke something on a stable 6.4.x-dev upgraded to

- Upgrading symfony/framework-bundle (6.4.x-dev 6499aed => 6.4.x-dev afc557e): Extracting archive

I dont have symfony/workflow installed in my project and now I get this:

 [KO]
Script base:composer:manifest returned with error code 255
!!  Symfony\Component\ErrorHandler\Error\ClassNotFoundError {#175
!!    #message: """
!!      Attempted to load class "WorkflowGuardListenerPass" from namespace "Symfony\Component\Workflow\DependencyInjection".\n
!!      Did you forget a "use" statement for "Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\WorkflowGuardListenerPass"?
!!      """
!!    #code: 0
!!    #file: "./vendor/symfony/framework-bundle/FrameworkBundle.php"
!!    #line: 171
!!    trace: {
!!      ./vendor/symfony/framework-bundle/FrameworkBundle.php:171 { …}
!!      ./vendor/symfony/http-kernel/Kernel.php:630 { …}
!!      ./vendor/symfony/http-kernel/Kernel.php:603 { …}
!!      ./vendor/symfony/http-kernel/Kernel.php:505 { …}
!!      ./vendor/symfony/http-kernel/Kernel.php:757 { …}
!!      ./vendor/symfony/http-kernel/Kernel.php:126 { …}
!!      ./vendor/symfony/framework-bundle/Console/Application.php:184 { …}
!!      ./vendor/symfony/framework-bundle/Console/Application.php:72 { …}
!!      ./vendor/symfony/console/Application.php:175 { …}
!!      ./vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:49 { …}
!!      ./vendor/autoload_runtime.php:29 { …}
!!      ./bin/console:11 {
!!        ›
!!        › require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
!!        ›
!!        arguments: {
!!          "/Users/phil/Sites/myBackups.guru/vendor/autoload_runtime.php"
!!        }
!!      }
!!    }
!!  }
!!  2023-10-19T17:32:19+00:00 [critical] Uncaught Error: Class "Symfony\Component\Workflow\DependencyInjection\WorkflowGuardListenerPass" not found
!!  2023-10-19T17:32:19+00:00 [info] User Deprecated: Since symfony/framework-bundle 6.4: The "Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\WorkflowGuardListenerPass" class is deprecated, use "Symfony\Component\Workflow\DependencyInjection\WorkflowGuardListenerPass" instead.
!!
Script @auto-scripts was called via post-update-cmd

@fancyweb
Copy link
Contributor Author

fancyweb commented Oct 19, 2023 via email

@PhilETaylor
Copy link
Contributor

PhilETaylor commented Oct 19, 2023

@fancyweb I have logged this here #52187 so that this comment doesnt get lost, I see you posted by email and might be unable to address it right away, so hope an open issue prevents duplicate issues (No pressure from me or rush needed, but the framework in 6.4.x is broken at the moment :)) - Also PayPal 💰

fabpot added a commit that referenced this pull request Oct 20, 2023
… only if it exists (smnandre)

This PR was merged into the 6.4 branch.

Discussion
----------

[FrameworkBundle][Workflow] Add `WorflowGuardListenerPass` only if it exists

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #52187
| License       | MIT

As spotted by `@PhilETaylor` (in [this comment](#52032 (comment))) the framework is broken in 6.4-dev when the worflow component is not installed.

This PR fixes that by registering the compiler pass only if available.

Commits
-------

1ba348a Add WorflowGuardListenerPass only if it exists
symfony-splitter pushed a commit to symfony/framework-bundle that referenced this pull request Oct 20, 2023
… only if it exists (smnandre)

This PR was merged into the 6.4 branch.

Discussion
----------

[FrameworkBundle][Workflow] Add `WorflowGuardListenerPass` only if it exists

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #52187
| License       | MIT

As spotted by `@PhilETaylor` (in [this comment](symfony/symfony#52032 (comment))) the framework is broken in 6.4-dev when the worflow component is not installed.

This PR fixes that by registering the compiler pass only if available.

Commits
-------

1ba348a7e13 Add WorflowGuardListenerPass only if it exists
fabpot added a commit that referenced this pull request Oct 20, 2023
…cyweb)

This PR was merged into the 7.0 branch.

Discussion
----------

[FrameworkBundle] Remove deprecated compiler passes

| Q             | A
| ------------- | ---
| Branch?       | 7.0
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT

Remove deprecated code in #52032

Commits
-------

7984404 [FrameworkBundle] Remove deprecated compiler passes
nicolas-grekas added a commit that referenced this pull request Oct 20, 2023
…er passes (fancyweb)

This PR was merged into the 6.4 branch.

Discussion
----------

[FrameworkBundle] Fix requiring moved translation compiler passes

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #52032 (comment)
| License       | MIT

Those 2 also need to be required conditionally since symfony/translation is not a hard dependency of FWB.

Commits
-------

2b95681 [FrameworkBundle] Fix requiring moved translation compiler passes
symfony-splitter pushed a commit to symfony/framework-bundle that referenced this pull request Oct 20, 2023
…er passes (fancyweb)

This PR was merged into the 6.4 branch.

Discussion
----------

[FrameworkBundle] Fix requiring moved translation compiler passes

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | symfony/symfony#52032 (comment)
| License       | MIT

Those 2 also need to be required conditionally since symfony/translation is not a hard dependency of FWB.

Commits
-------

2b95681764 [FrameworkBundle] Fix requiring moved translation compiler passes
This was referenced Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecation FrameworkBundle Routing ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" Status: Reviewed Translation Workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants