Closed (fixed)
Project:
Drupal core
Version:
10.0.x-dev
Component:
base system
Priority:
Critical
Category:
Plan
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
7 Jun 2022 at 12:37 UTC
Updated:
21 Nov 2022 at 11:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
gábor hojtsyComment #3
spokjeA "What-Would-Break-If-Symfony-6.2-Would-Be-Released-Today" patch.
Comment #4
catchPicking a random test failure and clicking on it, I see these two, which look like they'd be the reason there's thousands of test failures:
Since we can't fix them until we require Symfony 6.2, we'll need to suppress the deprecation messages until then.
Comment #5
larowlanChanges in the argument resolver are yielding this for me for any route that uses the entity routing defaults
ArgumentCountError: Too few arguments to function Drupal\Core\Entity\Controller\EntityController::addTitle()The entity_type_id argument isn't being resolved from the route.
Comment #6
andypostre-queued #3 as #3304991: [Symfony 6] HttpKernel should opt-in to catching `\Throwable` commited
Comment #7
spokjeComment #8
andypostupdated patch from #3
Comment #9
andypostsorry for x-post, wondering why your patch is x2 smaller
Comment #10
spokjeMight have something to do with including .orig and .rej in yours?
Comment #11
spokjeComment #12
spokjeComment #13
andypost674 failed vs 1253 in #11 with only one exclude
Comment #14
spokjeLess bad !== good, but we're getting there :)
Comment #15
catchRe-rolled. Patch is about the same size so hopefully got it right.
Comment #16
catchStarted looking at #3284422-5: [META] Symfony 6.2 compatibility.
https://github.com/symfony/symfony/pull/47363 is a big difference for ArgumentValueResolvers, but after updating our two for that in case it was a bug in the bc layer, still getting the same error.
The other big commit is https://github.com/symfony/symfony/commit/0f2293c983744b744085e2dd67d89d... - haven't really started looking at that yet.
Comment #17
catchOK that one's the problem. Specifically the removal of this hunk:
https://github.com/symfony/symfony/pull/46001/files#diff-d3747dd395ddb12...
Comment #18
catchhttps://github.com/symfony/symfony/pull/47461
Comment #19
andypostMy patch in #9 is bigger because more changes in lock-file - much more changes because of stability flags /cc @Spokje
@catch comparing to usage of
^6.2@dev, like it was in previous patches, does not pick latest codebaseearlier patches
Comment #20
catchOnce https://github.com/symfony/symfony/pull/47468 is merged we should do a new test run, with the change from #19 too. The upstream regression was breaking almost every functional test in core so probably responsible for most of the remaining few hundred failures.
Comment #21
andypostregression merged https://github.com/symfony/symfony/commit/0e288486dfa1e46ee2f376ce53592f...
Comment #22
andypostreroll
Comment #23
andypostfix CS
Comment #24
andypostMissed to bump SF console
Comment #25
andypostThe last error message is
3x: Since symfony/validator 6.2: The "loose" mode is deprecated. The default mode will be changed to "html5" in 7.0.Comment #26
andypostit's from https://symfony.com/doc/6.2/reference/configuration/framework.html#email...
related to #3054535: Discuss whether to decouple from Symfony Validator
Comment #27
andypostThe warning comes from
\Symfony\Component\Validator\Constraints\EmailValidator::__construct()Core using class_resolver to instantiate constraint so no way to pass new option to constructor, so add to suppressions
Comment #28
catchWe can subclass for that one.
Although that brings up the question - if our constraint is setting mode = strict, is there any point if the validator is instantiated with mode = loose? Wondering if our existing logic (from 2014 (!)) to set mode = strict ever actually worked and it's been loose all this time.
Comment #29
catchComment #30
andypostLess strict mode is HTML5 (just a test run)
Moreover the Strict mode requires email validator!
PS: fixed class name
Comment #33
andypost3 tests fail
2 - expected
and
Drupal\FunctionalTests\Bootstrap\UncaughtExceptionTestnot clearComment #34
catchUncaughtExceptionTestThat is hopefully straightforward
The Kernel behaviour change with catching exceptions means the uncaught exception we were looking for is now a caught exception, so we just need to remove that test method altogether.
However it also looks like that upstream change might get reverted in https://github.com/symfony/symfony/pull/47467 - if so we'd need to revert the container changes and test method removal here, and deal with it when we work on Symfony 7 compatibility.
Comment #36
spokje@catch Looks like you're fixing the wrong test function?
Testrun:
Interdiff:
- public function testMissingDependency() {Comment #37
spokjeReverting unwanted status change.
Comment #38
catchHelps when you remove the right test method.
Comment #39
catchRe-rolled.
Comment #40
catchForgot to add a file..
Comment #42
catchThe three failures are expected due to changing stability to dev, so that's everything we need for now.
Split out #3307736: EmailValidator defaults to 'loose' mode which is deprecated in Symfony 6.2 to its own issue.
Everything else probably needs to stay in here?
Comment #43
andypostI bet it needs new issue
Comment #44
catch@andypost so we can't do a new issue as a prerequisite of updating to Symfony 6.2 because the new interface isn't available yet. I guess we could suppress the deprecation, update to 6.2, then resolve the deprecation in a new issue though.
Comment #45
andypostFiled new child #3312075: Make \Drupal\Tests\Component\EventDispatcher\ContainerAwareEventDispatcherTest more inline with Symfony 6.2
Comment #46
catchComment #47
andypostComment #48
mondrakeSymfony 6.2.0-BETA1 is out, https://github.com/symfony/phpunit-bridge/releases/tag/v6.2.0-BETA1
Comment #49
spokjeLet's start of with a patch that _only_ updates all our symfony/* dependencies
Comment #50
spokjeLet's retry that after two more mugs of coffee...
Comment #51
spokjeComment #52
spokjeHmm, let's try to suppress the deprecation message which we're doing initially in #3306886: Suppress SF6.2 deprecation message for Request::getContentType()
Comment #56
phenaproximaI hope this is okay, but I'd like to hide patches in favor of a merge request.
Comment #57
longwaveThree Symfony packages were not updated from 6.1 to 6.2 beta, pushed changes to composer.* for those.
The remaining test fail is related to this change in upstream HttpKernel: https://github.com/symfony/http-kernel/commit/2edca008dde746f6450c6b0499...
HttpKernel now catches all throwables instead of just exceptions, so this error is now caught there. Locally if I change the $handleAllThrowables argument to HttpKernel from true to false then UncaughtExceptionTest passes again; not sure what else that will break, so sending it for a test run to see.
Comment #58
longwaveUploading a patch of the current MR, as Gitlab is backlogged at the moment and hasn't noticed my commits yet.
Comment #59
longwaveOops, the diff link is out of date as well. Trying again.
Comment #60
andypostGreat job mostly done!
I suppose this change is not permanent
this change is debatable because it set as opt-in intentionally in #3304991: [Symfony 6] HttpKernel should opt-in to catching `\Throwable`
Comment #61
longwaveRe #60.1 the change from stable to beta will be reverted when the stable release of Symfony 6.2 is out.
Re the change in core.services.yml, we have two options here:
1. Keep the argument as true, remove
UncaughtExceptionTest::testMissingDependencyCustomErrorHandler()and disallow custom error handlers to be set in index.php. This was initially added in #2521852: Make it possible to use your own exception handler2. Change the argument to false and drop support for #3304991: [Symfony 6] HttpKernel should opt-in to catching `\Throwable`
Comment #62
longwaveDiscussed with @catch, as we need HTTP kernel error handling to provide better errors in REST/JSON/etc and there is probably no real use case for custom error handlers in index.php (but users can still opt in if they wish), I opened #3319170: Change the http_kernel.basic service to use Symfony 6.2's default of catching all throwables for #61.1
Comment #63
catchWhen we did #3304991: [Symfony 6] HttpKernel should opt-in to catching `\Throwable` Symfony was going to remove the old behaviour entirely in Symfony 7 so we didn't have a lot of choice, but they've now rolled back the deprecation so that it's more optional. However I do still think that's a good change and the follow-up to finish it off properly seems the best way to deal with it.
Comment #64
mondrakeThis is out scope? One blank line removed from the end of the file.
Obviously a nit, the rest seems sensible to me.
Comment #66
catchCommitted/pushed to 10.1.x and cherry-picked to 10.0.x, thanks!
I've opened #3319426: Update to a stable Symfony 6.2 release as a placeholder for the next release update.
Comment #67
longwave