-
Notifications
You must be signed in to change notification settings - Fork 129
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
Separate drivers to smaller packages #256
Comments
Have always been the idea. |
Alright...should I start by creating a repo in my namespace, transfering it and opening a PR for removal in the main one? |
Not sure what the right approach is, if we want to do like Symfony and have sub tree splits. |
Well, we are basically talking about one or two classes per repo, so I am not sure it worth to have subtree splits. It requires special versioning strategy, and so on. We discussed this approach for HTTPlug and decided not doing it for HTTP clients and adapters, since they might evolve separately. Also subtree splitting makes dependency management a bit harder, so I am against it for a project like this. |
I can create the repos and then ill give you write rights to them. is that ok ? |
Sounds great. Some more questions to clear:
|
Just realized this is a duplicate of #92 |
My vote goes to: Repo: Namespace: Driver classname: Package name: If it's okay for you, I would create a boilerplate-driver repo/package first as a package boilerplate which then can be used later. |
Lurker here would go for Bernard\Driver\PheanstalkDriver every time - less chance I'll have to waste time aliasing it. |
Although it's simple, it has a few drawbacks:
Also, if you import |
Ping :) |
Funny, read this yesterday. Today on twitter: https://twitter.com/TobiasNyholm/status/810882518572564480 |
SubtreeSplit is a nice approach when you don't want to use the master repository or you want all from them. In case of an adapter-pattern like project I am not sure if it adds too much, but @Nyholm might have a few interesting thoughts here since he maintains two projects like that. |
For the users: For the maintainers: Tests: Namespace:
I do not understand this argument. I think you mean that if we do like Symfony does an keep the same version on each driver, then yes. I agree. But if one configure the subtree split not to push tags then I do not think this is an issue. I do not like to keep all the drivers in the same package because of the reasons above. I would go with a subtree split over completely separate repos since it is now way easier to get started with thanks to subtreesplit.com |
Yes I think the main argument is that we have a central package here, which should hold some common code, and adapters/drivers should require it. From this point of view subtree split does not seem to be a good idea to me. Maybe having a separate drivers package would be better? And apply subtree split there? Would that be better? |
Ah okey. The master repo https://github.com/bernardphp/bernard should not be a package you can download. It should only be for development. If you want to keep the package A) B) |
Yeah, option B what I meant. That would actually be a good idea then, but somehow destroys the idea of subtree split, doesn't it? |
That is what I am trying with https://github.com/php-translation/platform-adapter Adapters do not share anything and there is no shared code apart from the adapters in the master repository. Having this setup does not bring many benefits. Just that it is nice if Im going to change many adapters at once and there are lot less repositories to supervise. I may include php-translation/common in this master repo since it is a shared dependency for all adapters. So.. choosing option B is great because you get small packages, but a subtree split is barley needed. |
I would like to pick this issue up and move drivers to a separate repo using subtree split. I will do some research and write down the plan here. |
Maybe we can use https://www.subtreesplit.com/ from @Nyholm for the subtree split management. But indeed good idea to pick up this issue! |
That's the plan, yes. |
+1 |
@sagikazarmark what are the exact steps to do this? Do we just create the separate repo's by hand and move the code and then initialize subtreesplit or will the code moving part be done by the subtreesplit? This way we can already do some preparations for the move! |
You need to create separate repos and the tell subtreesplit what folder should be pushed to which repo. |
So the plan is to create a separate drivers repo (already done) and move current drivers there. Class name will be Repo names: It worked quite well with php-http We also need to improve the test suite a bit. I would like to create a unified integration test suite (if possible) and use the same set of tests for each driver, even if it is only a small set of tests. Each driver can have it's own set of tests as well. Also, tests needs to be somewhat separated based on the featureset (eg. not all queue backends support peeking, etc). I would like to create a POC driver first (probably Pheanstalk), work on the test suite, set up subtree split, etc. If it works well, we can migrate the rest of the drivers. |
Decided to go with an in-memory driver instead. |
@Nyholm what's the current best practice: run the tests when pushing to the main repo or when subtree is done? (The first one sounds better to me) |
Yes. First one. I also run Travis on individual driver to get the code coverage stats. Have a look at php geocoder for a good Travis.yml |
Thanks for the info @sagikazarmark! I will let you do the setup on the first driver to get all things right and then I will jump in and also do some drivers! |
@sagikazarmark did you make any progress on the first driver? Or is there something I can do to start on this? |
Yeah, I started to get my head around this, have some tests standardized locally. Will send some branches for review over the weekend. |
Ok great! |
I would be happy to help out with this as well. |
Sorry to ping you again @sagikazarmark! Did you make any progress on this? Or can and somehow start some work on this (a single driver to test the whole implementation)? |
I created #337 with an initial in memory driver implementation. I gave having a core test suite much thought and I realized that without ugly hacks we can't really have an interface for setting driver state, so as for tests we should just have a sane template to follow. I'm also thinking about writing spec tests instead of/additional to unit tests. |
I will also try to send a PR to the drivers package to have some ideas how migration would work. |
Thanks will check it out! |
Drivers to split:
FlatFile does not rely on any external dependencies, also it's a sane default for playing around.
Initial comment:
Although I love the idea of having one single package for everything, I would consider having smaller packages for the drivers with actual dependencies. For example: pheanstalk-driver with a dependency on pda/pheanstalk instead of suggestion.
It would add more maintenance, but would make the main package a bit cleaner. WDYT?
I am willing to work on this one if you agree.
The text was updated successfully, but these errors were encountered: