openhab-core icon indicating copy to clipboard operation
openhab-core copied to clipboard

[marketplace] Support for multiple versions in one forum post

Open weymann opened this issue 2 years ago • 4 comments

Reproduce

  1. Take latest snapshot or milestone of OH4.1
  2. Go to Marketplace and install MercedesMe binding
  3. Installation ends with excpetion

Observed in community here Reproduced by myself with OH 4.1 snapshot here After analysis 3.4 version was installed via Marketplace image

Maybe something wrong with the Marketplace page?

weymann avatar Oct 19 '23 14:10 weymann

My understanding on how the marketplace works you can't combine versions in one post like that. The first link under "Resources" is going to be assumed to be the add-on jar, second one is assumed to be the source code, and everything after that is ignored. So it's treating your 3.4 .jar file as the add-on, the 4.0 jar file as the source code and ignoring the source code link entirely (not that anything is really done with it beyond verifying that a link is there).

So you either need one .jar file that can work for all versions of OH (see https://community.openhab.org/t/androidtv-binding-3-2-0-4-1-0/142203 for an example of that) or you need two marketplace postings and use the versioning in the title to indicate which OH the posting is for. MainUI will only show the posting that is compatible with the OH running

For example, my "Time Bases State Machine" rule template has two posts to the marketplace. The one that works with OH 3 uses Time Based State Machine [3.2.0;3.4.9] for the title and the one for OH 4 uses Time Based State Machine [4.0.0.0;4.9.9.9]. You can see many additional examples of this in the bundles category too (e.g. NAD AV Receiver among others).

I don't think this is a bug. The parser built into MainUI just isn't that smart.

rkoshak avatar Oct 19 '23 15:10 rkoshak

Correct. I have adjusted the title and the label. Maybe we can improve the code so that the description of the link is used to determine the version.

J-N-K avatar Oct 19 '23 16:10 J-N-K

I think all that is implemented in MainUI so maybe this issue needs to move there?

rkoshak avatar Oct 19 '23 16:10 rkoshak

No, the parsing is done in core.

J-N-K avatar Oct 19 '23 16:10 J-N-K