Skip to content
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

Upgrade to Symfony 3.0 compatibility #45

Conversation

drewclauson
Copy link
Contributor

For #44

I have tested this in my environment and haven't gotten any deprecation warnings or error messages with Symfony 2.8 or 3.0. I don't have a ton of background with upgrading bundles, but it seems to me like it'll work just by updating the dependencies.

@drewclauson drewclauson mentioned this pull request Dec 10, 2015
@mmarchois
Copy link

When does this PR merged ?

@geekdevs
Copy link
Collaborator

@philippe-levan: ping, any news here?

@philippe-levan
Copy link
Member

Hi,
I don't have much time to work on this PR.
Can anyone check why travis is going to red and fix the problem ?
Best regards,
Philippe

@drewclauson
Copy link
Contributor Author

I'm not very familiar with travis at this point, but this is the only error message showing up.

[InvalidArgumentException]
Connection does not contain a 'path' or 'dbname' parameter and cannot be dropped.                                                                       

@drewclauson
Copy link
Contributor Author

Never mind, I wasn't reading far enough.

@geekdevs
Copy link
Collaborator

@philippe-levan Why do you git ignore composer.lock? I get exactly the same errors in master even though travis shows it as passing. I believe this is because some dependencies have updated since then.

@philippe-levan
Copy link
Member

@geekdevs we have to ignore the composer.lock in bundles. It is the project that fixes some versions, not the included bundles.
If we have to fix some constraints on versions in a bundle we have to set these constraints in the composer.json.

Best regards,
Philippe

@drewclauson
Copy link
Contributor Author

The issue looks like it's how symfony 3.0 requires a string of the class name instead of the actual class when creating a form from the factory. I'll look into fixing it in the next few days unless someone else beats me to it.

@geekdevs
Copy link
Collaborator

I solved Connection does not contain a 'path' or 'dbname' with this PR #49
@philippe-levan Please merge it.

@geekdevs
Copy link
Collaborator

@drewclauson it was merged, please rebase from master

@philippe-levan
Copy link
Member

@drewclauson thanks for working on this issue.

Keep in mind it would be better to stay backward compatible with ~2.1 versions if it is possible.

Otherwise I will do a new major version for this upgrade.

Thanks,
Philippe

@philippe-levan
Copy link
Member

@geekdevs with your PR #49 merged, tests are still failing due to an evolution of symfony/form 3.x. I is the issue that mentions @drewclauson in its comment 172937869.

Regards, Philippe

@geekdevs
Copy link
Collaborator

@philippe-levan yes, I know that. But still need to rebase as otherwise it would fail on that dbpath thing.

@drewclauson
Copy link
Contributor Author

@philippe-levan From my research and initial testing, we are going to have to release a new major version. I don't see a path for this to work once we hit 3.0. How would you like me to handle this? I'm working through the fixes today.

@drewclauson drewclauson force-pushed the drewclauson-symfony-3.0 branch 2 times, most recently from 8c3c38b to 8b30255 Compare January 20, 2016 17:31
@drewclauson drewclauson changed the title Update dependencies to be able to use Symfony 3.0 Upgrade to Symfony 3.0 compatibility Jan 20, 2016
@drewclauson
Copy link
Contributor Author

All tests are now passing and I removed PHP 5.3 and 5.4 from Travis since Symfony 3.0 is >=5.5.9. Also added in testing on PHP 7.0 for good measure. This is definitely going to need to be a new major version - @philippe-levan anything specific I need to do in order to help make that happen?

@drewclauson
Copy link
Contributor Author

Update: I think it'll need to be a new major version, as I don't see an easy way to make the form changes backwards compatible.

Also, I did note that tests failed for me when I tried to run master against Symfony 2.1 or 2.2. I think the biggest issue was the namespace of TypeTestCase, but I didn't look into it too closely.

@geekdevs
Copy link
Collaborator

@drewclauson According to this doc http://symfony.com/doc/current/contributing/community/releases.html#schedule I think we need to support at least 2.3, 2.7, 2.8 since these are LTS versions.

Looking through your update it looks like the only major change is usage of class names for form elements instead of objects in form builder. I don't see it as being hard to support.

Also, even though v.3 is PHP>=5.5.9, we can still allow lower versions of php for v.2 branch (need to setup travis accordingly).

@drewclauson
Copy link
Contributor Author

