Problem/Motivation
Following #3135247: Composer's "prefer-stable" setting cannot be relied on to produce a stable release and #3179061: Further discuss use of "prefer-stable" and "minimum-stability" in core, we still don't quite have the right tools to make pre-release milestones of our Composer templates behave correctly.
Steps to reproduce
composer create-project drupal/recommended-project:9.1.0-alpha1 d9composer
cd d9composer
composer update
Expected result: Nothing happens, because everything's up to date.
Actual result: Site is downgraded to 9.0.7.
Proposed resolution
Set the each branch's minimun to correspond to the branch itself. Branches may be backwards compatible with old APIs, but they also introduce new APIs, and Drupal database update functionality certainly does not support downgrading sites. The fix is as simple as:
"require": {
"composer/installers": "^1.9",
"drupal/core-composer-scaffold": "^9.1",
"drupal/core-project-message": "^9.1",
"drupal/core-recommended": "^9.1"
},
Remaining tasks
- Introduce the simple fix above to prevent accidental downgrades.
- Once that simple fix is addressed, address the wider questions in #3179061: Further discuss use of "prefer-stable" and "minimum-stability" in core.
- Followup to make this a part of the core branching process.
User interface changes
N/A
API changes
Default specify minimum versions corresponding to the core minor version
Data model changes
N/A
Release notes snippet
Drupal core packages now explicitly depend on the current minor branch (for example, ^9.1
instead of ^9
, in order to make composer behaviour with pre-releases more predictable.
Comment | File | Size | Author |
---|---|---|---|
#2 | composer-3182959-2-9.1.x.patch | 1.61 KB | xjm |
#2 | composer-3182959-2-9.2.x.patch | 1.61 KB | xjm |
Comments
Comment #2
xjmComment #3
xjmComment #4
catchGood plan.
Comment #5
xjmComment #8
catchCommitted/pushed to 9.2.x and 9.1.x, thanks! Attempted a release notes snippet.
Comment #9
MixologicNice one.
Comment #10
xjmWe probably want a CR here too.
Comment #11
xjmOops, we also have a followup to (at least) add this to the branching instructions, and if possible to the branching script.
Comment #12
xjmComment #13
xjmI updated the branching script: https://github.com/xjm/drupal_core_release/commit/109e84fe6bf6c98cf334e3...
The handbook docs already had instructions to do this for major versions, so I just generalized them to apply to minor versions as well: https://www.drupal.org/node/2699919/revisions/view/12108029/12147727
Comment #14
xjmAlso posted the CR: https://www.drupal.org/node/3186830
Comment #15
xjm