extiverse / bazaar

The extension marketplace for your Flarum forum.
https://discuss.flarum.org/d/5151
MIT License
59 stars 14 forks source link

Beta versions aren't properly installed #111

Open hifihedgehog opened 6 years ago

hifihedgehog commented 6 years ago

Steps to reproduce

  1. Install Gamification by ReFlar (installs v2.0.3)
  2. Select Update in Gamification's dropdown menu to try to force Bazaar to grab latest release (also installs v2.0.3)

Expected behaviour

It should be grabbing the latest release (a beta) of Gamification (v3.0.0-beta.2). Note that this is what the developer (and I) would expect. https://discuss.flarum.org/d/11253-installing-beta-release-of-gamification-by-reflar-via-bazaar/3

Actual behaviour

Whether fresh installing the extension or attempting an update afterward, it instead grabs the latest stable release (v2.0.3) of Gamification.

Configuration

Operating system: Shared hosting Version of Bazaar: 0.2.4 Version of Flarum: 0.1.0-beta.7 Other extensions:

**Logs**: Insert logs here (if necessary)
clarkwinkelmann commented 6 years ago

There's indeed an issue here. Bazaar does not install the advertised version of the extension, but does its own calculation to find the best version.

I've not gotten to the bottom of it yet, but it looks like under some conditions it's not taking betas into consideration...

You'll have to install the beta version of the extension via the command line until we fix this. Sorry.

hifihedgehog commented 6 years ago

Just to add some added insight, I recently found out that Composer is also affected with Gamification and is not calculating the betas properly in the precedence sort before selecting the version to install. Because of this, I have to manually select the beta version as a parameter in the command line with Composer.

clarkwinkelmann commented 6 years ago

is not calculating the betas properly in the precedence sort before selecting the version to install

Actually, it does. "minimum-stability": "beta" allows beta versions, while "prefer-stable": true forces to choose a stable version over a beta version if you don't explicitly give the version constraint.

see https://getcomposer.org/doc/04-schema.md#prefer-stable

The only Bazaar issue is that while it shows the latest beta in the UI, it installs the latest version according to your prefer-stable value, which by default does not match with what is displayed.

luceos commented 6 years ago

I think I removed the ability to set a specific version to require in Bazaar at some point because we weren't using it. What we should do now is possibly starting to use the version we receive from flagrow.io within the require command. Flagrow.io is far better at identifying compliance between current Flarum versions and extensions because it has an higher understanding of backward breaking changes inside core.

We should most likely use that version is the minimum and it should download the correct package, what do you think @clarkwinkelmann ?

clarkwinkelmann commented 6 years ago

@luceos there are still many things flagrow.io doesn't know about the local install. There could be a PHP platform definition, or other PHP/extensions requirements in the local composer file which would make a simple require with the API version fail.

Maybe we should just do multiple checks locally. Find the latest stable, beta (, alpha?) version available, and let the user choose when installing.

Or we could send the relevant data to flagrow.io (php version, extensions installed, version/extension/platform requirements from composer.json) and let the API process those, and return a list of best options.

In my opinion installing beta versions should be let to the user choice. We can't just start installing beta versions of everything by default...