localgovdrupal / localgov_project

Project template for Drupal 10 sites built with the LocalGov Drupal distribution.
https://localgovdrupal.org
GNU General Public License v2.0
11 stars 9 forks source link

Enable php-http/discovery plugin #107

Closed keelanfh closed 1 year ago

keelanfh commented 1 year ago

Breaking change in php-http/discovery prompts you to require a plugin. If accepted, this project build gets stuck in an endless composer loop. Endless loop is now fixed in php-http/discovery.

Discussion in discovery repo: https://github.com/php-http/discovery/issues/213

ekes commented 1 year ago

I'm going to hazard a guess that some of our dependencies can depend on the PSR implementations that are made available by this. So removing it might not cause any obvious immediate failures, but might for a module auto-retrieving something using guzzle and something.

Reading the issue linked, it's maybe better to just pin it to the previous version, till people come to a better solution. https://github.com/php-http/discovery/pull/208#pullrequestreview-1291220912 is specific to the looping. But composer create project is mentioned there, and the automated testing might be another. I've noticed the dependency certainly comes via something geo... so that's another thing that can't be certain it's got our top level composer file.

> lando composer why php-http/discovery
geocoder-php/common-http  4.5.0  requires  php-http/discovery (^1.6)
ekes commented 1 year ago

Spent some more time looking at this:-

a) the loop seems it is a bug, and they need to fix it, so we should pin for that bug; b) then on upgrading we should include the plugins false line for testing (I also need to work out how to disable it for drupal-ci testing :) but we could explicitly allow for it in normal operation. I need to look at how geoceder-php uses it I guess. It is however the intended behaviour.

keelanfh commented 1 year ago

@ekes Sounds good to pin the previous version instead. The dependency comes through localgovdrupal/localgov_geo so maybe it's more appropriate that we pin it there instead?

keelanfh commented 1 year ago

I created a PR on localgov_geo instead of this one: https://github.com/localgovdrupal/localgov_geo/pull/71 No longer relevant

keelanfh commented 1 year ago

php-http/discovery has now been updated to resolve the infinite loop issue: https://github.com/php-http/discovery/releases/tag/1.15.1

I've changed this PR to enable this new plugin, rather than disable it, at @ekes' suggestion. This runs fine for me, and gets rid of the prompt in the middle of the install, but I don't know enough to know if this is a good idea or not - or what implications it might have for CI pipelines. At least the tests on this PR seem to be working OK.