Recommended commit message

git commit -m 'Issue #2470693 by Bedir, dawehner, jibran, znerol, hussainweb, pwolanin: Upgrade to Symfony 2.7.0'

Symfony 2.7 beta is out. I think we should upgrade since we are tracking stables.

This issue basically checks if all the tests pass with Symfony 2.7. This is the changelog.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Task because it is an external library upgrade.
Issue priority Critical because Symfony 2.7.x is required for PHP7 support and because 2.7.x is an LTS that be used throughout D8's lifecycle.
Disruption Not disruptive.
CommentFileSizeAuthor
#77 2470693-77.patch3.09 MBdawehner
#76 interdiff.txt2.22 KBznerol
#70 interdiff.txt5.67 KBdawehner
#70 2470693-70.patch3.09 MBdawehner
#65 2470693-64-interdiff.txt2.12 KBBerdir
#65 2470693-64.patch3.04 MBBerdir
#63 2470693-63-interdiff.txt1.67 KBBerdir
#63 2470693-63.patch3.04 MBBerdir
#60 2470693-review.txt63.44 KBdawehner
#60 2470693-60.patch3.08 MBdawehner
#59 upgrade_to_symfony_2_7_0-2470693-59.patch3.01 MBjibran
#59 upgrade_to_symfony_2_7_0-2470693-59-do-not-test.patch68 KBjibran
#44 interdiff.txt847 bytesdawehner
#44 2470693-44.patch2.71 MBdawehner
#43 interdiff.txt746 bytesdawehner
#43 2470693-43.patch2.71 MBdawehner
#43 interdiff.txt746 bytesdawehner
#43 2470693-43.patch2.71 MBdawehner
#39 upgrade_to_symfony_2_7_0-2470693-do-not-test.patch63.59 KBjibran
#38 upgrade_to_symfony_2_7_0-2470693-38.patch2.71 MBjibran
#36 interdiff.txt1.06 KBdawehner
#36 2470693-36.patch2.72 MBdawehner
#34 2470693-34.patch2.71 MBdawehner
#32 2470693-32.patch2.71 MBdawehner
#30 interdiff.txt21.06 KBdawehner
#30 2470693-30.patch2.71 MBdawehner
#28 2470693-28-interdiff.txt4.03 KBBerdir
#28 2470693-28.patch2.25 MBBerdir
#26 2470693-26.patch2.25 MBBerdir
#26 2470693-26-interdiff.txt853 bytesBerdir
#22 interdiff.txt7.74 KBdawehner
#22 2470693-22.patch5.45 MBdawehner
#22 2470693-22.patch5.45 MBdawehner
#19 2470693-15.patch5.44 MBdawehner
#17 2470693-15.patch5.44 MBpwolanin
#15 2470693-15.patch4.95 MBdawehner
#3 upgrade_to_symfony_2_7_0-2470693-3-composer-only-do-not-test.patch22.61 KBhussainweb
#3 upgrade_to_symfony_2_7_0-2470693-3.patch906.33 KBhussainweb
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hussainweb’s picture

Title: Upgrade to Symfony 2.6.6 » Upgrade to Symfony 2.7.0
Issue summary: View changes
Related issues: -#2454393: Upgrade to Symfony 2.6.5 +#2366043: Upgrade to Symfony 2.6.0-beta1

I should have pulled before creating. Anyway, I think we can always reuse for Symfony 2.7.

hussainweb’s picture

Priority: Critical » Major
hussainweb’s picture

Adding a composer only and a full patch.

hussainweb’s picture

TJacksonVA’s picture

We should also note that the Symfony folks have changed their strategy slightly. Rather than going from 2.7 to 3.0, they will also have an additional 2.8 release which will come out at the same time as Symfony 3.0 in November, Transition from Symfony 2.7 to 3.0... Symfony 2.8 on its way. The Symfony 2.8 release will also be a LTS release like Symfony 2.7, so we may want to consider as we approach November whether we want to upgrade to Symfony 2.8. However, we do not need to make that decision at this time.

hussainweb’s picture

Is there a problem with the test? I see that it has been reset and retested by administrator several times.

pfrenssen’s picture

Yes the test bot doesn't seem to like it. It has been queued half a dozen times now.

Status: Needs review » Needs work

The last submitted patch, 3: upgrade_to_symfony_2_7_0-2470693-3.patch, failed testing.

Berdir’s picture

Not sure what the error before was, but the patch currently doesn't apply anymore.

