+++ b/composer/Metapackage/CoreRecommended/composer.json
@@ -9,18 +9,18 @@
- "composer/semver": "3.2.6",
+ "composer/semver": "3.3.2",
...
- "laminas/laminas-diactoros": "2.8.0",
+ "laminas/laminas-diactoros": "2.9.2",
"laminas/laminas-escaper": "2.9.0",
- "laminas/laminas-feed": "2.15.0",
- "laminas/laminas-stdlib": "3.6.1",
+ "laminas/laminas-feed": "2.17.0",
+ "laminas/laminas-stdlib": "3.7.1",
Minor updates for 9.4.x. Should we increase constraints for forward-compatibility with the latest minors in case of sec releases? Could be a followup.
This is that follow-up.
Comments
Comment #2
wim leersI have been inspecting the commit history of
composer/Metapackage/CoreRecommended/composer.jsonbut cannot find any prior example like this. So … after spending a good while reading and diffing and googling, I still don't know what the concrete increases would/could be.The updates cited have already been committed to
9.4.x. So … forward compatibility in/with what? Of9.3.xwith9.4.x?9.4.xwith10.0.x?The closest examples I found are #3199199: [meta] Add compatibility for the latest major and minor versions of dependencies to Drupal 9 and #3267879: [meta] Add compatibility for the latest major and minor versions of dependencies to Drupal 10, but neither of those seem to cover what @xjm wrote in that comment.
Comment #3
xjmSo here's the issue. Take Diactoros for example:
In 9.4, the version used in the lockfile (and therefore
core-recommendedand the tarballs) is 2.9.2. However, the minimum constraint for it incore/composer.jsonis:"laminas/laminas-diactoros": "^2.1"Say Diactoros issues a security update for something that's exploitable in core, as (say) 2.9.4. If core is vulnerable, it's our policy to increase core's constraint to require the secure version of Diactoros. However, if we increase the constraint from
^2.1to^2.9.4in a security release, that could force sites that were not usingcore-recommendedto have a minor update of Diactoros in a patch release, which breaks many folks' expectations about semver.So the thing to discuss is whether to increase our constraints to require the minor versions used in the lockfiles, as a forward mitigation against this problem, or whether it's better to allow sites that are not using
core-recommendedthe freedom to use an older version of Diactoros (with the risk that they might then have a minor update forced on them in a security window if such a security release happened).Comment #4
wim leers👍 Thanks for that clarification! 🙏
I think that forward mitigation is then the prudent and least disruptive choice we can make.
It’s in line with what can be expected of a Drupal core minor release. And helps make Drupal core security releases also be in line with expectations.
Comment #5
wim leersComment #6
wim leersI inspected everything in
core/composer.json'srequireand compared to what's incomposer/Metapackage/CoreRecommended/composer.json. Whenever the latter requires a newer patch version, I didn't make any changes. Whenever the latter requires a new minor version, I did updatecore/composer.jsonaccordingly. (No major version differences exist — that's impossible.)But then there are at least some things to pay extra attention to:
twig/twig:core/composer.jsonwas explicitly updated to use Twig 2.14.11 in #3262583: Twig 2.14.11 update, but with zero context provided in that issue. 😬🤔 And #3278162: Update Composer dependencies to the latest minor and patch versions then updated onlycomposer/Metapackage/CoreRecommended/composer.jsonto Twig 2.14.13. After some digging, that was AFAICT because of https://www.symfony-news.com/news/details/twig-security-release-disallow..., which resulted in https://www.drupal.org/project/drupal/releases/9.3.5.doctrine/reflectionwas still at^1.1incore/composer.jsonbut has been at1.2.2incomposer/Metapackage/CoreRecommended/composer.jsonsince October 2020. For consistency sake, I updatedcore/composer.jsonto^1.2.doctrine/annotations: similar thing: a minor increment, but the recommended version was specified in August 2021.symfony-cmf/routing,egulias/email-validator,masterminds/html5,symfony/psr-http-message-bridge,asm89/stack-corsandpsr/log.End result: every
requiredependency incore/composer.jsongets updated with the exception of:symfony/psr-http-message-bridge)typo3/phar-stream-wrappertwig/twigguzzlehttp/guzzlestack/builderpear/archive_tar… which remain unchanged.
Comment #7
wim leersComment #8
xjmMany thanks @Wim Leers -- now to get feedback on this change. I didn't realize so many dependencies were that far behind. Tagging.
Comment #9
catch+1 from me, decreases the likelihood of a disruptive change later, and seems fairly unlikely that many (any?) sites are explicitly relying on the lower versions.
Comment #10
xjmOK, it sounds like we have signoffs on this change.
Unfortunately, the patch no longer applies because of the Guzzle release...
We should also make sure that the 10.0.x constraints are higher than these; it might be 9.5.x/9.4.x only if they are all on later major versions (or totally absent) in 10.0.x's
core/composer.json.Comment #11
quietone commentedReroll for 9.4.x
Comment #12
quietone commentedSame for 10.0x
Comment #13
wim leersThanks for the reroll, @quietone!
Queued a test for #12 too.
Comment #14
wim leersWell that's interesting:
Fortunately there's this:
… unfortunately it does not mention
content-hashat all. It only mentions "hash" once. Andcomposer update --lockdoes not actually update thecontent-hashfor me.Those docs were added in #3192842: Make our README more welcoming by converting it into an "entrypoint" into the Drupal ecosystem. I tried pretty much all the composer commands listed there. (Twice: once with 2.1.9, once on the latest: 2.4-dev+556450b15b6c47c55ffa46bd9048b410d56c3983).
My
composer-fu is not strong enough for this one 😬 I really wonder what I'm doing wrong 🙈 Really curious about this one!Comment #15
wim leersI can actually reproduce this failure locally. A single change in
core/composer.jsonwill cause a differentcontent-hash.But … it fails on both
10.0.xand9.5.x. Why does it on d.o only fail on one of the two branches?! 🤯Comment #16
wim leersLooking at the commit history, there's a lot of times where the hash (well, one of the two hashes that get checked — the test method is named pretty confusingly) got out of sync, and caused problems only on some environments. I'll accept that I do not fully grok
composer.As far as I can tell, we need more changes in both patches. Trying that here. 🤞
Both of these are with the patches above applied, then
composer update --lockto generate an interdiff, the combination of the two makes for the patch.Comment #17
effulgentsia commentedThis looks good with respect to the production dependencies. Should we have a followup to do the same for dev dependencies?
Comment #18
xjm@effulgentsia Backend dev dependencies don't have quite the same risk, because we don't package them in tagged releases nor issue security advisories for them in general. So I think it's sufficient just to harden the constraints for production dependencies for this.
Comment #19
xjmComment #23
xjmCommitted to 10.0.x and 9.5.x, and cherry-picked to 9.4.x. Thanks!
We'll need to mention this in the release notes (probably just adding a sentence to the existing note).