@geekdevs thanks for the info, I agree with supporting all current LTS. I'm not well experienced with travis configuration. What would that configuration look like? Does travis also have the ability to test against multiple symfony versions rather than just the latest one the composer.json specifies?

@geekdevs
Copy link
Collaborator

@drewclauson correct. I made some experiments with it, see example config here https://github.com/geekdevs/TbbcMoneyBundle/blob/master/.travis.yml

And that's how travis tests it https://travis-ci.org/geekdevs/TbbcMoneyBundle

@drewclauson drewclauson force-pushed the drewclauson-symfony-3.0 branch from 464cb8f to 43c99c7 Compare January 21, 2016 17:29
@drewclauson
Copy link
Contributor Author

Ok, all tests passing and this PR supports Symfony >=2.3. The readme says that it supports Symfony >= 2.1, but I'm not sure how I would make it support back to 2.1, due to the change in namespace on TypeTestCase. @philippe-levan, I believe this is ready to be merged, let me know if you have any thoughts on it.

@geekdevs Thanks for your help and input. This has been a great learning experience for me!

@geekdevs
Copy link
Collaborator

@drewclauson Thanks for updates. But looks like tests are failing now. Quick check shows that this is not related to your change, but it looks quite weird and should be fixed anyway.

PairManagerTest::testRatioProvider() checks yahoo finance to get exchange rates. It checks it twice in the same test and values can differ between calls. I think this should be updated to be mocks.
It essentially tests that PairManager uses provider set with setRatioProvider, so provider should not necessary be YahooFinanceRatioProvider (since it's tested separately), but any other class implementing that interface.

@geekdevs
Copy link
Collaborator

I've created a PR for this
#50

@drewclauson
Copy link
Contributor Author

@geekdevs I was just about to look into this and saw your message. Thanks!

@philippe-levan Please merge #50 and then I'll rebase and that should make this PR ready to go.

@philippe-levan
Copy link
Member

@drewclauson #50 merged. Thanks both (@geekdev and you) for your job on that bundle !

@geekdevs
Copy link
Collaborator

geekdevs commented Feb 5, 2016

any news @drewclauson ?

@drewclauson
Copy link
Contributor Author

@geekdevs I've been under a lot of pressure at work to get a few deadlines done. I may not be able to revisit this until mid-Feb. :-(

@mrcmorales
Copy link

@geekdevs @drewclauson How is it ? Thanks :)

@drewclauson
Copy link
Contributor Author

@mrcmorales Unfortunately, I'm not able to return to it, but I just reviewed the last few notes and will follow up on a questions I have.

@geekdevs How do we get phpunit-bridge into travis? Is that in a config?

@drewclauson
Copy link
Contributor Author

@geekdevs Never mind, I've only drank half my ☕ today so far... Just pushed a composer.json with phpunit-bridge included

@drewclauson
Copy link
Contributor Author

@geekdevs I think I've got phpunit-bridge running in Travis, but I don't see any deprecations. The only problem is on job #170.9 and that looks probably like a Yahoo API issue. Let me know when you can take a look. Thanks!

@geekdevs
Copy link
Collaborator

@drewclauson I've created a pull request, see #56

There are couple things why it did not show any errors (it will now):

  • we always tested the same (latest) version of symfony
  • somehow running vendor/bin/phpunit behaves differently than just ./phpunit (only latter command actually outputs deprecation messages, versions of both are same). I've digged a little into the libraries and this looks like a bug, will need to check further though.

@geekdevs
Copy link
Collaborator

geekdevs commented Mar 3, 2016

@philippe-levan Please merge my PR so that we could continue testing symfony3 integration

@geekdevs
Copy link
Collaborator

geekdevs commented Mar 3, 2016

@drewclauson so my PR was merged, please rebase from master, set export SYMFONY_DEPRECATIONS_HELPER=strict at .travis.yml and run your tests through travis again. You will see tons of deprecation messages.

@philippe-levan philippe-levan mentioned this pull request Mar 4, 2016
@drewclauson
Copy link
Contributor Author

Unfortunately, my work was re-prioritized a few weeks ago and I'm no longer working on our backend transition, which requires this library (and no one else at our company is either until we do some legacy system upgrades) but am switching gears to our legacy system... I'll leave my fork available for someone to pick up, but I won't be able to revisit this for at least 4-5 months. 😦

@geekdevs
Copy link
Collaborator

