New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Composer merge plugin dependencies are not correctly updated #653
Comments
We also have duplicate and mismatching composer.json: Line 19 in 93e13d6
composer.project.json: Line 3 in 93e13d6
|
Wow that's annoying. Oh well, I guess we just need to add that to the documentation at https://farmos.org/hosting/composer/#updating-dependencies?
This is sort of complicated... maybe just from a conceptual standpoint, if not from an actual code standpoint. Yes, we could move it to https://github.com/farmOS/composer-project/blob/2.x/composer.json, and it would work. Ultimately the dependency needs to be in the root project The reason I put it in Right now, the project Perhaps we could remove it from the farmOS |
This just reminded me of an open issue I discovered a little while back: wikimedia/composer-merge-plugin#252 That issue is specifically about |
Hmm I just tested this myself and didn't notice the issue. Here is what I did:
@paul121 did I do something different? Or am I misunderstanding the context when the issue occurs? |
Yes! If you inspect the composer output after running
That seems like correct steps. Although did you try this from a truly fresh install? In my testing I started by What was your composer output? |
Hmm, no I did not start from a fresh install. I had an existing I need to wrap my head around the "fresh install" scenario you're describing... but if this is not an issue with normal updates (running |
I think the issue is just that your test case didn't change the drupal core version enough times. It stared and ended with the same 9.5.5 which may be hard to notice. I would be curious if you did this |
No it started with diff --git a/services/farmos/composer.json b/services/farmos/composer.json
index 5fc4e3f21..b46ce2783 100644
--- a/services/farmos/composer.json
+++ b/services/farmos/composer.json
@@ -20,7 +20,7 @@
}
],
"require": {
- "farmos/farmos": "2.0.1",
+ "farmos/farmos": "2.0.3",
"farmier/farmier": "*",
"oomphinc/composer-installers-extender": "^2",
"wikimedia/composer-merge-plugin": "^2.0"
diff --git a/services/farmos/composer.lock b/services/farmos/composer.lock
index 0b07a9b46..8c1bd05dd 100644
--- a/services/farmos/composer.lock
+++ b/services/farmos/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "7b66e58aa380444d74c69bac480b99a2",
+ "content-hash": "df8c3e6d84bd4c579cb2426c3e550de0",
"packages": [
{
"name": "agralogics/farm_agralogics",
@@ -1634,16 +1634,16 @@
},
{
"name": "drupal/core",
- "version": "9.5.3",
+ "version": "9.5.5",
"source": {
"type": "git",
"url": "https://github.com/drupal/core.git",
- "reference": "67e34a5e8f48cafdd5c26e778a9570860e2d44a5"
+ "reference": "eae5e76a8b403cbd42b3465f567313b52d78b0dc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/drupal/core/zipball/67e34a5e8f48cafdd5c26e778a9570860e2d44a5",
- "reference": "67e34a5e8f48cafdd5c26e778a9570860e2d44a5",
+ "url": "https://api.github.com/repos/drupal/core/zipball/eae5e76a8b403cbd42b3465f567313b52d78b0dc",
+ "reference": "eae5e76a8b403cbd42b3465f567313b52d78b0dc",
"shasum": ""
},
"require": {
@@ -1795,22 +1795,22 @@
],
"description": "Drupal is an open source content management platform powering millions of websites and applications.",
"support": {
- "source": "https://github.com/drupal/core/tree/9.5.3"
+ "source": "https://github.com/drupal/core/tree/9.5.5"
},
- "time": "2023-02-01T19:47:31+00:00"
+ "time": "2023-03-15T14:30:25+00:00"
},
{
"name": "drupal/core-composer-scaffold",
- "version": "9.5.3",
+ "version": "9.5.5",
"source": {
"type": "git",
"url": "https://github.com/drupal/core-composer-scaffold.git",
- "reference": "df1f779d3f94500f6cc791427aa729e0ba4b2464"
+ "reference": "c78779acff7b39fc0f29ff1edd710361c15ed87b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/drupal/core-composer-scaffold/zipball/df1f779d3f94500f6cc791427aa729e0ba4b2464",
- "reference": "df1f779d3f94500f6cc791427aa729e0ba4b2464",
+ "url": "https://api.github.com/repos/drupal/core-composer-scaffold/zipball/c78779acff7b39fc0f29ff1edd710361c15ed87b",
+ "reference": "c78779acff7b39fc0f29ff1edd710361c15ed87b",
"shasum": ""
},
"require": {
@@ -1845,9 +1845,9 @@
"drupal"
],
"support": {
- "source": "https://github.com/drupal/core-composer-scaffold/tree/9.5.3"
+ "source": "https://github.com/drupal/core-composer-scaffold/tree/9.5.5"
},
- "time": "2022-06-19T16:14:18+00:00"
+ "time": "2023-03-09T21:29:23+00:00"
},
{
"name": "drupal/csv_serialization",
@@ -4722,16 +4722,16 @@
},
{
"name": "farmos/farmos",
- "version": "2.0.1",
+ "version": "2.0.3",
"source": {
"type": "git",
"url": "https://github.com/farmOS/farmOS.git",
- "reference": "93e13d6f8384b6026110754dc2fc7a403f82847e"
+ "reference": "c981875d65a1c74ea50ecdd8e92b855ff69760bf"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/farmOS/farmOS/zipball/93e13d6f8384b6026110754dc2fc7a403f82847e",
- "reference": "93e13d6f8384b6026110754dc2fc7a403f82847e",
+ "url": "https://api.github.com/repos/farmOS/farmOS/zipball/c981875d65a1c74ea50ecdd8e92b855ff69760bf",
+ "reference": "c981875d65a1c74ea50ecdd8e92b855ff69760bf",
"shasum": ""
},
"require": {
@@ -4739,7 +4739,7 @@
"drupal/admin_toolbar": "^3.2",
"drupal/config_update": "^1.7",
"drupal/consumers": "^1.15",
- "drupal/core": "9.5.3",
+ "drupal/core": "9.5.5",
"drupal/csv_serialization": "^2.0",
"drupal/date_popup": "^1.1",
"drupal/entity": "1.4",
@@ -4777,7 +4777,8 @@
"Issue #2429699: Add Views EntityReference filter to be available for all entity reference fields.": "https://www.drupal.org/files/issues/2021-12-02/2429699-453-9.3.x.patch",
"Issue #2339235: Remove taxonomy hard dependency on node module": "https://www.drupal.org/files/issues/2021-12-09/2339235-9.3.x-76.patch",
"Issue #1874838: Allow exposed blocks to use 'Link display' settings": "https://www.drupal.org/files/issues/2021-11-11/1874838-26.patch",
- "Issue #2909128: Autocomplete not working on Chrome Android": "https://www.drupal.org/files/issues/2022-12-16/drupal-2909128-9.5.x-74.patch"
+ "Issue #2909128: Autocomplete not working on Chrome Android": "https://www.drupal.org/files/issues/2022-12-16/drupal-2909128-9.5.x-74.patch",
+ "Issue #3266341: Views pagers do math on disparate data types, resulting in type errors in PHP 8": "https://www.drupal.org/files/issues/2022-09-23/3266341-26.patch"
},
"drupal/entity": {
"Issue #3206703: Provide reverse relationships for bundle plugin entity_reference fields.": "https://www.drupal.org/files/issues/2022-05-11/3206703-10.patch"
@@ -4816,7 +4817,7 @@
"docs": "https://farmOS.org/guide",
"forum": "https://farmOS.discourse.group",
"issues": "https://github.com/farmOS/farmOS/issues",
- "source": "https://github.com/farmOS/farmOS/tree/2.0.1"
+ "source": "https://github.com/farmOS/farmOS/tree/2.0.3"
},
"funding": [
{
@@ -4828,7 +4829,7 @@
"type": "open_collective"
}
],
- "time": "2023-02-08T22:54:06+00:00"
+ "time": "2023-03-15T18:35:20+00:00"
},
{
"name": "farmos/farmos-map", |
Weird. I did the same, Can you share the console output of My diff --git a/composer.lock b/composer.lock
index 5ea4cf7..adc3225 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "44d28c6209c182cdf9c5c1be31eae902",
+ "content-hash": "7b42fdb373399f9a190cccd0b183a97a",
"packages": [
{
"name": "asm89/stack-cors",
@@ -1535,16 +1535,16 @@
},
{
"name": "drupal/core",
- "version": "9.5.3",
+ "version": "9.5.5",
"source": {
"type": "git",
"url": "https://github.com/drupal/core.git",
- "reference": "67e34a5e8f48cafdd5c26e778a9570860e2d44a5"
+ "reference": "eae5e76a8b403cbd42b3465f567313b52d78b0dc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/drupal/core/zipball/67e34a5e8f48cafdd5c26e778a9570860e2d44a5",
- "reference": "67e34a5e8f48cafdd5c26e778a9570860e2d44a5",
+ "url": "https://api.github.com/repos/drupal/core/zipball/eae5e76a8b403cbd42b3465f567313b52d78b0dc",
+ "reference": "eae5e76a8b403cbd42b3465f567313b52d78b0dc",
"shasum": ""
},
"require": {
@@ -1696,9 +1696,9 @@
],
"description": "Drupal is an open source content management platform powering millions of websites and applications.",
"support": {
- "source": "https://github.com/drupal/core/tree/9.5.3"
+ "source": "https://github.com/drupal/core/tree/9.5.5"
},
- "time": "2023-02-01T19:47:31+00:00"
+ "time": "2023-03-15T14:30:25+00:00"
},
{
"name": "drupal/core-composer-scaffold",
@@ -3842,16 +3842,16 @@
},
{
"name": "farmos/farmos",
- "version": "2.0.1",
+ "version": "2.0.3",
"source": {
"type": "git",
"url": "https://github.com/farmOS/farmOS.git",
- "reference": "93e13d6f8384b6026110754dc2fc7a403f82847e"
+ "reference": "c981875d65a1c74ea50ecdd8e92b855ff69760bf"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/farmOS/farmOS/zipball/93e13d6f8384b6026110754dc2fc7a403f82847e",
- "reference": "93e13d6f8384b6026110754dc2fc7a403f82847e",
+ "url": "https://api.github.com/repos/farmOS/farmOS/zipball/c981875d65a1c74ea50ecdd8e92b855ff69760bf",
+ "reference": "c981875d65a1c74ea50ecdd8e92b855ff69760bf",
"shasum": ""
},
"require": {
@@ -3859,7 +3859,7 @@
"drupal/admin_toolbar": "^3.2",
"drupal/config_update": "^1.7",
"drupal/consumers": "^1.15",
- "drupal/core": "9.5.3",
+ "drupal/core": "9.5.5",
"drupal/csv_serialization": "^2.0",
"drupal/date_popup": "^1.1",
"drupal/entity": "1.4",
@@ -3897,7 +3897,8 @@
"Issue #2429699: Add Views EntityReference filter to be available for all entity reference fields.": "https://www.drupal.org/files/issues/2021-12-02/2429699-453-9.3.x.patch",
"Issue #2339235: Remove taxonomy hard dependency on node module": "https://www.drupal.org/files/issues/2021-12-09/2339235-9.3.x-76.patch",
"Issue #1874838: Allow exposed blocks to use 'Link display' settings": "https://www.drupal.org/files/issues/2021-11-11/1874838-26.patch",
- "Issue #2909128: Autocomplete not working on Chrome Android": "https://www.drupal.org/files/issues/2022-12-16/drupal-2909128-9.5.x-74.patch"
+ "Issue #2909128: Autocomplete not working on Chrome Android": "https://www.drupal.org/files/issues/2022-12-16/drupal-2909128-9.5.x-74.patch",
+ "Issue #3266341: Views pagers do math on disparate data types, resulting in type errors in PHP 8": "https://www.drupal.org/files/issues/2022-09-23/3266341-26.patch"
},
"drupal/entity": {
"Issue #3206703: Provide reverse relationships for bundle plugin entity_reference fields.": "https://www.drupal.org/files/issues/2022-05-11/3206703-10.patch"
@@ -3936,7 +3937,7 @@
"docs": "https://farmOS.org/guide",
"forum": "https://farmOS.discourse.group",
"issues": "https://github.com/farmOS/farmOS/issues",
- "source": "https://github.com/farmOS/farmOS/tree/2.0.1"
+ "source": "https://github.com/farmOS/farmOS/tree/2.0.3"
},
"funding": [
{
@@ -3948,7 +3949,7 @@
"type": "open_collective"
}
],
- "time": "2023-02-08T22:54:06+00:00"
+ "time": "2023-03-15T18:35:20+00:00"
},
{
"name": "farmos/farmos-map", |
I just rolled back to my previous commit, manually changed
|
Oh and my composer version:
I'm running this inside the farmOS Docker image, for what it's worth. So that's the version in the image. |
I just did the same rollback and got the same message, all updated to 9.5.5. But... call me crazy... I still don't trust this as a test though... I believe some sort of state is being maintained outside of
I just tested this with our docker image in a fresh install, going from 2.0.1 to 2.0.2 and finally 2.0.3. I get the same behavior as I originally reported. It is important to start by removing |
Interesting! Seems like we're getting closer to the root circumstance...
I'll have to try this myself next... Well, maybe if we figure out exactly what leads to it we can find a targeted fix that doesn't require running |
I experienced this again with the latest 2.2 release. I needed to run |
I experienced this with
|
Note that this also affects patches. I had to run |
I wonder if we could fix this with a Composer script in this repository that is triggered by the |
I opened a PR to add a quick documentation fix as a temporary measure while we figure this out... #786 |
Describe the bug
Following the Updating dependencies with composer documentation produces the following bug where the
composer.project.json
dependencies included by the composer merge plugin are not correctly updated.This is not currently a large issue because there are only two non-dev dependencies in
composer.project.json
.farmOS/composer.project.json
Lines 1 to 5 in 93e13d6
This only becomes an issue when a new release of farmOS comes with changes to either of these additional project dependencies. Unfortunately because we pin
drupal/core-composer-scaffold
we typically change this dependency with each release of farmOS, so in practice this is an issue with every release of farmOS.To Reproduce
Steps to reproduce the behavior:
2.0.0-rc1
in composer.json.composer install --no-dev
. Observe thatdrupal/core
anddrupal/core-composer-scaffold
are both installed and locked to9.4.9
2.0.0
in composer.json.composer update --no-dev
. Observe thatdrupal/core
is updated to9.5.0
butdrupal/core-composer-scaffold
is not updated.2.0.1
in composer.json.composer update --no-dev
. Observe thatdrupal/core
is updated to9.5.3
butdrupal/core-composer-scaffold
is only updated to9.5.0
.Expected behavior
Composer update instructions updates all dependencies.
I believe the fix is to actually run
composer update --no-dev
twice to include updates from sub-levelcomposer.json
files. As documented in composer merge plugin: https://github.com/wikimedia/composer-merge-plugin#updating-sub-levels-composerjson-filesFor example, after step 4 above, running
composer update --no-dev
again correctly updatesdrupal/core-composer-scaffold
:$ ddev composer update --no-dev Xdebug: [Step Debug] Could not connect to debugging client. Tried: host.docker.internal:9003 (through xdebug.client_host/xdebug.client_port) :-( Loading composer repositories with package information Updating dependencies Lock file operations: 0 installs, 1 update, 0 removals - Upgrading drupal/core-composer-scaffold (9.4.9 => 9.5.0) Writing lock file
The text was updated successfully, but these errors were encountered: