joachim-n/drupal-core-development-project

Adjust the install instructions for DDEV

Closed this issue · 13 comments

Hi, your repo was mentioned on the #ddev-for-core-dev channel on the drupal slack. Since the current discussions there are about making the addon by justafish compatible with DDEV 1.22.7 and the upcoming 1.23.0 as well as the recent change in core switching from Yarn 1 to Yarn 4 requiring corepack i've tested an install of your composer template as well. There are a few stumbling blocks:

  1. if you are trying to install drupal-core-development-project based on the current instructions in DDEV 1.22.7 the composer create step fails due to the unmet PHP requirements. I've created a PR with a quick intermediate fix setting PHP to version 8.3 and node to version 20

  2. the next problem is that drupal 11 switched to yarn 4 recently https://www.drupal.org/project/drupal/issues/3109556 . according to the suggestion by @longwave over in ddev/ddev#5988 DDEV introduced a config item to enable corepack for DDEV ddev/ddev#6012 . So in DDEV 1.23.0 there will be a config setting that will be set to true per default if you are having a drupal11 based codebase with the new drupal project type. Problem is for the time being until 1.23.0 is released corepack has to be manually enabled with ddev . corepack enable . Maybe the best solution might be adding the following snippet to a projects config.yaml

hooks:
  post-start: 
    - exec: corepack enable

after a restart you then get 1.22.22 in the project root and 4.1.1 in repos/drupal/core. the only downside in ddev 1.22.7 you get a prompt requiring to download yarn after every restart. that will be improved and not required anymore in DDEV 1.23.0

  1. talking of DDEV 1.23.0 . there is one problem you have to have on your radar. ddev 1.23.0 will have a new drupal project type. on ddev config ddev DDEV will auto determine based on the codebase available which version of drupal is installed. problem with the steps for setting up your project, same as the quickstart guides on https://ddev.readthedocs.io/en/latest/users/quickstart/#drupal, on an empty directory where ddev composer create is run afterwards, ddev is unable to determine the exact version of drupal, therefore it is falling back to the default values (php 8.2 and corepack_enable false) which reintroduces the problems outlined in 1 and 2. it is a known problem and i'll open up an issue over in the ddev repo. there are also pitfalls upgrading from the drupal10 project type to the new drupal one which will be also covered in the aforementioned issue . it is just an fyi for now since there is only an alpha1 for 1.23.0 out

update: i've opened an issue about the problems outlined in point 3 ddev/ddev#6035

Should something like exec: corepack enable be in DDEV's own project templates? That seems like quite fiddly steps.

rfay commented

That's there for pre-DDEV v1.23.0.

I see v1.23.0 is still in alpha.

I'd rather not give people complex instructions that are probably not necessary. So, either:

  • hold off this PR until v1.23.0 is released and say in the docs that's the minimum recommended version
  • change the PR now to say that bit is only for pre-v1.23.0.
rfay commented

OTOH @rpkoller pays careful attention to things and would surely do another PR at v1.23.0 release :)

i've pushed a few changes to the installation on ddev section adjusting to the changes in the soon to be released version 1.23.0 of ddev. and i've added a disclaimer that the user has to make sure that ddev is upgraded to 1.23.0 before applying the next steps. but at the moment the composer require will fail in any case since drush is incompatible with symfony 7 in drupal 11.

Urgh, I didn't know about the Drush / Symfony 7 problem. Thanks for the heads up!

Is your PR ready for merge?

I would still prefer to run through an entire test setup with the new instructions. I think it should be good to go and working, but I just want to make sure (the combination of the new drupal project type, drupal 11 and a composer create based install is tricky). With DDEV 1.23.0 being released about five hours ago https://github.com/ddev/ddev/releases/tag/v1.23.0 and with the last real blocker being off the list https://drupal.slack.com/archives/C62H9CWQM/p1713323431321799?thread_ts=1712073362.477139&cid=C62H9CWQM it it sounds like a Drupal 11 ready release for Drush is close as well. I keep an constant eye on when Drush is ready and would test the instructions in this PR a final time and give you a heads up then here.

Ok, great!

Drush 13 is supporting Drupal 11 now: https://drupal.slack.com/archives/C62H9CWQM/p1713402423437749?thread_ts=1712073362.477139&cid=C62H9CWQM
but i think the composer.json would have to be updated, changing from ^12 to 13.x, then it would be possible to test the steps in this PR.

oh just noticed you have updated the composer.json to ^13. so i've quickly manually tested #27 and can confirm that the steps are correct as i've assumed and the setup is running through properly.

Ok. Is it ready to merge?

yes

Done, and tagging a new release. Thanks!