Marketplace versioning with embedded resource

I’m struggling a bit to figure out how to handle the “maturity” field. As of now, I’ve just mirrored the current system for the “versions”, where it can be one of “alpha”, “beta”, “mature” and “stable”. But, I’m not sure how to use this.

An add-on with multiple versions can have different versions with different “maturity”. However, I doubt most will specify it as it must be specified manually, as opposed to picking a tag for the subject (as it is for “the whole add-on”). Also, even if people specify it, how should this all be presented. What does “maturity” on the “add-on level” actually mean when there are multiple versions?

Also, wouldn’t it be better to just use e.g 0.0.1.alpha as a version instead of “splitting” the version number and the maturity to two different fields?

Any input is appreciated, as I don’t quite see what is the best approach.

I don’t have strong opinions on this. One thing to keep in mind is that outside of the bundles section of the marketplace, we are dealing with non-developers for the most part who managed to get something cobbled together and want to share it. So anything too developer focused is going to go over their heads.

But in general I think people think of it as follows:

  • version number is a way to keep track of the changes to the “thing” over time
  • maturity is a vague way to indicate the amount of testing done and whether the full feature set is implemented or not

Whether these are technically correct usages of these is beside the point. That’s how they seem to be used and thought about.

Also, with the general rule seems to be to “post and forget” so what ever people initially post and tag stuff with often is what it remains forever.

My whole approach is that everything “extra” is optional, and that the parser should continue to parse existing add-ons as they are today. So, the entries already there should continue to work, and people can make new ones that are just as simple. All this extra stuff, with new information fields, versions etc., is just there to “enrich” the functionality for those that wish to use it.

So, I’m aware that many of these things will probably rarely be used, but still I need to come up with some “rules” for how they should work, if they are used.

Yes, but my point is that you can have a very mature version that has been around for a long time, and then you can have a “radically redesigned one” that is hardly tested at all and needs feedback. Normally, this is indicated with alpha/beta/rc in the version numbers “in the developer world”. “Regular users” might not know what it means, but I think most people have at the very least an idea that a “beta” is something now quite ready.

The “complication” here is that these two concepts have been split. Or, in a way, versions haven’t been a thing for the marketplace until now, so you could argue that “maturity” has been there instead of version, to indicate some of the information that is missing when you don’t have versions. That’s why I’m a bit unsure of how to handle it.

But, my thought right now is that the maturity of an add-on should be the highest specified from any of the versions that is compatible with the core version that sees it. That would make some sense (to me at least), as it would show you “the highest maturity level” your installation can get from a given add-on. Agree?

The maturity tag isn’t shown anywhere in the Add-on store. So I think you can do this however you want. The fact that it’s shown at all in the store is going to be something new that users are not used to seeing so you can probably define it however you want.

Personally, I think the maturity tag is mostly meaningless in a post that has multiple versions and I personally probably wouldn’t use it in that case.

If there is only one version, the maturity tag is useful to convey whether the thing is undergoing active development or whether it’s basically “done” and just receiving bug fixes and the like.

I’m actually searching the code to try to find if it’s used for anything at all, with no luck this far. I’m starting to think that it’s one of those fields that has had a plan, but hasn’t come to anything. Still, the forum is set up to “force you” to pick a maturity level when you create an add-on entry…

You can find these in the UI, though using 2 different fields/tags (with values stable and published). The first one is for the JSON 3rd party addon service, but shown in the Marketplace UI.

Indeed, published is shown and required and it does make a difference. But the alpha/beta/stable/mature flags don’t appear to be used anywhere.

I’m a bit confused - are you saying that the setting for 3rd party effectively also applies to the community marketplace? I guess I’ll have to dig in to the details here..

There is “Show Non-Stable Add-ons” under 3rd party - so it remains to be seen exactly what that does.

From what I can see in the code, the “Show Non-Stable Add-ons” only applies to the 3rd party service. The community marketplace service only checks these two:

    protected boolean remoteEnabled() {
        try {
            Configuration configuration = configurationAdmin.getConfiguration("org.openhab.addons", null);
            Dictionary<String, Object> properties = configuration.getProperties();
            if (properties == null) {
                // if we can't determine a set property, we use true (default is remote enabled)
                return true;
            }
            return ConfigParser.valueAsOrElse(properties.get(CONFIG_REMOTE_ENABLED), Boolean.class, true);
        } catch (IOException e) {
            return true;
        }
    }

    protected boolean includeIncompatible() {
        try {
            Configuration configuration = configurationAdmin.getConfiguration("org.openhab.addons", null);
            Dictionary<String, Object> properties = configuration.getProperties();
            if (properties == null) {
                // if we can't determine a set property, we use false (default is show compatible only)
                return false;
            }
            return ConfigParser.valueAsOrElse(properties.get(CONFIG_INCLUDE_INCOMPATIBLE), Boolean.class, false);
        } catch (IOException e) {
            return false;
        }
    }

edit: In a way, “published” is used in the community markedplace as “stable” is used 3rd party marketplace. It’s a pity with such “inconsistency”, but I don’t think I should try to do anything about that at this point.

All these things “bind” for a long time, since even if you change how things work in the latest version, older versions must continue to work. So, it’s difficult to “fix” bad designs once they have been released.

edit2: In addition to the above checks, which applies to both community and 3rd party, CommunityMarketplaceAddonService has this check:

            this.showUnpublished = ConfigParser.valueAsOrElse(config.get(CONFIG_SHOW_UNPUBLISHED_ENTRIES_KEY), Boolean.class, false);

..whilte JsonAddonService has this check:

            showUnstable = ConfigParser.valueAsOrElse(config.get(CONFIG_SHOW_UNSTABLE), Boolean.class, false);

An idea could be that “maturity” could be added as a 3rd filter in the UI marketplace “browser”. Some configuration could even set the detault for this filter.

Yes, I guess the best way forward would be to keep the old marketplace(s) as they are. AFAIK the only JSON 3rd party marketplace is @J-N-K’s (Smarthome/J), and I would hope he would agree to make his plugins available on the new marketplace as well.

In order to facilitate migration from the Discord based one I think we would need (in addition to the OH parts like bundle/UI) would be:

  • A comprehensive guide, step by step on how to publish on the new marketplace
  • A migration guide for existing Discord based entries
  • Maybe even some tooling like a Maven plugin that produces the necessary metadata file(s) (or API calls if that would be the case) in order to publish a new marketplace entry.

BRG

I didn’t follow the whole discussion. What exactly is missing in the JSON marketplace?

This is my personal wishlist :Marketplace versioning with embedded resource - #31 by seime

Most important: Notifying users about updated addons - including a simple(r) procedure to update.

I’m not sure I follow you here, I don’t think there’s a need for any fundamental change to the marketplace(s). As we discussed further up, sure, it would be nice to have some system that was independent from Discourse for the community marketplace in that it could be made to fit the task better - but making that is a big project in itself. There’s a lot of UI work that would be needed, and it seems to me like the “Discourse solution” can be modified to fill most of the needs. That doesn’t mean that some other form can’t be made in the future, but my focus is on getting something that works without making the project so big that it becomes completely unrealistic.

Most of the “marketplace code” in Core isn’t bound to the exact source, if would be quite easy to integrate it with another marketplace source if one is created in the future. What I’ve been working with now is bound to Discourse, but that is “complicated” exactly because the data must be extracted from what is basically a text document.

If another source is created in the future, I’m still not sure that there would be a need for a migration. They could easily co-exist.

What is it with the Discourse based solution that is so bad that improving it is “pointless” and that a completely new solution is the only viable path? There must be something I’m not seeing here, because I think most of the needs that have been discussed can be solved with the structure I’m trying to figure out. That doesn’t mean that a separate solution wouldn’t be beneficial, but until such a solution exists…

I’m not sure anybody has said that anything is missing. I’m not sure why @seime want to “merge” he two, but I would guess that it is more about making things accessible to users than that there’s anything “wrong” with the JSON marketplace.

I don’t know if this is a good idea at all, but I made some tweaks to MainUI to show what I suggested above (with the filter):

That does clash somewhat with the JSON marketplace setting which filters out non-stable by default though.

My bad again, I didnt follow closely enough to understand that we’re back to patching the Discourse solution. Fingers crossed :mechanical_arm:

I’m not sure that it’s correct to say that “we” are back to Discourse. It’s rather I who am. My reasons for this are quite simple:

  • It doesn’t seem like I can expect much “help” from others, so I’ll have to try to restrict the work to things that I can do as much as possible.
  • I’m not into web everything on the developer side. The reason is that all the inconsistencies (between browsers, versions etc.) and bad designs (type-unsafe, interpreted language, constantly shrinking possibilities “because security”, no guarantee that what you make today will work tomorrow etc.), and of course just watching how a few large companies basically dictates the “evolution” of the ecosystem. All this conspires to make this very unappealing to me, so I’ve decided to not frustrate myself with this many years ago. But, that also means that there’s a lot I don’t know about “web”, in particular which frameworks and existing solutions exist and how to put existing solutions together in an efficient way to achieve a goal. This means that to make something web, I’d probably end up writing it pretty much from scratch, probably using TypeScript and PostgreSQL. This would be quite the undertaking.
  • I don’t know what possibilities are available to the foundation. Whatever the solution, it would have to be online, so it would have to run on some (probably rented) server somewhere. Without knowing much more about this, it’s very difficult to judge what is viable. That said, what I’m working with now will also require something, the caching of the add-on forum topics (actually the first posts of the add-on forum topics), but that’s still a much “lighter” task - and it doesn’t require any web UI design.
  • Much of the “work” being done here is universal, it’s about coming up with a structure for how to manage add-on versions and handle upgrades, and that can be used regardless of information source (Discourse or any other solution). The only thing that is “Discourse-only” is the parsing, which ironically, is where I’ve put most of the work this far. But, that’s the way it has to be, because I first need to gather the information before I can do anything with it.
  • I frankly see the authentication solution for the “Discourse independent marketplace” as particularly challenging. I don’t know if it’s possible to “integrate” this with Discourse, I guess one could use GitHub authentication etc, but this is a field that is full of pitfalls and potential security risks, and I really don’t feel competent to deal with it. Reading the information from the marketplace doesn’t need authentication and can be publicly accessible, but editing it must be properly authenticated - or OH would be an easy target for malicious actors by “injecting” malicious add-ons or add-on upgrades. Solving this seems like a headache to me, and I would need a lot of “help” from others.

As a result of the above, and the fact that I want to try to make something that can realistically be implemented, that is mainly based on what I can do, I have chosen to try to enhance the Discourse solution. I don’t think this creates any barriers for another solution if somebody finds that worth their time, and the only effort “wasted” is the Discourse parsing. I can live with that. So, this isn’t really a “we” decision, it’s a “me” decision :wink:

The foundation pays for the servers that host this forum and the openHAB Cloud instance. I can’t speak for the foundation but I think it is within the realm of possibilities that the foundation could pay to host a separate marketplace service. But it would require a lot of coordination and it’s not something to just assume would be supported.

I’m not arguing for or against any approach here, just providing information.