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

[addonservices] Add version filtering #2811

Merged
merged 11 commits into from
Mar 20, 2022

Conversation

J-N-K
Copy link
Member

@J-N-K J-N-K commented Feb 28, 2022

Fixes #2806

This enhances the add-on services with a compatible version filter. This allows displaying only compatible versions after breaking changes in openHAB core.

Discussion partly in the linked issue. Add-on services can (optionally) provide a Maven-like version range ([3.1.0;3.3.0.M1] or [3.0.0;3.1.0.M4)).

Tasks:

  • add parsing of versions
  • adjust JSON add-on service
  • adjust Community Marketplace add-on service
  • add tests

@J-N-K J-N-K requested a review from a team as a code owner February 28, 2022 17:25
@J-N-K
Copy link
Member Author

J-N-K commented Feb 28, 2022

We need some additional decisions:

  • How do we provide the ranges for the community marketplace? With the current implementation we don't have access to the content of the post while generating the add-ons list. My suggestion (which is also useful when browsing the forum) would be to add the version range at the end of the topic, so instead of UniFi binding (beta) it could look like UniFi binding (beta) [3.3.0.M2;3.4).

  • What should happen with (potentially) incompatible add-ons. Should they be treated like "unpublished" (community marketplace)/"unstable" (Json) add-ons or should there be an additional switch for them? Globally or per add-on service?

@wborn
Copy link
Member

wborn commented Mar 5, 2022

it could look like UniFi binding (beta) [3.3.0.M2;3.4).

I think that is currently the only way to add this data. It would be nice if there was a way to add metadata to Discourse topics that can also be retrieved using the Discourse REST API. But probably @ghys already looked into this before going with this approach. 😉

What should happen with (potentially) incompatible add-ons.

I wouldn't mind having an extra "Show Incompatible Add-ons" filter option in the UI for this similar to the "Show Unpublished Entries" filter option.

I'd also replace "Bundles" with "Add-ons" in the "Show Non-Stable Bundles" config option of the Json 3rd Party Add-on Service, because I think this filter is also applied to widgets/templates/block libs and KAR files?

@wborn wborn added enhancement An enhancement or new feature of the Core work in progress A PR that is not yet ready to be merged labels Mar 5, 2022
@@ -11,6 +11,11 @@
<description>Defines whether openHAB should access the remote repository for add-on installation.</description>
<default>true</default>
</parameter>
<parameter name="includeIncompatible" type="boolean">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we move this file to the org.openhab.core bundle? It affects all add-on services (remote is used by the other add-on services, too) and is IMO placed wrong in org.openhab.core.karaf.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see it is already used in the AbstractRemoteAddonService so that would make sense.

It might still be nice if there was also a config option to easily disable the marketplace completely. 😉

Copy link
Member Author

@J-N-K J-N-K Mar 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added that option to the community marketplace. The JSON 3rd party add-on service can be easily disabled by deleting the URL.

IMO for the best user experience all of the add-on service related parameters (system:jsonaddonservice, system:marketplace and system:addons) should be shown in one place in the UI.

Copy link
Member

@wborn wborn Mar 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added that option to the community marketplace.

Yes I now see the option! 🕵️

should be shown in one place in the UI

For openHAB itself that probably makes sense. But if other distros do not deploy some add-on service bundles, you'll probably end up with unused options in the UI. 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not use the same PID, the UI should just group these PIDs in one page.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it can do that it would indeed be nice. IIRC the MQTT broker config that was removed in
#2842 also had some kind of mechanism to group multiple configs. Though I don't know if it used different PIDs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea, UI is a mystery to me. Maybe @ghys can comment on that.

Anyway, I think this is out of scope here and none of the changes makes it harder to implement that later.

@J-N-K J-N-K changed the title [WIP][addonservices] Add version filtering [addonservices] Add version filtering Mar 7, 2022
@wborn wborn removed the work in progress A PR that is not yet ready to be merged label Mar 7, 2022
J-N-K added 10 commits March 20, 2022 11:23
Signed-off-by: Jan N. Klug <github@klug.nrw>
Signed-off-by: Jan N. Klug <github@klug.nrw>
Signed-off-by: Jan N. Klug <github@klug.nrw>
Signed-off-by: Jan N. Klug <github@klug.nrw>
Signed-off-by: Jan N. Klug <github@klug.nrw>
Signed-off-by: Jan N. Klug <github@klug.nrw>
Signed-off-by: Jan N. Klug <github@klug.nrw>
Signed-off-by: Jan N. Klug <github@klug.nrw>
Signed-off-by: Jan N. Klug <github@klug.nrw>
Signed-off-by: Jan N. Klug <github@klug.nrw>
@J-N-K J-N-K force-pushed the feature-addonserviceversioning branch from 9055dff to d9deb7e Compare March 20, 2022 10:58
Copy link
Member

@wborn wborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. 👍 I only have a few minor comments left!

Copy link
Member

@wborn wborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. 👍 I only have a few minor comments left!

Signed-off-by: Jan N. Klug <github@klug.nrw>
@J-N-K
Copy link
Member Author

J-N-K commented Mar 20, 2022

I think I addressed all your comments.

Copy link
Member

@wborn wborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Let's give it a test. 🚀

@wborn wborn merged commit 4577562 into openhab:main Mar 20, 2022
@wborn wborn added this to the 3.3 milestone Mar 20, 2022
@J-N-K J-N-K deleted the feature-addonserviceversioning branch March 20, 2022 18:03
@wborn
Copy link
Member

wborn commented Mar 20, 2022

For some reason if I disable "Enable Community Marketplace" it still keeps showing marketplace add-ons.

@J-N-K
Copy link
Member Author

J-N-K commented Mar 20, 2022

I‘ll check that tomorrow. If they are installed, that is expected, as it would be impossible to uninstall them otherwise.

wborn added a commit to wborn/openhab-core that referenced this pull request Mar 23, 2022
…n options

This makes it possible to use Crowdin for translating the new configuration options introduced in openhab#2811.

Signed-off-by: Wouter Born <github@maindrain.net>
cweitkamp pushed a commit that referenced this pull request Mar 23, 2022
…n options (#2868)

This makes it possible to use Crowdin for translating the new configuration options introduced in #2811.

Signed-off-by: Wouter Born <github@maindrain.net>
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/marketplace-rules-for-3-4-0-vs-4-0-0-new-bindings/142358/3

wborn added a commit to wborn/openhab-core that referenced this pull request Dec 30, 2022
With this fix it will use the correct string for pattern matching add-on version ranges introduced in openhab#2811.

Signed-off-by: Wouter Born <github@maindrain.net>
J-N-K pushed a commit that referenced this pull request Dec 30, 2022
* Fix Marketplace add-on range pattern matching

With this fix it will use the correct string for pattern matching add-on version ranges introduced in #2811.

Signed-off-by: Wouter Born <github@maindrain.net>
wborn added a commit that referenced this pull request Dec 30, 2022
* Fix Marketplace add-on range pattern matching

With this fix it will use the correct string for pattern matching add-on version ranges introduced in #2811.

Signed-off-by: Wouter Born <github@maindrain.net>
splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 12, 2023
Signed-off-by: Jan N. Klug <github@klug.nrw>
GitOrigin-RevId: 4577562
splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 12, 2023
* Fix Marketplace add-on range pattern matching

With this fix it will use the correct string for pattern matching add-on version ranges introduced in openhab#2811.

Signed-off-by: Wouter Born <github@maindrain.net>
GitOrigin-RevId: 5e23b0e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add compatibility information to external add-on services
3 participants