@drewclauson normally people work on open source projects in their spare time ;). I can continue with it, no problem. Just thought you'd want to finish up yourself.
I am just not sure how it works with forks though. I assume I can fork your fork and then create PR into this repo directly?

@drewclauson
Copy link
Contributor Author

@geekdevs I know, I unfortunately, don't have the spare time most are able to commit to open source projects and have only been able to get more involved lately due to needing this for my job. 😐 I wish I did have the time to finish this up.

I think you can just fork my fork and create a PR back into this repo, but I haven't tried that before. Thank you and I do apologize that I can't work on it further at this point.

@geekdevs
Copy link
Collaborator

@drewclauson that's ok. You'd done a lot there already, that's much appreciated.

@philippe-levan
Copy link
Member

@drewclauson i do agree with @geekdevs. Thanks for your contributions ! (and I'm desperately not available neither...)

@wavyx
Copy link

wavyx commented Mar 21, 2016

Is there anything left blocking this PR? or is it only a travis config issue?

@geekdevs
Copy link
Collaborator

@wavyx it has a lot of backwards compatibility issues. Travis config fix would basically just show them in tests. Nothing crazy complicated, but needs time to solve.

@gregholland
Copy link

Any downside to removing backwards compatibility and tagging this as a new major version?

@philippe-levan
Copy link
Member

@gregholland A new major version is needed to go to SF3. But it still needs to be green in travis.
I will create a brand new 2.x branch for SF2 version and master will soon be the SF3 version.

But right now it is not compatible with SF3 and I have absolutely no time for working on this adaptation. (and I don't have any project on SF3 right now). This PR is the most advanced adaptation right now (thanks @geekdevs and @drewclauson for that).

@verschoof
Copy link

verschoof commented May 15, 2016

@philippe-levan if you create a branch for SF3 we can go start testing and debugging and make PR's to solve any problem. Can you do that?

btw, A big downside of this repository is that it contains a library and bundle in one.
It would be much easier if you split this up, 1: A library 2: A bundle that implements your library and do some symfony magic =)
Benefits:

  • Users that doesn't want to use a bundle will only use the library
  • Is easier to maintain
  • Upgrading bundle for symfony is easier ;)

@geekdevs
Copy link
Collaborator

As far as I can tell there is no big problem for making this bundle backwards compatible, so I would vote for keeping it in minor release.
The problem is more that it does not actually support v3 correctly yet.
@drewclauson progressed there quite far, but unfortunately has no time to finish. I have intention to finish his work myself, but cannot promise on timeframes as I am quite busy as well right now.

So if any of you guys have time to finish it faster you can fork @drewclauson's branch and work from there

@verschoof
Copy link

@geekdevs why not just merge it, and solve issue by issue. thats way more easier then fix it all right?
This would be also more easier for the community to work on.

@geekdevs
Copy link
Collaborator

I am good with that approach. If @philippe-levan creates feature branch for that we could merge @drewclauson's fork and start fixing from there.

@philippe-levan
Copy link
Member

Hi @geekdevs, @verschoof,

I merged this PR on a public branch : "symfony3-migration"

https://github.com/TheBigBrainsCompany/TbbcMoneyBundle/tree/symfony3-migration

This feature branch will be merged on master.

Master is now the branch for the symfony3 version of the bundle and I created a 2.x branch for the symfony 2.x version.

Do you need something else from me ?

Best regards,
Philippe

PS : I modified .travis-ci and composer.json on the symfony3-migration branch to be compatible only with sf3 and not sf2 anymore. Only the branch 2.x remains compatible with sf2.

@mrcmorales
Copy link

hi @philippe-levan ,

Is there some version of this bundle with money v3 compatible with sf 2.7 or 2.8 ?

Thanks

@philippe-levan
Copy link
Member

@mrcmorales : This comment should be another issue. It is not the same problem.

I understand your are talking of the v3 of the moneyphp/money (https://github.com/moneyphp/money/tree/v3.0.0-beta) right ?

No, we won't support moneyphp/money:~3 in that bundle. There is too much BC Breaks in the library (and one reason to remain on the v2). We can't remain stable enough in our interfaces. I believe it would be a better idea to create another bundle for that moneyphp/money:~3 version.

Best regards,
Philippe

@philippe-levan
Copy link
Member

philippe-levan commented Jun 2, 2016

closed following the comment : #45 (comment)

@geekdevs
Copy link
Collaborator

I've added a PR that should fix Symfony 3 integration
#65

That should support both 2.8 and 3.0

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.

8 participants