-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
Extend marketplace to accept kar and some improvements #2490
Conversation
Signed-off-by: Jan N. Klug <[email protected]>
Signed-off-by: Jan N. Klug <[email protected]>
Signed-off-by: Jan N. Klug <[email protected]>
Yes it would be nice to support KAR files as well. One of the reasons the ESH Marketplace probably didn't support it, could be that this is Karaf only. That's why many Karaf specific functionality is moved into separate bundles to keep it optional when using OHC. That way you can still easily use Felix instead of Karaf as OSGi runtime. Though I don't know how common it is to use OHC with another runtime these days. 🙂 I think this might not make the Marketplace usable/debuggable when used with Eclipse for instance. |
Well, it would be easy to move the class to another bundle if you prefer that. Which one would fit best? |
@wborn Do you know what happens if two feature repositories provide features with the same name (e.g. a .kar has an updated version of a binding that is available in distribution)? |
I think it is ok to leave the class (and thus the Karaf dependency) in here. If someone builds their own distro without Karaf, he is likely to also not include the marketplace, which is hosted on our Discourse.
My guess is that both are available and upon an install (without specifying a specific version) the one with the highest version is picked. |
Ok, we can always make an administrative rule that the marketplace-version should include a qualifier to avoid duplicate version-numbers. This work is purely "theoretical" as I can't post to the marketplace category on the forum and therefore not test it. When will that be opened? |
That distro is what you have when debugging openHAB in Eclipse. 😉 With this dependency you cannot run or debug the Marketplace with Eclipse because there are no Karaf bundles in that runtime. You'd probably still be able to run and debug it when the Karaf code is moved into a separate bundle like |
@wborn Ok, I didn't think about that - this is then indeed be a strong reason to move the class to a dedicated bundle. |
Signed-off-by: Jan N. Klug <[email protected]>
Good good 👍 I think you are now working on to also add the new bundle to the BOM and Karaf feature file? 🙂 |
Sure 😀 I added it to the marketplace feature. I guess that's ok, since the feature requires karaf anyway, so there should be no issue. |
Signed-off-by: Jan N. Klug <[email protected]>
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.
Thanks for working on this! I have a few comments/improvements below:
.../org/openhab/core/addon/marketplace/karaf/internal/community/CommunityKarafAddonHandler.java
Outdated
Show resolved
Hide resolved
.../org/openhab/core/addon/marketplace/internal/community/CommunityMarketplaceAddonService.java
Outdated
Show resolved
Hide resolved
.../org/openhab/core/addon/marketplace/karaf/internal/community/CommunityKarafAddonHandler.java
Outdated
Show resolved
Hide resolved
.../org/openhab/core/addon/marketplace/karaf/internal/community/CommunityKarafAddonHandler.java
Outdated
Show resolved
Hide resolved
.../org/openhab/core/addon/marketplace/internal/community/CommunityMarketplaceAddonService.java
Outdated
Show resolved
Hide resolved
.../org/openhab/core/addon/marketplace/internal/community/CommunityMarketplaceAddonService.java
Outdated
Show resolved
Hide resolved
.../org/openhab/core/addon/marketplace/karaf/internal/community/CommunityKarafAddonHandler.java
Outdated
Show resolved
Hide resolved
.../org/openhab/core/addon/marketplace/internal/community/CommunityMarketplaceAddonService.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jan N. Klug <[email protected]>
Would you like to the the other bundle-addon-handler also refactored to the new |
Yes that would be nice too. 👍 |
Signed-off-by: Jan N. Klug <[email protected]>
...marketplace/src/main/java/org/openhab/core/addon/marketplace/MarketplaceBundleInstaller.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jan N. Klug <[email protected]>
I have implemented what I think should work. The last commit only contains those changes. I'm not sure what to do with the maturity tag, it's included in the tags-property but there is no field in |
.../org/openhab/core/addon/marketplace/internal/community/CommunityMarketplaceAddonService.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jan N. Klug <[email protected]>
We can add another field, like all the other fields that were added in #2405, so the info can be shown in the UI and used for filtering. |
Signed-off-by: Jan N. Klug <[email protected]>
I added the field for maturity and license (also that is currently always null). Looking at |
Signed-off-by: Jan N. Klug <[email protected]>
re-triggering build |
I just tested this PR and got my Marketplace entry succesfully recognized as a KAR: However it did not install properly. The only logging that showed was:
So I added a try/catch to get more detailed logging and this is what showed up:
Most likely KAR files need to be installed using the KarService and I tested using this org.openhab.binding.systeminfo-3.2.0-SNAPSHOT.kar. I also checked the file in /userdata/marketplace and the content was as expected. This KAR file works if I copy it into my Some other things I noticed: There seems to be a limit of 3 tags on posts: Also, after installing a KAR file, most likely the UI will then list the add-ons of the KAR as any other "openHAB Distribution" add-on? That can be confusing. |
Signed-off-by: Jan N. Klug <[email protected]>
@wborn Correct, I didn't think about that (I used the WDYT about the builder for |
Signed-off-by: Jan N. Klug <[email protected]>
* Automatically start bundles * Fix isInstalled not detecting that KAR is installed * Fix exceptions during uninstallation Signed-off-by: Wouter Born <[email protected]>
.../org/openhab/core/addon/marketplace/karaf/internal/community/CommunityKarafAddonHandler.java
Outdated
Show resolved
Hide resolved
Using the KarService it works a lot better. 👍 Though there were a few more issues that I've fixed in my commit. I think it is better to automatically start the bundles or they won't work. That way you can also use feature names that do not start with openhab-binding etc. so they will not show up like "openHAB Distribution" add-ons, which prevents:
I also had to manually remove lastnpe and slf4j from my KAR file and features definition. Otherwise it would not properly install, so we probably need to exclude those from KAR generation. Now it seems to work well and I think it is mergable. 😄
Yes it is not convenient and ugly to have so many constructor arguments. I'm also fine with doing that in a follow up PR. |
Signed-off-by: Wouter Born <[email protected]>
Signed-off-by: Wouter Born <[email protected]>
Signed-off-by: Wouter Born <[email protected]>
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.
I think the code is ready to be merged now. 👍 Can you also review this @openhab/core-maintainers? It also contains a few of my commits.
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.
The PR contains .classpath
and .project
files. Otherwise LGTM.
Yes the openhab-core repo still contains these because IIRC there are still some issues to import projects (without compilation errors) in Eclipse using only POMs. |
It would be great if we can enable the category in Discourse then. |
the brown color & reset button means it was changed from the default (5). I don't know why that is, so I reverted to 5.
What do you mean, I didn't understand? |
I created a special group of "marketplace curators" and put you in it, so you should have access. Currently only maintainers and forum moderators can create posts in the marketplace category until we unveil it to the public. |
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.
lgtm, many thanks! Great to have KAR files supported now.
Also-by: Wouter Born <[email protected]> Signed-off-by: Jan N. Klug <[email protected]> GitOrigin-RevId: 4569eea
Following up a discussion with @ghys this adds another
MarketplaceAddonHandler
for installing .kar files.