Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
In Composer 1.3 and higher the hash value has been removed from the lock file. This value is used in Drupal\Tests\ComposerIntegrationTest. See https://github.com/composer/composer/commit/8313e8687756059ef318a01386de...
Proposed resolution
We have three options:
- Fix the \Drupal\Tests\ComposerIntegrationTest::testComposerLockHash to test the content-hash by include composer as a dev dependency
- Fix the \Drupal\Tests\ComposerIntegrationTest::testComposerLockHash to test the content-hash by copying \Composer\Package\Locker::getContentHash() to the test
- Remove the test
Remaining tasks
User interface changes
None
API changes
None
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#2 | 2843259-2.patch | 2.3 KB | alexpott |
Comments
Comment #2
alexpottI think we need to keep the test since it gives us confidence that composer updates have been done correctly. I've gone for option 2 as the smallest impact.
Comment #3
dawehnerWithout reading the patch first, I would have chosen the same solution. Its a bit unfortunate as this might break in the future, when that algorithm changes, but it would annoy enough people on twitter that we would be informed pretty quickly.
Totally out of scope ... I believe composer patches should somehow be able to hook into that process, I guess? On the other hand its quite cool to not have merge conflicts anymore, as patches really just change the main composer.json and that's it.
Comment #4
alexpottWell if the algorithm changes the test will probably fail so hopefully DrupalCI will tell us before twitter :)
Comment #5
Eric_A CreditAttribution: Eric_A commentedNote that last december @Mile23 produced almost the exact same code in #2744463-111: Add phpcs, coder 8.2.8 as --dev requirements for drupal/core!
Comment #6
Mile23Approving this since it's the same solution as #2744463-111: Add phpcs, coder 8.2.8 as --dev requirements for drupal/core :-)
It's probably better to have a commit message that says 'this is because of composer 1.3' than something not directly related as it would with that other issue.
Comment #8
catchCommitted/pushed to 8.3.x, thanks!
Comment #9
cburschkaCan we get this into 8.2.x too? The same patch should already work.
Comment #10
cburschka(In fact this seems to have been RTBC on 8.2.x before being committed to 8.3.x)
Comment #12
cburschka(The patch was tested for 8.3.x when it should be on 8.2.x)
Comment #13
alexpottCommitted d8ca4b4 and pushed to 8.2.x. Thanks!
As a test-only change this is harmless to cherrypick to 8.2.x