Composer offers a flag:
'prefer-stable'
https://getcomposer.org/doc/04-schema.md#prefer-stable

This flag allows us to lower the minimum requirements to dev for example, but still prefer stable versions over the dev-master versions found in github. This is an important flag since one project that does not have a stable release could bring down a complete chain of stable releases when composer manager is used.

Patch attached

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Nick_vh’s picture

Nick_vh’s picture

Status: Active » Needs review
cpliakas’s picture

Thanks for the patch.

I am not sure this is something that I want to merge automatically using the current strategy (last wins), I would rather have it be an option that could be toggled in the UI, enabled by default. That is the spirit of the following issue: #2209089. This is one of those settings that requires human thought IMHO.

Nick_vh’s picture

Couldn't find that issue :) ( #2209089: Resolve the prefer-stable property)

Sounds like a good solution to me. I'm not entirely sure if I understand the reasoning behind it, but I'm certainly ok with it.

cpliakas’s picture

Happy to talk about it further. I am more or less going on my experiences and how I would expect it to work, which isn't always a good baseline.

bojanz’s picture

I've now implemented 'prefer-stable' in 8.x-1.x, thanks for the hint, Nick.

deviantintegral’s picture

FileSize
638 bytes

Here's a patch that defaults prefer-stable to true.

I'm not sure a UI is needed for this. For a site builder, they probably always want stable packages where possible. For a developer, they could set prefer-stable to false in their composer.json if their module requires it.

bojanz’s picture

That makes sense to me as well.

deviantintegral’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Status: Needs review » Patch (to be ported)

Committed to 7.x-1.x.

  • deviantintegral committed c45d3ac on 7.x-1.x
    Issue #2323889 by Nick_vh, deviantintegral: Add prefer-stable to the...
bojanz’s picture

Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.