hussainweb’s picture

I will try to get to it by today evening.

TJacksonVA’s picture

They Symfony folks have just released BETA2 of Symfony 2.7. Symfony 2.7.0-BETA2 released. The stable production release of Symfony 2.7 is still currently scheduled for end of May/beginning of June.

I think this issue needs to be upgraded to Critical. Drupal 8 is currently on Symfony 2.6.x, which will end-of-life for bug fixes in July 2015, and end-of-life for security fixes in January 2016. It is essential (critical?) that we move on to Symfony 2.7 as soon as possible. In [policy, no patch] Follow symfony 2.7 or 3.0., this is the question, we agreed that when Symfony 2.7 beta came out we would upgrade to it, and then track additional Symfony 2.7 releases as we do additional releases of Drupal 8 betas (and then stables).

Given that Symfony 2.6 is very close to its end-of-life, I do not believe that we can do a Drupal 8 RC with Symfony 2.6, so from my perspective it is critical that we update to Symfony 2.7.

jibran’s picture

I tried to update to Symfony 2.7.0-BETA2 here https://qa.drupal.org/pifr/test/1045813

dawehner’s picture

@TJacksonVA
Yeah no question at all, we should follow the symfony releases, even to 2.8 but its not a reason to put it to critical.
Its just yet antother release.

I tried to update to Symfony 2.7.0-BETA2 here https://qa.drupal.org/pifr/test/1045813

Interesting result! Opened up a follow up in #2488860: Bring phpunit bridge into drupal and use it for unit tests and simpletest to handle Deprecation

dawehner’s picture

dawehner’s picture

Status: Needs work » Needs review
FileSize
4.95 MB

Let's merge stuff together and see whether it works

Status: Needs review » Needs work

The last submitted patch, 15: 2470693-15.patch, failed testing.

pwolanin’s picture

Status: Needs work » Needs review
FileSize
5.44 MB

posting big patch for dawehner

Status: Needs review » Needs work

The last submitted patch, 17: 2470693-15.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
5.44 MB

Status: Needs review » Needs work

The last submitted patch, 19: 2470693-15.patch, failed testing.

jibran’s picture

Too much exceptions 8-)

dawehner’s picture

Status: Needs work » Needs review
FileSize
5.45 MB
5.45 MB
7.74 KB

Status: Needs review » Needs work

The last submitted patch, 22: 2470693-22.patch, failed testing.

The last submitted patch, 22: 2470693-22.patch, failed testing.

jibran’s picture

Great work much less exceptions.

Berdir’s picture

Status: Needs work » Needs review
FileSize
853 bytes
2.25 MB

Fixed the fatal error in the unit tests (yay, symfony is using PSR-4 now, 3 directory levels less in vendor/symfony), this should hopefully allow us to see the test fails.

Still some unit test fails that I wasn't able to figure out quickly. Mostly deprecation messages, with _method and some validator stuff.

Hint: use git config --global diff.renameLimit 1500 so that rename detection works with that many files, cuts the patch size in half.

Status: Needs review » Needs work

The last submitted patch, 26: 2470693-26.patch, failed testing.

Berdir’s picture

Status: Needs work » Needs review
FileSize
2.25 MB
4.03 KB

Going through some of those exceptions...

WTF @getMessagePluralization() being deprecated in favor of getPlural() but that isn't in the interface. real funny ;) Same for getMessageParameters(). I think the deprecation messages might actually be on the wrong method?

Status: Needs review » Needs work

The last submitted patch, 28: 2470693-28.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
2.71 MB
21.06 KB

Some more fixes ...

Status: Needs review » Needs work

The last submitted patch, 30: 2470693-30.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
2.71 MB

Quick reroll.

Status: Needs review » Needs work

The last submitted patch, 32: 2470693-32.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
2.71 MB

git diff 8.0.x --binary

Status: Needs review » Needs work

The last submitted patch, 34: 2470693-34.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
2.72 MB
1.06 KB

Fixed the remaining once.

Status: Needs review » Needs work

The last submitted patch, 36: 2470693-36.patch, failed testing.

jibran’s picture

jibran’s picture

Here is reviewable patch.

jibran’s picture

Status: Needs work » Needs review
dawehner’s picture

Here is a change record: https://www.drupal.org/node/2489948

