Skip to content

[WIP] Symfony3 #331

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

Closed
wants to merge 1 commit into from
Closed

[WIP] Symfony3 #331

wants to merge 1 commit into from

Conversation

hacfi
Copy link
Contributor

@hacfi hacfi commented Jan 30, 2016

No description provided.

@hacfi
Copy link
Contributor Author

hacfi commented Jan 30, 2016

@dbu Those are the changes I made to make it work with my current (not online yet) Symfony 3.0 project and no issues for the last 2 weeks. I’m gonna look into the deprecation calls and check if there are more changes required in this repository.

@@ -89,6 +91,8 @@ public function testMatchRequest()
*/
public function testMatchNoRequest()
{
$this->markTestSkipped('Test for deprecated match() method');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Mark them as legacy and they won't be marked as error. You can do it by adding @group legacy to the method PHPdoc.

@hacfi
Copy link
Contributor Author

hacfi commented Jan 30, 2016

Thanks for the feedback @wouterj. Updated the PR accordingly.

@hacfi hacfi mentioned this pull request Jan 30, 2016
@hacfi
Copy link
Contributor Author

hacfi commented Jan 30, 2016

I tried adding Symfony 3.0.* to the test matrix (https://travis-ci.org/symfony-cmf/RoutingBundle/jobs/105928993) but sonata-project/doctrine-phpcr-admin-bundle 1.1.0 requires symfony/framework-bundle ~2.3: https://github.com/sonata-project/SonataDoctrinePhpcrAdminBundle/blob/master/composer.json#L22 to that fails at the moment.

The COMPOSER_FLAGS="--prefer-lowest" build (https://travis-ci.org/symfony-cmf/RoutingBundle/jobs/105928991) fails with Argument 5 passed to Sonata\DoctrinePHPCRAdminBundle\Tree\PhpcrOdmTree::__construct() must be an instance of Symfony\Component\Templating\Helper\CoreAssetsHelper, instance of Symfony\Bundle\FrameworkBundle\Templating\Helper\AssetsHelper given which was fixed in sonata-project/SonataDoctrinePhpcrAdminBundle#337 but that would bump the requirements to version 1.2.3. Should I add this?

The DEPS=dev build keeps timing out at composer update --prefer-dist

@wouterj
Copy link
Member

wouterj commented Jan 30, 2016

Thanks for putting so much time in this PR! It's great to see Symfony 3 coming closer each push.

I tried adding Symfony 3.0.* to the test matrix (https://travis-ci.org/symfony-cmf/RoutingBundle/jobs/105928993) but sonata-project/doctrine-phpcr-admin-bundle 1.1.0 requires symfony/framework-bundle ~2.3 [...] to that fails at the moment.

What you can do is using branch aliases to fool Composer that we're installing 2.8 and then excluding the web-test group (using --exclude-group) when running PHPunit with Symfony 3. It's a little hacky, but this allows us to see if everything works with Symfony 3 until SonataDoctrinePHPCR properly supports Symfony 3.

[...] which was fixed in sonata-project/SonataDoctrinePhpcrAdminBundle#337 but that would bump the requirements to version 1.2.3. Should I add this?

I see no problem bumping that requirement.

The DEPS=dev build keeps timing out at composer update --prefer-dist

Composer probably has a hard to resolving the versions. Let's narrow down the search by forcing Symfony 2.8-dev (by also setting SYMFONY_VERSION="2.8.*" for this Travis job).

@wouterj
Copy link
Member

wouterj commented Jan 30, 2016

Btw, I think if we're going to release 2.0 of this bundle, I think we should just remove all BC layers and go with Symfony 2.8. We didn't discuss this much yet, but I suggest to not waste time creating BC layers to support 2.7.

@hacfi
Copy link
Contributor Author

hacfi commented Jan 31, 2016

@wouterj Thanks for the advice! Unfortunately I’m not getting the branch alias working correctly:

With "symfony/framework-bundle": "v3.0.1 as v2.8.2" it still says

  Problem 1
    - sonata-project/doctrine-phpcr-admin-bundle 1.2.4 requires symfony/framework-bundle ~2.3 -> satisfiable by symfony/framework-bundle[v2.8.2].
    - sonata-project/doctrine-phpcr-admin-bundle 1.2.3 requires symfony/framework-bundle ~2.3 -> satisfiable by symfony/framework-bundle[v2.8.2].
    - sonata-project/doctrine-phpcr-admin-bundle 1.2.4 requires symfony/framework-bundle ~2.3 -> satisfiable by symfony/framework-bundle[v2.8.2].
    - Conclusion: don't install symfony/framework-bundle v2.8.2
    - Installation request for sonata-project/doctrine-phpcr-admin-bundle ^1.1,>=1.2.3 -> satisfiable by sonata-project/doctrine-phpcr-admin-bundle[1.2.3, 1.2.4].

Any idea how to get this running?

@hacfi
Copy link
Contributor Author

hacfi commented Jan 31, 2016

Prefer lowest was failing because of sonata-project/SonataAdminBundle#2186 so I added sonata-project/admin-bundle >=2.2.12

"sonata-project/doctrine-phpcr-admin-bundle": "^1.1",
"sonata-project/admin-bundle": ">=2.2.12",
"sonata-project/core-bundle": ">=2.2.3",
"sonata-project/block-bundle": ">=2.2.8",
Copy link
Member

Choose a reason for hiding this comment

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

please use ~2.2.8 instead of >=. Sonata is very bad in semver (also applies to the 2 requirements on line 26 and 27)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, I noticed! Should I change sonata-project/admin-bundle or sonata-project/core-bundle as well? I didn’t want to be to strict as I don’t know the recent development of the packages.

@dbu
Copy link
Member

dbu commented Feb 1, 2016

+1 for going with 2.7 or 2.8 and removing all BC hacks. also we can remove our own deprecated things but not necessarily in this PR.

@hacfi
Copy link
Contributor Author

hacfi commented Feb 1, 2016

So anything else to do here to get this merged? I know the added version constraints are not great but unfortunately they are necessary.

@@ -23,7 +23,10 @@
"matthiasnoback/symfony-dependency-injection-test": "~0.6",
"matthiasnoback/symfony-config-test": "^1.3.1",
"phpunit/php-code-coverage": "@stable",
"sonata-project/doctrine-phpcr-admin-bundle": "^1.1",
"sonata-project/admin-bundle": ">=2.2.12",
"sonata-project/core-bundle": ">=2.2.3",
Copy link
Member

Choose a reason for hiding this comment

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

please use ^ and not >=, this would allow sonata 3 or 4 or any. (also the line above)

Copy link
Member

Choose a reason for hiding this comment

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

the caret operator means this patch version or any minor version higher than this.

@dbu
Copy link
Member

dbu commented Feb 1, 2016

coming good. we need to create the 1.4 branch before merging this, so that we still can release the 1.4 that supports symfony 2.3

this alone is no reason to jump the branch-alias to 2.0 so we can see when we need to do that.

@hacfi
Copy link
Contributor Author

hacfi commented Feb 1, 2016

Updated. I just didn’t want to be too restrictive.

@hacfi
Copy link
Contributor Author

hacfi commented Feb 16, 2016

@dbu Anything else to do here? I’d rather remove the Sf27 Compat stuff in a separate PR to not mix things up.

@@ -21,11 +21,9 @@ env:
matrix:
include:
- php: 5.6
env: DEPS=dev
env: DEPS=dev SYMFONY_VERSION=2.8.*
Copy link
Member

Choose a reason for hiding this comment

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

if you change this value to 3.0.x-dev as 2.8.99, we should be able to test against Symfony 3 (I used the same successuflly line in another project)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will try this again..thx!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wouterj
Copy link
Member

wouterj commented Feb 16, 2016

@hacfi I think this PR is ready. However, we're focusing on the 1.4 stable release first. After that's done (expect end February at the very last), we start bumping to 2.0 and merging the 2.0 PRs.

@hacfi
Copy link
Contributor Author

hacfi commented Feb 16, 2016

That sounds great!

Maybe it would be helpful for others to pull my branch into this repo so they can also use it as dev-symfony3 - just a suggestion :).

@dbu
Copy link
Member

dbu commented Feb 17, 2016

yep, exactly, i want to wait until we have 1.4 released and start the 1.4 branch, then switch master to 2.0 and merge this.

good idea with the branch. that would also allow to do that follow up PR to remove BC hacks - i agree its better to do that separately. i just created a symfony3 branch from master. can you close this PR and open a new one against the symfony3 branch? then we get that merged asap and can continue further steps in separate PRs.

…Sonata dependencies, use parentDocument in Admin classes, update route_basepaths in tests
@hacfi hacfi mentioned this pull request Feb 17, 2016
@hacfi
Copy link
Contributor Author

hacfi commented Feb 17, 2016

Done: #332

@hacfi hacfi closed this Feb 17, 2016
@lsmith77 lsmith77 removed the wip/poc label Feb 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants