Problem/Motivation
Package Manager has a really stoopid bug when validating an incoming package requirement against the minimum-stability configured in composer.json.
Here's a real-world situation that is affecting all Drupal CMS sites in the wild, even as I write this:
- Your root composer.json contains
minimum-stability: stable
. - You have Project Browser required with an
@alpha
stability flag, because that was the most stable release available when you created the site. - Project Browser releases a beta, and you'd like to update to it via the UI.
Package Manager will block this update because, although you'd like to move from alpha to beta -- that is, become more stable -- it's still less stable than your declared minimum-stability.
Proposed resolution
The validation should succeed if the version you're updating from is less stable than the version you're updating to, regardless of minimum-stability. In other words, even if minimum-stability is stable
, you should always be able to move from an alpha version to a beta version.
Or, to put it another way, if you're updating a package you already have, minimum-stability should be ignored. It should only matter if you're adding something you don't already have.
Remaining tasks
Fix this, and write an automated test for it.
User interface changes
None.
Introduced terminology
None.
API changes
None anticipated.
Data model changes
None.
Release notes snippet
TBD, likely none since Package Manager is an alpha experimental module.