-
-
Notifications
You must be signed in to change notification settings - Fork 422
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
[openhab.core] Split: Storage+Auth+Persistence #708
Conversation
@davidgraeff, I'm curious (and anxious!) to see what you've done. But it seems to me that this should go into a feature branch. It will require maintainance in the future to keep it in sync, but keeping it out of master will allow us to keep moving forward with OH2.x. |
@openhab-5iver This is not breaking any API, it is just moving files between bundles. The core bundle will even list the splitted bundles (at least while we are in OH 2) as dependencies so nothing changes for bindings or solution consumers. The huge OH 3 package renaming is still to come at some point. And the bigger picture for me is: I want to contribute my re-worked extension, extension service, extension repository handling (for npm and github repositories as extension sources). |
I wasn't sure if this was to go into OH3 or not. Just mitigating risk... we could end up ready to finally get a release out (hopefully we're getting close!), but be stuck behind such large commits. Keeping it separate allows us to release around your commits. |
Hm but this is 250 lines of code change ^^. I carefully backported to make this tiny on purpose. |
Just my opinion... and I tend to be overly cautious when it comes to release management. We'll see what the maintainers think! |
Signed-off-by: David Graeff <david.graeff@web.de>
c3ee7bf
to
0b28574
Compare
I am not fully convinced yet. The split you are providing does not split API and implementation. I am also not sure if solutions can drop all that subsystems. Are you sure that all of them are optional? |
I do think that API+Impl bundles is the way to go. The mentioned storage service bundle but also authentication are API bundles. They cannot be dropped from a solution, true, but they might be versioned independently in the future. The .net bundle exists because of easy discovery and to entangle dependencies within .core. If you have a better suggestion on how to tackle the overloaded .core bundle I'm interested to hear your opinion. I really just want to contribute my extension stuff. |
In OSGi you use versioning per package.
I see your point, but if we split the core bundles, we should not do it, just to easily contribute something and then do it another way after that again. I really agree that we should split API + impl and also split the different subsystems. |
Something learned. So OSGi bundles use package-info for version information I guess.
I have my fork for a month now, I'm just afraid that I will have that for another 6 months or even worse that package renaming starts and I cannot contribute my stuff back in the end. I really love to use my Paper UI replacement, but core is missing so much fundamental basics. The REST API cannot even tell what OH version is in use. I tried to open a few discussion PRs here on core, but I usually get no response. Can @openhab/core-maintainers please write down a vision and roadmap. There are willing contributors. And if that means that we need to spend an afternoon in a discord channel to discuss and argue, then let it be. |
That's another topic we already discussed in ESH.
Hm, IIRC Kai added responses to that PRs.
So, you tell me that you change this stuff without a vision and expect it does not get declined?
I am sorry. I try to read every PR and comment all of them. It is just a matter of time. |
By reading through my comment I realized that it might sound offending towards you. That wasn't the purpose, I'm sorry. Warning, long post. VisionI do have a bigger picture of what I like openHAB to be. I have created this PaperUI design study (https://davidgraeff.github.io/paperui-ng/) where I have embedded all services and API endpoints that I like openHAB to have. My vision is encoded in code, if you want so. (Not really for read just for reference). I'm adding 14 REST API endpoints and modify 7 endpoints for the design study to work. I really like to contribute my developed services and core changes, but I don't know how and that frustrates me. I have split the core bundle in my fork to not touch so many bundles when re-working subsystems. RESTI know that it is hard to define the version that is send via REST, but the user is actually interested in the current distribution version. And in the boot bundle that exact version is read in and shown in the dashboard. The current REST design in this project follows no real vision at least none that I understand. I actually know the why behind those decisions. They were a lot driven by PaperUI. But In my design study, that is like a lot more user friendly, I'm showing more info from more endpoints and actually end up calling about 3 to 5 endpoints for a Thing edit page etc. There is also a bigger long term plan that I have in mind: Getting rid of REST and substitute with GraphQL. When designing REST endpoints you never know what the client will make out of it, with GraphQL the client will request exactly what it needs and we don't need to guess in the code and send "enhanced" DTOs when it is not required. And even if REST should stay until EOL, in my opinion there shouldn't be separate rest packages and we just expose all registries automatically. (Not talking about endpoints dedicated for control here, just for setup&maintenance). |
How do I progress in this matter? I guess I first abandon this PR. Should I maybe first tell about my ideas? I mean I tried (#665, #594) but I really get no responses from maintainers in this repo if I only create Issues. |
I personally do not use sitemaps (#594) or the extension service (#665) at the moment. If no maintainer uses this code anymore it does not mean no other one is using it. And we should not break all the consumers that just want to use the framework and don't follow the issues. You mentioned Qt in this thread -- perhaps because you use it. It does not mean we need to live with a "bad design" forever but changes should be done considered and if it is merged, we should just fixes bugs. Please don't get me wrong, I love progress and improvements, but don't expect too much as long as we don't get paid for all the time invest. Perhaps it would make sense to introduce meetings or something similar where people discuss the technical stuff. While working on the migration and the other openHAB repositories I also made my experiences and drew conclusions. But hey, this is very off-topic -- at least it is not an issue for the code base (this issue tracker is used for) but for the management. |
We have no other means on the other hand. There is no mailing list or board (like the old Eclipse Dev Board) or IRC.
Just a few words about Qt and their way of doing it, but I'm sure everyone knows about the versioning issue we have here at the moment. Qt does break API periodically, roughly every 5 years. But each time (major update) the changes got less intense because they emerged into a very fine well defined product and API. All big projects that I know of adapted because of the benefits of the new APIs.
I know what you mean. This model also makes this project very lethargic when it comes to pull requests and no fun to contribute. And that is what I'm afraid of. No experimentation, no trying out, basically a full stop. I've spend like 300 hours or probably more for developing bindings and my own core bundles to have a great experience for my HA system at home, so I have invested a great amount of time. But I feel like if openhab-core continues it's current model it will die a slow death (which I do not want for mentioned reasons). Because of the usage of OSGi and Java we are already in a back position compared to other competing frameworks like HomeAssistant (I'm talking about the ease of contributing). The language itself just recently (Java 11/12) is catching up with Kotlin and Scala. With our Java 8 min requirement, there is still a lot of boilerplate code to write. The tooling must be so much easier to attract more developers (maven/bnd a big plus, gradle/bnd even better of course), the API must be easier to make the review process simpler (annotation based binding development. Yes I have created core bundles for that) and so on. To wrap this up, I understand that continuity is important because some solutions are relying on it. But if people of those solutions (and I'm not talking about you Markus) are not contributing, why should openHAB-core care about them? Still, I respect the idea, and that's the reason for this PR. Not breaking the APIs, but sorting bundles into actual subsystems. Those then can be independently changed expect if a veto is coming in. |
This is what the team discussions are for... https://github.com/orgs/openhab/teams/core-maintainers.
I think some technical discussions would be very useful. If it worked out well, and there were enough people, it could turn into a recurring call/video chat where developers could ask questions, show new designs, work through larger issues, etc. Depending on the platform used, this could be opened up to the rest of the community, so that they can hear/see the direction that the developers are taking the project in. |
We used certain guidelines for this code in the past:
Wrt this PR, I don't really see the need to have a more fine-grained split into functional pieces. Imho a solution is likely to require those parts and even if not, the additional not-used features would not be a huge burden. Note that it is not really in the interest of the project to foster a plethora of new solutions being built. We rather acknowledge the fact that there are other solutions than the openHAB distro itself and make sure to keep this support. But imho the architectural design should not primarily be driven by this requirement. |
I thought about this as well until I have read that Eclipse Concierge (https://www.eclipse.org/concierge/) for example extracts jar files, so the amount of bundles is not important to that IoT tailored OSGi container. I guess that Felix or Equinox can do or do the same?
I get you there, but the current bundle system here in core is inconsistent, isn't it? You can't build a OH solution without things, but things still have their own bundle. Discovery has it's own bundle. All those API's could have been in .core then. I'm just for going either way, but be consistent. So if splitting is not wanted, merging is? |
I am all for it. The main reason why this hasn't been done for many places is that we have the rule that bundle ids should be chosen to reflect the java packages names. With this rule, it is easy to split existing bundles, but hard to merge them as you would then end up with inconsistent naming... |
Has there been some analysis between the runtime overhead and the number of bundles? |
I cannot provide you with any detailed statistics, but those were clear results from our experiences at DT.
All those things might seem neglectable, but when you end up with several hundred bundles in an installation, they add up to quite something ("Kleinvieh macht auch Mist")... |
This pull request has been mentioned on openHAB Community. There might be relevant details there: |
Isn't it much more complex?
I don't state that we need a bundle per package, I just want to state that IMHO both directions can lead to a bad behaviour. |
All I can say as a contributor is that the current situation is confusing. There are two ways a project can be organised:
It's like with maven. The convention is enforced on a java project and as long as you follow the convention you don't need to alter the buildsystem or document anything. But OH does not follow the OSGi/bnd API-Impl bundle convention AND it has no documentation or specific pattern. Personal opinionI personally thing there is no "technical" aspect to consider, it is purely about taste. As my research in this are indicates, all OSGi frameworks are using sophisticated bundle caches. And that xml parsing is slow (aka finding ESH-INF files) is known. XML is not necessary for OH and I would like an alternative (not a replacement ; ) for OH 3 bindings. I can understand both parties.
I would like every of the 4 OH-core maintainers to participate in this discussion actually. This bundle situation can be solved BEFORE OH 3 and should be. There will be enough confusion later on with package renaming. |
Not much for me to do here, closing. |
Just waking up this issue to see if its suitable for OH3 or not.. is it going to be considered or not? |
The core bundles purpose is not well defined and contains almost everything in a mix.
I could understand if that is API only ("defining the openHAB smarthome APIs"), but that's not the case.
Also newer concepts like automation and things are not part of this core bundle which speaks against the one API core bundle theory.
I therefore think that the core bundle should shrink down to bare utility methods (OSGI/Registries/Threadpool) and all other API and impl should be distributed.
(This is also true for the core.rest bundle which I'm splitting here simultaneously)
Advantages:
This is the first of a series of PRs and handles
Further planned PRs:
I'm backporting this from my own fork and not all pom dependencies are yet correct.
Please consider this WIP until travis is satisfied.
Signed-off-by: David Graeff david.graeff@web.de