From ed145074536f4990895b44fbac18f385263c4a74 Mon Sep 17 00:00:00 2001 From: Randy Fay Date: Sun, 10 May 2026 08:38:29 -0600 Subject: [PATCH 1/9] fix(drupal-contrib): align drupal_version option order and default with drupal-core Options were ordered 11, 12, 10 (default 11) while drupal-core had 12, 11, 10 (default 12). The mismatch caused Coder workspace wizard to install the wrong Drupal version when selecting 12.x. Fixes #132. Co-Authored-By: Claude Sonnet 4.6 --- drupal-contrib/template.tf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drupal-contrib/template.tf b/drupal-contrib/template.tf index dbf0ce1..8a299bd 100644 --- a/drupal-contrib/template.tf +++ b/drupal-contrib/template.tf @@ -115,17 +115,17 @@ data "coder_parameter" "drupal_version" { display_name = "Drupal Version" description = "Major Drupal version to install as the dev dependency. Match the version the issue targets." type = "string" - default = "11" + default = "12" mutable = true order = 4 - option { - name = "11.x (stable)" - value = "11" - } option { name = "12.x (main branch)" value = "12" } + option { + name = "11.x (stable)" + value = "11" + } option { name = "10.x (stable)" value = "10" From badeed4b5b03dc60f748a7f243dfc96caddf20eb Mon Sep 17 00:00:00 2001 From: Randy Fay Date: Sun, 10 May 2026 08:45:47 -0600 Subject: [PATCH 2/9] fix(drupal-contrib): revert default drupal_version to 11 (current stable) 12.x is the main branch, not yet stable. Contrib issue work typically targets the current stable release (11.x), unlike drupal-core where main-branch work is the norm. Co-Authored-By: Claude Sonnet 4.6 --- drupal-contrib/template.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drupal-contrib/template.tf b/drupal-contrib/template.tf index 8a299bd..5b7dd76 100644 --- a/drupal-contrib/template.tf +++ b/drupal-contrib/template.tf @@ -115,7 +115,7 @@ data "coder_parameter" "drupal_version" { display_name = "Drupal Version" description = "Major Drupal version to install as the dev dependency. Match the version the issue targets." type = "string" - default = "12" + default = "11" mutable = true order = 4 option { From cf634afc1883b988f556fa43b885a4bb0cef94ce Mon Sep 17 00:00:00 2001 From: Randy Fay Date: Sun, 10 May 2026 10:44:30 -0600 Subject: [PATCH 3/9] fix(drupal-contrib): set DRUPAL_CORE env before ddev start so ddev poser respects selected version ddev-drupal-contrib's expand-composer-json defaults DRUPAL_CORE to ^11 if the env var is unset. The startup script was not setting it, so ddev poser always installed Drupal 11 regardless of the drupal_version parameter. Use 'ddev dotenv set .ddev/.env.web --drupal-core' after addon install but before ddev start so the container environment carries the right constraint. Co-Authored-By: Claude Sonnet 4.6 --- drupal-contrib/template.tf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drupal-contrib/template.tf b/drupal-contrib/template.tf index 5b7dd76..91bf219 100644 --- a/drupal-contrib/template.tf +++ b/drupal-contrib/template.tf @@ -632,6 +632,11 @@ COMPOSE_EOF update_status "⚠ ddev-drupal-contrib addon: Warning" fi + # Set DRUPAL_CORE so ddev-drupal-contrib's expand-composer-json / ddev poser + # installs the selected major version instead of defaulting to ^11. + ddev dotenv set .ddev/.env.web --drupal-core "^$DRUPAL_VERSION" + log_setup "✓ DRUPAL_CORE set to ^$DRUPAL_VERSION" + # Start DDEV ddev poweroff 2>&1 | tee -a "$SETUP_LOG" || true log_setup "Starting DDEV environment..." From 7206904133e006a9df1707c3ea10c20d00a9c276 Mon Sep 17 00:00:00 2001 From: Randy Fay Date: Sun, 10 May 2026 11:30:03 -0600 Subject: [PATCH 4/9] fix(drupal-contrib): use drush/drush:* to avoid pinning version in composer.json composer require drush/drush without a version lets Composer auto-determine a constraint (e.g. ^13.7) and write it into the module's composer.json. expand-composer-json then copies that pinned constraint into composer.contrib.json. Drush 13.x requires symfony/yaml ^6||^7, which conflicts with Drupal 12's requirement of symfony/yaml ~v8. Using drush/drush:* overrides any existing pinned constraint (including one the module already carries) so Composer can resolve Drush 14.x-dev which supports Symfony 8. Co-Authored-By: Claude Sonnet 4.6 --- drupal-contrib/template.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drupal-contrib/template.tf b/drupal-contrib/template.tf index 91bf219..a68fe79 100644 --- a/drupal-contrib/template.tf +++ b/drupal-contrib/template.tf @@ -672,7 +672,7 @@ COMPOSE_EOF # --no-update avoids triggering plugin checks before Drupal is installed log_setup "Adding drush to require-dev..." update_status "⏳ drush: Adding to composer.json..." - ddev exec composer require --dev drush/drush --no-update --no-interaction >> "$SETUP_LOG" 2>&1 || true + ddev exec composer require --dev "drush/drush:*" --no-update --no-interaction >> "$SETUP_LOG" 2>&1 || true # Run ddev poser: expands composer.json → composer.contrib.json (includes require-dev), # then runs composer install (installs Drupal + drush together), then removes composer.contrib.json From 565c940081b386cc0c2b5885d1a262797e02dab2 Mon Sep 17 00:00:00 2001 From: Randy Fay Date: Sun, 10 May 2026 12:10:03 -0600 Subject: [PATCH 5/9] ci(drupal-contrib): add skipto D12 to integration test matrix No Drupal 12 case existed, so the drush/symfony conflict would have passed undetected. skipto targets Drupal 12 in its own composer.json and is a suitable CI canary for D12 contrib compatibility. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/drupal-contrib-integration-test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/drupal-contrib-integration-test.yml b/.github/workflows/drupal-contrib-integration-test.yml index a64fbea..ab61cf7 100644 --- a/.github/workflows/drupal-contrib-integration-test.yml +++ b/.github/workflows/drupal-contrib-integration-test.yml @@ -58,6 +58,8 @@ jobs: drupal_version: "11" - project: pathauto drupal_version: "11" + - project: skipto + drupal_version: "12" fail-fast: false defaults: run: @@ -395,6 +397,8 @@ jobs: drupal_version: "11" - project: pathauto drupal_version: "11" + - project: skipto + drupal_version: "12" fail-fast: false defaults: run: From 72f7574f4888ccc17e4122405e1408a8d5576919 Mon Sep 17 00:00:00 2001 From: Randy Fay Date: Sun, 10 May 2026 12:46:52 -0600 Subject: [PATCH 6/9] fix(drupal-contrib): clean git status in workspace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Write .git/info/exclude so workspace-generated untracked files (.ddev/, web/, vendor/, scaffold files, recipes/) don't appear in git status. This file is never committed and doesn't touch the module's own .gitignore. Restore composer.json after ddev poser succeeds — drush is now in vendor/ so the require entry is no longer needed and shouldn't show as a local modification. Co-Authored-By: Claude Sonnet 4.6 --- drupal-contrib/template.tf | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drupal-contrib/template.tf b/drupal-contrib/template.tf index a68fe79..785a357 100644 --- a/drupal-contrib/template.tf +++ b/drupal-contrib/template.tf @@ -492,6 +492,19 @@ STATUS_HEADER cd "$PROJ_DIR" || { log_setup "✗ Cannot cd to $PROJ_DIR"; SETUP_FAILED=true; } + # Write local git exclude so workspace-generated files don't pollute git status. + # .git/info/exclude is never committed and acts like a per-clone .gitignore. + mkdir -p .git/info + cat > .git/info/exclude << 'GIT_EXCLUDE_EOF' +# Generated by coder-ddev workspace startup — do not edit. +.ddev/ +web/ +vendor/ +.editorconfig +.gitattributes +recipes/ +GIT_EXCLUDE_EOF + # ========================================== # Phase 3: Issue fork checkout (if requested) # ========================================== @@ -682,6 +695,9 @@ COMPOSE_EOF if ddev poser >> "$SETUP_LOG" 2>&1; then log_setup "✓ ddev poser complete ($((SECONDS - _t))s)" update_status "✓ ddev poser: Success" + # Restore composer.json — drush is now in vendor/ so the require entry + # is no longer needed and we don't want it showing as a local modification. + git checkout composer.json >> "$SETUP_LOG" 2>&1 || true else log_setup "✗ ddev poser failed ($((SECONDS - _t))s)" update_status "✗ ddev poser: Failed" From 3b6b775ee64092b60175ca4d3094205a9d12693e Mon Sep 17 00:00:00 2001 From: Randy Fay Date: Sun, 10 May 2026 12:50:47 -0600 Subject: [PATCH 7/9] fix(drupal-contrib): narrow git exclude to only Coder-generated .ddev files Excluding web/, vendor/, .editorconfig etc. is the module's own .gitignore concern. ddev-drupal-contrib explicitly recommends committing .ddev/ changes, so blanket-excluding .ddev/ conflicts with that philosophy. Only hide the three files that coder-ddev itself generates: .env.web, config.coder.yaml, docker-compose.coder-describe.yaml, and config.local.yaml (themes only). Co-Authored-By: Claude Sonnet 4.6 --- drupal-contrib/template.tf | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drupal-contrib/template.tf b/drupal-contrib/template.tf index 785a357..9fb23ee 100644 --- a/drupal-contrib/template.tf +++ b/drupal-contrib/template.tf @@ -492,17 +492,17 @@ STATUS_HEADER cd "$PROJ_DIR" || { log_setup "✗ Cannot cd to $PROJ_DIR"; SETUP_FAILED=true; } - # Write local git exclude so workspace-generated files don't pollute git status. + # Hide Coder-specific DDEV files from git status. # .git/info/exclude is never committed and acts like a per-clone .gitignore. + # We only exclude files we generate — not web/, vendor/, etc. which are the + # module's own concern and may already be in its .gitignore. mkdir -p .git/info cat > .git/info/exclude << 'GIT_EXCLUDE_EOF' # Generated by coder-ddev workspace startup — do not edit. -.ddev/ -web/ -vendor/ -.editorconfig -.gitattributes -recipes/ +.ddev/.env.web +.ddev/config.coder.yaml +.ddev/docker-compose.coder-describe.yaml +.ddev/config.local.yaml GIT_EXCLUDE_EOF # ========================================== From 620c66c211219941bf0f6929a2c61d4df1f544ed Mon Sep 17 00:00:00 2001 From: Randy Fay Date: Sun, 10 May 2026 15:15:06 -0600 Subject: [PATCH 8/9] fix(drupal-contrib): use skip-worktree instead of git checkout for composer.json git checkout composer.json removed drush from the file, causing ddev restart to rebuild vendor/ without drush and breaking drush en. Use git update-index --skip-worktree instead: the file content (and drush entry) stays intact so ddev never reinstalls, but git status hides the modification. Co-Authored-By: Claude Sonnet 4.6 --- drupal-contrib/template.tf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drupal-contrib/template.tf b/drupal-contrib/template.tf index 9fb23ee..599079a 100644 --- a/drupal-contrib/template.tf +++ b/drupal-contrib/template.tf @@ -695,9 +695,10 @@ COMPOSE_EOF if ddev poser >> "$SETUP_LOG" 2>&1; then log_setup "✓ ddev poser complete ($((SECONDS - _t))s)" update_status "✓ ddev poser: Success" - # Restore composer.json — drush is now in vendor/ so the require entry - # is no longer needed and we don't want it showing as a local modification. - git checkout composer.json >> "$SETUP_LOG" 2>&1 || true + # Hide the drush require-dev line from git status without touching the + # file — git checkout would remove drush from composer.json and break + # ddev restart (which rebuilds vendor/ from the restored file). + git update-index --skip-worktree composer.json >> "$SETUP_LOG" 2>&1 || true else log_setup "✗ ddev poser failed ($((SECONDS - _t))s)" update_status "✗ ddev poser: Failed" From da7ed068d362afce3352e655a923f9f6450966ca Mon Sep 17 00:00:00 2001 From: Randy Fay Date: Sun, 10 May 2026 15:24:00 -0600 Subject: [PATCH 9/9] fix(drupal-contrib): edit composer.json directly instead of using composer require ddev-drupal-contrib README explicitly says to manually add dev dependencies to require-dev rather than using the composer require command. Co-Authored-By: Claude Sonnet 4.6 --- drupal-contrib/template.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drupal-contrib/template.tf b/drupal-contrib/template.tf index 599079a..c0a7407 100644 --- a/drupal-contrib/template.tf +++ b/drupal-contrib/template.tf @@ -681,11 +681,11 @@ COMPOSE_EOF fi if [ "$DRUPAL_INSTALLED" = "false" ]; then - # Add drush as require-dev so expand-composer-json includes it in composer.contrib.json - # --no-update avoids triggering plugin checks before Drupal is installed + # Add drush as require-dev so expand-composer-json includes it in composer.contrib.json. + # Direct JSON edit (not `composer require`) per ddev-drupal-contrib README. log_setup "Adding drush to require-dev..." update_status "⏳ drush: Adding to composer.json..." - ddev exec composer require --dev "drush/drush:*" --no-update --no-interaction >> "$SETUP_LOG" 2>&1 || true + jq '.["require-dev"]["drush/drush"] = "*"' composer.json > composer.json.tmp && mv composer.json.tmp composer.json # Run ddev poser: expands composer.json → composer.contrib.json (includes require-dev), # then runs composer install (installs Drupal + drush together), then removes composer.contrib.json