Skip to content

Update dependency for Symfony 4. #4

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 11 commits into from
Nov 29, 2017
Merged

Update dependency for Symfony 4. #4

merged 11 commits into from
Nov 29, 2017

Conversation

dbrumann
Copy link
Contributor

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Related tickets ---
Documentation ---
License MIT

What's in this PR?

Update dependency for symfony/stopwatch to allow 4.x as well to make this usable in Symfony 4-applications.

@joelwurtz
Copy link
Member

Can you add also Symfony 4 to the build matrix of Travis ? (so we are sure there is no problem with it)

@dbrumann
Copy link
Contributor Author

It looks like updating the build matrix doesn't work yet

@joelwurtz
Copy link
Member

Symfony 4.0 is only in beta so that's normal, it will be released in november, so let's wait for the release to be available before pushing this.

.travis.yml Outdated
@@ -30,6 +31,8 @@ matrix:
include:
- php: 5.4
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci" SYMFONY_VERSION=2.7.*
- php: 7.1
env: SYMFONY_VERSION=4.0.*
Copy link
Member

Choose a reason for hiding this comment

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

should be env: SYMFONY_VERSION=4.0.*@dev since there is no stable release yet

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but this will still break, because phpspec will complain: https://github.com/phpspec/phpspec/blob/master/composer.json#L29-L33

Copy link
Contributor

Choose a reason for hiding this comment

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

i think we can use COMPOSER_FLAGS="--minimum-stability=dev" or something like that.

@xabbuh
Copy link
Member

xabbuh commented Oct 22, 2017

@joelwurtz IMO allowing Symfony 4 now would be better as it allows to catch incompatibilities before the final release. People not relying on dev dependencies would still not get 4.0 components, but would have to opt-in explicitly if they prefer to use it now.

@Nyholm Nyholm mentioned this pull request Nov 19, 2017
@dbrumann
Copy link
Contributor Author

@joelwurtz I think adding Symfony 4 to the build matrix does not make sense as we will have to exclude everything except PHP 7.1 anyways as they are not supported by Symfony 4.

@dbu
Copy link
Contributor

dbu commented Nov 24, 2017

we don't want every symfony version with every php version, that explodes the build matrix. i think this looks right for the configuration.

do you see where the installation conflict comes from?

@dbrumann
Copy link
Contributor Author

@dbu It boils down to phpspec. When requiring symfony/symfony it conflicts with symfony/stopwatch which can not be updated due to symfony/yaml which can not be updated due to phpspec which (as far as I can tell) can not be updated due to the coverage plugin and the version restriction in the composer.json (current version is 4.2.4).

I am currently trying to make this work on my local machine without breaking the old requirements, but I'm having a hard time. Suggestions are very welcome :)

@Nyholm
Copy link
Member

Nyholm commented Nov 25, 2017

Have a look at php-http/client-common#90. I want to make all travis files like that.

.travis.yml Outdated
- php: 5.6
- php: 7.0
- php: 7.1
env: SYMFONY_VERSION=3.0.*
Copy link
Member

Choose a reason for hiding this comment

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

Why 3.0.*? Didn't you mean 3.4.* instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I kept this requirements from the selection above. Something like env: DEPENDENCIES="symfony/lts:^3" probably makes more sense?

Copy link
Member

Choose a reason for hiding this comment

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

I would also update the other places where symfony/symfony is used by using symfony/lts instead. That way you won't hide bugs related to not installed components outside the CI environment.

Copy link
Contributor

Choose a reason for hiding this comment

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

i guess best see symfony/symfony-docs#8701 - or lets just make things work here and then sync to that when the recommendation for a perfect .travis.yml has been merged.

.travis.yml Outdated
env: SYMFONY_VERSION=3.0.*
- php: 7.1
env: DEPENDENCIES="dev" SYMFONY_VERSION=4.0.*
- php: hhvm
exclude:
- php: 5.4
env: SYMFONY_VERSION=3.0.*
Copy link
Member

Choose a reason for hiding this comment

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

This exclude role does not match any entry from the matrix above.

Copy link
Contributor

@dbu dbu left a comment

Choose a reason for hiding this comment

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

thanks. (and sorry for my comment on the partial diff, seems this has meanwhile been improved anyways)

looking at travis, the symfony 4.0 build does not work (but is allowed to fail) because phpspec can not be installed. only master of phpspec (4.2.x) does allow symfony 4: https://github.com/phpspec/phpspec/blob/master/composer.json . but unfortunately its limited to symfony 3.2 or newer, so we can't just upgrade to that.

maybe we could upgrade to phpspec 3 which does support sf 2.7 to 3.* and add something to the sf 4 build to go to that phpspec version. of course i don't know if there are any bc breaks between 3 and 4 that would affect us.

@fbourigault
Copy link

If we remove henrikbjorn/phpspec-code-coverage and use phpspec/phpspec ^2.5 || ^3.0 || ^4.0 specs are greens. So having henrikbjorn/phpspec-code-coverage compatible with phpspec/phpspec ^4.0 will probably solve the issue. The other possibility is to drop code coverage ^^.

@dbu
Copy link
Contributor

dbu commented Nov 29, 2017

i suggest we comment out the coverage thing for the moment and create an issue to reenable coverage when the henrikbjorn tool is ready for phpspec 4.

@xabbuh
Copy link
Member

xabbuh commented Nov 29, 2017

You could collect the code coverage report on a job that doesn't use Symfony 4 only.

@dbu
Copy link
Contributor

dbu commented Nov 29, 2017

or that. but would need an extra composer require for the henrikbjorn library. if its in composer.json, composer can't install in the symfony 4 test.

@Nyholm
Copy link
Member

Nyholm commented Nov 29, 2017

This is save to merge. Looking at the diff in the symfony component, you will see that there is no BC breaking change.
I suggest merging this. I will fix our broken tests for dev now. (different PR)

@Nyholm
Copy link
Member

Nyholm commented Nov 29, 2017

@fbourigault told me not to "fix" the tests. He told me to fix the PR according to the suggestions.

@Nyholm
Copy link
Member

Nyholm commented Nov 29, 2017

Thank you Denis!

@Nyholm Nyholm merged commit 334edd5 into php-http:master Nov 29, 2017
@dbrumann dbrumann deleted the update/symfony4 branch November 30, 2017 02:16
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.

6 participants