-
Notifications
You must be signed in to change notification settings - Fork 232
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
First implementation of symfony fixture loader + group support #461 #529
Conversation
Sorry for the close/reopen spam - travis-ci needed another nudge to check this PR.
We don't depend on the fixtures bundle, only on the data-fixtures library, which doesn't have a hard requirement on ORM. Since we don't want to introduce one, copying the necessary files from the fixtures bundle is the way to go for now. I'm afraid I won't be able to implement #509 since it most likely requires changes to the fixtures bundle as well.
If there's going to be a 3.6, it will be in there. 3.6 will happen if I find things dropped in 4.0 that I haven't deprecated in 3.5 yet (I remember there were some). I'll give you an update once I've checked that. I'll do a comprehensive code review shortly, just wanted to give you a quick update since you opened a pull request so quickly! 🎉 |
And a quick update right behind it: there will definitely be a 3.6 release which we'll get going shortly. Once that's done you can change the base on the PR to 3.6 and it will be there 👍 |
I copied the Fixture class + the fixtureGroupinterface so it works without the FixturesBundle now. |
I fixed the issue with the tests by adding a mocked loader, the functionality of the loader is not tested. |
While fixing the command tests i figured out the current loader code is php 7.1 and up with type checking. 2 options:
|
I'm very inclined to postpone to 4.0 - the trouble doesn't seem to be worth it. |
@alcaeus If a user wants to use the autowired way, he can use --services. It's working on both my old application way of doing fixtures and working with the new autowired fixtures in a new branch. Let me know what else is needed? |
@arendjantetteroo I'll take a deeper look at the PR tonight. If we can keep this entirely BC I'm all for it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job getting this done in a backwards compatible way!
As mentioned in the review, I'm not excited about duplicating some of the logic from the fixtures bundle, which is why I wanted to extract the functionality. However, since this most likely involves a larger change in both DoctrineFixturesBundle and data-fixtures itself, we may just roll with this for now.
Please note that this PR will remain sitting idle for a few more days as I first need to prepare a 3.6 branch and prepare the necessary deprecation/upgrade files. Once that's done, we can change the base of this PR to 3.6 and get it on its way! 🎉
b5f0b4c
to
6696313
Compare
@alcaeus thanks for the review, updated and rebased. Thinking about the ODM/ORM stuff, the only clean way would be extracting the loading of fixtures into a seperate symfony bundle that can work with the same Fixture/FixtureGroup interface and then both the FixtureBundle and this bundle/a new ODMFixture bundle depending on this FixtureLoaderBundle. I just don't know if that is worth all the hassle though... |
@alcaeus what's the plan, anything i can do to help? |
No, I just need to finish looking through this and merge it. I'll try to get that done soon, even if it means copy/pasting large parts of the ORM fixtures bundle. We should clean that up afterwards. |
@arendjantetteroo I've fixed a couple of minor review issues. From a code perspective this looks good, but I think we need to add some tests for this. In DoctrineFixturesBundle, there's an IntegrationTest that we could base our tests on. Do you want to give this a shot or would you rather have me do it? I won't have time for it before the weekend though... |
I'll see what i can do, not sure i get to it before the weekend either :) |
@alcaeus I copy/pasted and then changed the IntegrationTest, works for me locally, waiting for the travis checks now. |
cc0d9f4
to
dfb078d
Compare
Fails on pre 7.1 with : Any ideas? |
@alcaeus From what i understand i need to load a config into the Extension to get this document manager definition in the service container. However i don't understand why this works fine in 7.1 and 7.2? |
I'm taking a look what's going on - no idea why it isn't working. We'll see 👍 |
4100ee3
to
dfb078d
Compare
@alcaeus I got a message to force push but i think you already corrected it right? |
Yeah, I fixed it. Currently trying to fix the alias issue you mentioned above. |
This commit can be removed once support for doctrine/data-fixtures 1.2 is dropped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I added:
- a temporary alias until we remove that pesky service alias that was causing failures
- the logic to handle fixtures with dependencies since we're dependent on an old version of
doctrine/data-fixtures
in 3.x.
With that, the logic looks good and can be merged into 3.6; all legacy code will then be dropped for 4.0. Thank you @arendjantetteroo for the heavy lifting on this!
A first implementation, basically copy/paste from the fixturesbundle.
Couple questions:
Thoughts?
Fixes #461