tim.plunkett’s picture

  1. +++ b/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php
    @@ -43,10 +43,6 @@ public function __construct(ParameterBagInterface $parameterBag = NULL) {
    -    if ($this->hasDefinition($id) && ($definition = $this->getDefinition($id)) && $definition->isSynchronized()) {
    -      $this->synchronize($id);
    -    }
    

    So we just don't need this anymore? Fine by me

  2. +++ b/core/lib/Drupal/Core/RouteProcessor/RouteProcessorCurrent.php
    @@ -39,8 +39,15 @@ public function __construct(RouteMatchInterface $route_match) {
    +        $requirements = $current_route->getRequirements();
    +        unset($requirements['_format']);
    +        unset($requirements['_method']);
    +        unset($requirements['_schema']);
    +        $route->setRequirements($requirements);
    

    This seems scary, and needs a comment. (and maybe tests?!)

  3. +++ b/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php
    @@ -81,7 +81,7 @@ protected function setUp() {
    -    $translator = new DefaultTranslator();
    +    $translator = new IdentityTranslator();
    

    ?!

dawehner’s picture

FileSize
2.71 MB
746 bytes
2.71 MB
746 bytes

This seems scary, and needs a comment. (and maybe tests?!)

Well, we the method and schema are used later, so its really about the _format being accidentally unset.

?!

As explained, DefaultTranslator got marked as deprecated. Note: The .gitignore file which existed before is now tracked as part symfony/validator itself.

dawehner’s picture

FileSize
2.71 MB
847 bytes

Forgot the comment.

Berdir’s picture

+++ b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
@@ -351,7 +351,7 @@ public function massageFormValues(array $values, array $form, FormStateInterface
     /** @var \Symfony\Component\Validator\ConstraintViolationInterface $violation */
     foreach ($violations as $offset => $violation) {
-      $parameters = $violation->getMessageParameters();
+      $parameters = $violation->getParameters();
       if (isset($parameters['@uri'])) {
         $parameters['@uri'] = static::getUriAsDisplayableString($parameters['@uri']);
         $violations->set($offset, new ConstraintViolation(
@@ -361,7 +361,7 @@ public function flagErrors(FieldItemListInterface $items, ConstraintViolationLis

@@ -361,7 +361,7 @@ public function flagErrors(FieldItemListInterface $items, ConstraintViolationLis
           $violation->getRoot(),
           $violation->getPropertyPath(),
           $violation->getInvalidValue(),
-          $violation->getMessagePluralization(),
+          $violation->getPlural(),
           $violation->getCode()

Do you have more information what this is about?

As I said above, the new methods aren't defined on the interface and are documented as alias of the old ones.

Either the documentation needs to be updated to reflect the deprecation or it needs to be changed (e.g., the other methods should have the trigger_error()). So I'm pretty sure we need a PR and should create that before they release the stable release, but I'm not sure what the PR should actually do...

dawehner’s picture

Do you have more information what this is about?

As I said above, the new methods aren't defined on the interface and are documented as alias of the old ones.

Either the documentation needs to be updated to reflect the deprecation or it needs to be changed (e.g., the other methods should have the trigger_error()). So I'm pretty sure we need a PR and should create that before they release the stable release, but I'm not sure what the PR should actually do...

OH right I totally forgot to tell you about that. When I talked with fago about the weirdness of the validator he told me that webmozart plans to get rid of the interface and rely entirely on a value object here in 3.0 so we are kinda prepared here and its fine what we are doing. The fact that its not part of the interface is caused by having a BC promise on the interface.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

I went through this today with @dawehner, and I think he adequately addressed @Berdir's question in #45. I consider it RTBC.

jibran’s picture

Berdir’s picture

#46: Ok, fine, but the documentation there is really bad :(

+++ b/core/composer.lock
@@ -2191,21 +2191,20 @@
             "name": "symfony/class-loader",
-            "version": "v2.6.6",
-            "target-dir": "Symfony/Component/ClassLoader",
+            "version": "v2.7.0-BETA2",

This is still 2.7 BETA, I don't think we want to commit this already?

The PHP7 fix is also AFAIK not yet part of this.

It's great that it's green now, so I'd suggest to postpone/wait for the final release and then do the update?

We might also need a change record for some of the changes caused by this and the beta evaluation doesn't seem correct, there is definitely distruption?

znerol’s picture

As this patch updates our forked YamlFileLoader, it would be great if it also would include the changes missed during the 2.5 and 2.6 updates #2375339: Update DependencyInjection YamlFileLoader for Symfony 2.6.

catch’s picture

Status: Reviewed & tested by the community » Needs work

Yes we should only update to the stable, great that this is green though.

Also CNW for #50.

catch’s picture

Priority: Major » Critical

Since this required updates to get working, bumping to critical - core shouldn't be relying on deprecated Symfony code for 8.0.0.

dawehner’s picture

According to the symfony release schedule we will have an update to the stable version in may, so let's just wait a bit more and get it done.

pfrenssen’s picture

Status: Needs work » Postponed

Postponed awaiting the Symfony 2.7 LTS release. See http://symfony.com/roadmap.

jibran’s picture

If this is postponed till the stable release then can we re-open #2486883: Upgrade to Symfony 2.6.7?

dawehner’s picture

If this is postponed till the stable release then can we re-open #2486883: Upgrade to Symfony 2.6.7?

What would be the gain? The LTS release will be there in a short time.

neclimdul’s picture

Issue tags: +Security

Since 2.6.8 contain security fixes.

neclimdul’s picture

jibran’s picture

dawehner’s picture

Status: Postponed » Needs review
FileSize
3.08 MB
63.44 KB
TJacksonVA’s picture

and officially released: Symfony 2.7.0 released

Status: Needs review » Needs work

The last submitted patch, 60: 2470693-60.patch, failed testing.

Berdir’s picture

Status: Needs work » Needs review
FileSize
3.04 MB
1.67 KB

Fixed the test fail.

This also means that TypedDataTest is now passing on PHP7, this should be the last real test fail.

Status: Needs review » Needs work

The last submitted patch, 63: 2470693-63.patch, failed testing.

Berdir’s picture

Renamed our class and generated patch with --binary.

Berdir’s picture

Status: Needs work » Needs review

The last submitted patch, 59: upgrade_to_symfony_2_7_0-2470693-59.patch, failed testing.

jibran’s picture

Status: Needs review » Reviewed & tested by the community

As per #47.

znerol’s picture

What about #50/#51?

dawehner’s picture

FileSize
3.09 MB
5.67 KB

Sure, let's do that. Patch btw. nearly applied.

dawehner’s picture

Issue summary: View changes

Updated the recommended commit message ...

xjm’s picture

(Saving issue credit to correspond to the proposed commit message.)

xjm’s picture

Issue tags: +Triaged D8 critical

@webchick, @alexpott, @catch, @effulgentsia and I all agreed this was critical for its impacts on both #2400407: [meta] Ensure vendor (PHP) libraries are on latest stable release (part of #2485119: [meta] The Drupal 8.0.0-rc1 Release Checklist) and #2454439: [META] Support PHP 7, and D8 core needs to use a version of Symfony that will also be supported throughout the D8 cycle.

Leaving this one for someone else to commit though. :) And yay!

xjm’s picture

Issue summary: View changes
znerol’s picture

Assigned: Unassigned » znerol
Status: Reviewed & tested by the community » Needs work

diff -u core/vendor/symfony/dependency-injection/Loader/YamlFileLoader.php core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php

Still is shows hunks which look like upstream changes which need to be replicated into our YamlFileLoader. Will examine them and post another patch soon.

znerol’s picture

Assigned: znerol » Unassigned
FileSize
2.22 KB
  1. Symfony 82db9c2e: [DependencyInjection] deprecated synchronized services
  2. Second hunk fixes line indention
  3. Symfony 0eb34f32: [DependencyInjection] Added support for keys "method" and "arguments" in "calls" statement for yaml format

Only posting interdiff here. I have no idea on how to properly produce the whole diff (mine results in 13M but #70 is only 3M).

dawehner’s picture

Status: Needs work » Needs review
FileSize
3.09 MB

Good catch, I guess those changes happened in the meantime since december?

@znerol
The trick is to use git diff --binary

Berdir’s picture

The trick is to use git diff --binary *and* have git renames configured *and* git config --global diff.renameLimit 1500, see #26 :)

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Interdiff seems fine to me there were no other changes, lets get this in.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

I think we should completely rip out support for synchronised services in our container. This patch removes some of the test coverage since the methods throw PHP warnings (because deprecated).

Getting this is quickly because if it causes pain in any other criticals it is good to know early - same goes for contrib. Committed 73b5652 and pushed to 8.0.x. Thanks!

  • alexpott committed 73b5652 on 8.0.x
    Issue #2470693 by dawehner, Berdir, jibran, hussainweb, pwolanin, znerol...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

jibran’s picture

Fabianx’s picture

Published the change record (yes, a bit late, but still important ...)

willzyx’s picture