From 2d0d8f2d836eff440c390fc8cb0c27cc1c97c0dd Mon Sep 17 00:00:00 2001 From: Randy Fay Date: Wed, 11 Nov 2026 09:36:38 -0700 Subject: [PATCH 1/5] ci: test the core issue branch, not the fork's main, fixes #238 ## The Issue - Fixes #238 Both core issue-fork jobs in `drupal-integration-test.yml` took the branch from the GitLab fork's `default_branch`. For a core issue fork this is always `main`, a frozen copy of core from when the fork was created. The nightly run logged `Resolved: branch=main`, so the jobs never tested an issue branch. ## How This PR Solves The Issue Both jobs now pick the most recently committed branch named `-*`, the drupal.org convention for issue branches. They fall back to `default_branch` only when no such branch exists. This is the same lookup that `drupal-contrib-integration-test.yml` already uses. For `DRUPAL_TEST_ISSUE_FORK=drupal-3587098`, the branch changes from `main` to `3587098-add-support-for`. ## Manual Testing Instructions ```bash ISSUE_NUM=3587098 curl -sf "https://git.drupalcode.org/api/v4/projects/issue%2Fdrupal-${ISSUE_NUM}/repository/branches?per_page=100" \ | jq -r --arg prefix "${ISSUE_NUM}-" \ '[.[] | select(.name | startswith($prefix))] | sort_by(.commit.committed_date) | last.name // empty' # Expect: 3587098-add-support-for ``` On this PR's CI run, the "Drupal issue fork drupal-3587098 (GH)" job's "Resolve issue branch" step must print `Resolved: branch=3587098-add-support-for drupal_version=12`. The workspace must then install Drupal from that branch. ## Automated Testing Overview Claude Code ran the jq lookup above against git.drupalcode.org, and it returned `3587098-add-support-for`. `actionlint` reports no new findings in the changed steps. The workflow itself has not run yet. The issue branch dates from 2026-05-01, so this PR's CI run will show whether it still installs on `drupal_version=12`. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/drupal-integration-test.yml | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/.github/workflows/drupal-integration-test.yml b/.github/workflows/drupal-integration-test.yml index 3ace2fb..e6a61a4 100644 --- a/.github/workflows/drupal-integration-test.yml +++ b/.github/workflows/drupal-integration-test.yml @@ -422,12 +422,24 @@ jobs: # Strip optional "drupal-" prefix so bare numbers and prefixed values both work ISSUE_NUM="${ISSUE_FORK#drupal-}" - # Derive the default branch of the issue fork from the GitLab API + # A core issue fork's default_branch is always "main" -- a frozen copy + # of core main from when the fork was created, not the issue's work. + # The issue branch follows drupal.org's "-description" + # convention, so pick the most recently committed match (same logic + # as drupal-contrib-integration-test.yml); fall back to the fork's + # default branch only if no such branch exists yet. ISSUE_BRANCH=$(curl -sf \ - "https://git.drupalcode.org/api/v4/projects/issue%2Fdrupal-${ISSUE_NUM}" \ - | jq -r '.default_branch') + "https://git.drupalcode.org/api/v4/projects/issue%2Fdrupal-${ISSUE_NUM}/repository/branches?per_page=100" \ + | jq -r --arg prefix "${ISSUE_NUM}-" \ + '[.[] | select(.name | startswith($prefix))] | sort_by(.commit.committed_date) | last.name // empty') + if [[ -z "$ISSUE_BRANCH" ]]; then + echo "No '${ISSUE_NUM}-*' branch found on drupal-${ISSUE_NUM} — falling back to its default branch" + ISSUE_BRANCH=$(curl -sf \ + "https://git.drupalcode.org/api/v4/projects/issue%2Fdrupal-${ISSUE_NUM}" \ + | jq -r '.default_branch') + fi if [[ -z "$ISSUE_BRANCH" || "$ISSUE_BRANCH" == "null" ]]; then - echo "ERROR: Could not resolve default branch for issue fork $ISSUE_NUM" >&2 + echo "ERROR: Could not resolve a branch for issue fork $ISSUE_NUM" >&2 exit 1 fi @@ -593,11 +605,20 @@ jobs: - name: Resolve issue branch and Drupal version from issue number run: | ISSUE_NUM="${ISSUE_FORK#drupal-}" + # See the matching step in drupal-issue-fork: the fork's default_branch + # is a stale copy of core main, so prefer the "-*" branch. ISSUE_BRANCH=$(curl -sf \ - "https://git.drupalcode.org/api/v4/projects/issue%2Fdrupal-${ISSUE_NUM}" \ - | jq -r '.default_branch') + "https://git.drupalcode.org/api/v4/projects/issue%2Fdrupal-${ISSUE_NUM}/repository/branches?per_page=100" \ + | jq -r --arg prefix "${ISSUE_NUM}-" \ + '[.[] | select(.name | startswith($prefix))] | sort_by(.commit.committed_date) | last.name // empty') + if [[ -z "$ISSUE_BRANCH" ]]; then + echo "No '${ISSUE_NUM}-*' branch found on drupal-${ISSUE_NUM} — falling back to its default branch" + ISSUE_BRANCH=$(curl -sf \ + "https://git.drupalcode.org/api/v4/projects/issue%2Fdrupal-${ISSUE_NUM}" \ + | jq -r '.default_branch') + fi if [[ -z "$ISSUE_BRANCH" || "$ISSUE_BRANCH" == "null" ]]; then - echo "ERROR: Could not resolve default branch for issue fork $ISSUE_NUM" >&2 + echo "ERROR: Could not resolve a branch for issue fork $ISSUE_NUM" >&2 exit 1 fi RAW_VERSION=$(curl -sf \ From cd60e52de6507f6a352b51725a7c91c8c37140fc Mon Sep 17 00:00:00 2001 From: Randy Fay Date: Wed, 11 Nov 2026 11:49:38 -0700 Subject: [PATCH 2/5] fix(drupal-core): install drupal/core from the checked-out branch, for #238 ## The Issue Once the core issue-fork CI job tested the real issue branch (previous commit), `composer install` failed three times. The failing run is https://github.com/ddev/coder-ddev/actions/runs/43060286609/job/130702950256. The same failure happens on coder.ddev.com with `issue_fork=3587098`, `issue_branch=3587098-add-support-for`, `drupal_version=12`: ```text Root composer.json requires drupal/core 12.9999999.9999999.9999999-dev -> satisfiable by drupal/core[12.x-dev (alias of dev-main)]. drupal/core 12.x-dev requires guzzlehttp/psr7 ^3.0 ``` The branch's own `core/composer.json` requires `guzzlehttp/psr7 ^2.8`. The `^3.0` comes from today's core `main`. Composer gives the root package core's branch alias, `12.x-dev`. It gives the `core/` path package the raw branch name, `dev-3587098-add-support-for`, which doesn't match the root's `self.version` requirement. So Composer takes `drupal/core` `dev-main` from Packagist. Every issue workspace is built against current `main`'s dependencies, and a branch from before a major dependency bump cannot install at all. ## How This PR Solves The Issue After the `amateescu/ddev-drupal-dev` add-on writes `composer.local.json`, the startup script adds `core/` as the first repository. It gives `drupal/core` the version from core's own `extra.branch-alias`. Composer then installs the checked-out core and the branch's own dependency versions. If `core/composer.json` has no branch alias, or the jq edit fails, the script leaves the file unchanged and logs a warning. This belongs in the add-on's generated `composer.local.json`. The template patch is a workaround until the add-on handles it. ## Manual Testing Instructions ```bash coder create --template drupal-core --parameter drupal_version=12 \ --parameter issue_fork=3587098 --parameter issue_branch=3587098-add-support-for \ --parameter install_profile=minimal --use-parameter-defaults --yes coder logs | grep -E 'pinned to local core|Composer install|Drupal installed' # Expect: "drupal/core pinned to local core/ (12.x-dev)", "Composer install complete", "Drupal installed" ssh .coder 'cd drupal-core && ddev exec "composer show drupal/core" | grep -E "^(dist|path)"' # Expect: dist : [path] core ``` ## Automated Testing Overview Claude Code ran `terraform fmt -recursive`, `make validate` and `make test-templates`, which all pass. On a coder.ddev.com workspace with the failing branch, Claude Code applied the same `composer.local.json` change by hand. `composer install` then passed in 23s, `drupal/core` came from `[path] core`, and Guzzle resolved to 7.16.1 with psr7 2.13.2. The template change itself runs only in the PR's "Drupal issue fork" and "Drupal 11/12 (plain)" CI jobs. Co-Authored-By: Claude Opus 5.5 --- drupal-core/template.tf | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drupal-core/template.tf b/drupal-core/template.tf index cca53ac..1f745df 100644 --- a/drupal-core/template.tf +++ b/drupal-core/template.tf @@ -881,6 +881,27 @@ web_environment: TESTENV_EOF log_setup "✓ .ddev/config.zzz-coder-test-env.yaml written (SIMPLETEST_BASE_URL override)" + # Make Composer install drupal/core from the checked-out core/ directory. + # On an issue branch, Composer gives the root package core's branch + # alias (e.g. 12.x-dev), but gives the core/ path package the raw branch + # name (dev--), which doesn't match the root's + # "self.version" requirement. Composer then takes drupal/core dev-main + # from Packagist, so the branch is built against today's main + # dependencies, and an older branch can't install at all (#238). + # Declaring core/ first, with the version from its own branch alias, + # makes the local copy win. + _core_alias=$(jq -r '(.extra["branch-alias"] // {}) | to_entries | first | .value // empty' core/composer.json 2>/dev/null) + if [ -n "$_core_alias" ] && [ -f composer.local.json ]; then + if jq --arg v "$_core_alias" \ + '.repositories = ({"drupal-core-local": {"type": "path", "url": "core", "options": {"versions": {"drupal/core": $v}}}} + (.repositories // {}))' \ + composer.local.json > composer.local.json.tmp && mv composer.local.json.tmp composer.local.json; then + log_setup "✓ composer.local.json: drupal/core pinned to local core/ ($_core_alias)" + else + rm -f composer.local.json.tmp + log_setup "⚠ Could not pin drupal/core to local core/ in composer.local.json" + fi + fi + log_setup "Restarting DDEV to activate add-on..." ddev restart >> "$SETUP_LOG" 2>&1 || true From 047be5ccc4b5c3215c5e08d0b6d1218a1b1d2fc3 Mon Sep 17 00:00:00 2001 From: Randy Fay Date: Wed, 11 Nov 2026 11:53:29 -0700 Subject: [PATCH 3/5] test(ci): check that drupal/core comes from the issue branch, for #238 ## The Issue The core issue-fork CI job only checks that the workspace installs. When Composer takes `drupal/core` from Packagist's `dev-main` instead of the checked-out `core/`, a recent issue branch still installs. So the job passes, and the bug fixed in the previous commit goes unnoticed. This PR's first run failed only because issue 3587098's branch is old enough to conflict with today's `main`. ## How This PR Solves The Issue Both core issue-fork jobs get a step that runs `ddev composer show drupal/core` in the workspace. The step fails unless the `dist` line is `[path] core`. With the bug, that line shows `[zip] https://api.github.com/repos/drupal/core/zipball/...`. ## Automated Testing Overview Claude Code checked that the workflow parses as YAML and that `actionlint` reports nothing new. The expected `dist : [path] core ` line comes from `composer show` in a coder.ddev.com workspace with the fix applied. The new step itself runs only in this PR's "Drupal issue fork drupal-3587098 (GH)" job. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/drupal-integration-test.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/drupal-integration-test.yml b/.github/workflows/drupal-integration-test.yml index e6a61a4..698db17 100644 --- a/.github/workflows/drupal-integration-test.yml +++ b/.github/workflows/drupal-integration-test.yml @@ -502,6 +502,12 @@ jobs: echo "Current branch: $CURRENT Expected: ${{ env.ISSUE_BRANCH }}" [[ "$CURRENT" == "${{ env.ISSUE_BRANCH }}" ]] || { echo "ERROR: wrong branch" >&2; exit 1; } + - name: Verify workspace — drupal/core installed from the checked-out branch (#238) + run: | + DIST=$(coder ssh ${{ env.WORKSPACE_NAME }} -- env -C /home/coder/drupal-core ddev composer show drupal/core | tr -d '\r' | grep -E '^dist ' || true) + echo "drupal/core $DIST" + [[ "$DIST" == *"[path] core"* ]] || { echo "ERROR: drupal/core was not installed from the local core/ path repository" >&2; exit 1; } + - name: Verify workspace — Drush DB connected run: coder ssh ${{ env.WORKSPACE_NAME }} -- ddev drush status --fields=db-status | grep -i connected @@ -695,6 +701,16 @@ jobs: fi echo "OK: git tree is clean" + - # Regression check for #238: without the composer.local.json pin in + # template.tf, Composer takes drupal/core from Packagist's dev-main on + # an issue branch. That still installs when the branch is recent, so + # check where drupal/core came from, not just that it installed. + name: Verify workspace — drupal/core installed from the checked-out branch (#238) + run: | + DIST=$(coder ssh ${{ env.WORKSPACE_NAME }} -- env -C /home/coder/drupal-core ddev composer show drupal/core | tr -d '\r' | grep -E '^dist ' || true) + echo "drupal/core $DIST" + [[ "$DIST" == *"[path] core"* ]] || { echo "ERROR: drupal/core was not installed from the local core/ path repository" >&2; exit 1; } + - name: Verify workspace — Drush DB connected run: coder ssh ${{ env.WORKSPACE_NAME }} -- ddev drush status --fields=db-status | grep -i connected From 6b682ca0542dad13edc13a7180b60ef0bef858d5 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 11 Nov 2026 20:19:31 +0000 Subject: [PATCH 4/5] fix(drupal-core): build issue branches against core's own lock, for #238 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## The Issue After the previous commits, the "Drupal issue fork drupal-3587098 (GH)" job installs `drupal/core` from the checked-out `core/`. Drupal then serves HTTP 404 `No route found for "GET https://…/"` on `/`, and HTTP 500 on `/user/login`. The failing run is https://github.com/ddev/coder-ddev/actions/runs/43082118728/job/130737581910. The add-on's `composer.local.json` re-solves every dependency to the newest allowed version. Core's lock for branch `3587098-add-support-for` (May 2026) has Symfony 8.0.6, twig 3.22.0 and Guzzle 7.10.0. The workspace installed Symfony 8.1.11, twig 3.30.0 and Guzzle 7.16.1, which that branch never ran against. ## How This PR Solves The Issue The startup script now edits `composer.local.json` in three ways: | Change | Why | | --- | --- | | Add every `path` repository from core's `composer.json` (`core/` and the four `composer/Plugin/*`), each with the version from its own branch alias | Core's lock lists all five as path packages under the branch alias. Before, only `core/` was declared, so the four plugins came from Packagist. | | Set `extra.drupal-dev.pin-core-lock` when core has a `composer.lock` | The add-on's `CoreLockPinner` limits packages in core's lock to the locked versions. Packages that are not in the lock, such as drush and its own dependencies, still resolve freely. | | Set `config.policy.advisories.block` and `config.audit.block-insecure` to `false` | Composer refuses versions with published advisories. An older lock always has some, so with pinning on the install fails. `composer audit` still reports them. | The pinning belongs in the `amateescu/ddev-drupal-dev` add-on. The template patch is a workaround until the add-on handles it. ## Manual Testing Instructions ```bash coder create --template drupal-core --parameter drupal_version=12 \ --parameter issue_fork=3587098 --parameter issue_branch=3587098-add-support-for \ --parameter install_profile=minimal --use-parameter-defaults --yes coder logs | grep -E 'core path packages pinned|Composer install|Drupal installed' # Expect: "pin-core-lock=true", "Composer install complete", "Drupal installed" ssh .coder 'cd drupal-core && curl -s -o /dev/null -w "%{http_code}\n" http://127.0.0.1/' # Expect: 200 ssh .coder 'cd drupal-core && jq -r ".packages[] | select(.name == \"symfony/routing\") | .version" composer.local.lock' # Expect: v8.0.6, the version in the branch's composer.lock ``` Repeat with `drupal_version=12` and `drupal_version=11` and no issue fork. Both must install Drupal. ## Automated Testing Overview Claude Code ran `terraform fmt -recursive`, `make validate` and `make test-templates`, which all pass. On staging-coder.ddev.com, Claude Code pushed this branch's template as an inactive version and created a workspace for issue 3587098. Without this commit, `/` returned 404 and `/user/login` returned 500. With the same `composer.local.json` edits applied by hand, `/` and `/user/login` returned 200. `composer require drush/drush` worked with pinning on. Claude Code then pushed this commit's template and built three workspaces: issue 3587098, plain `drupal_version=12`, and plain `drupal_version=11`. All three installed Drupal, served 200 on `/` and `/user/login`, and passed CI's `dist : [path] core` check. Each installed the `symfony/routing` version in its own core lock: 8.0.6, 8.1.6 and 7.4.23. `ddev drush cr` still fails on branch 3587098 because drush 14.x-dev delegates to core's `dr` binary, which core added after that branch. The template already ignores that failure. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UrTUMwsuMweUxTnthbu8zQ --- drupal-core/template.tf | 58 ++++++++++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 15 deletions(-) diff --git a/drupal-core/template.tf b/drupal-core/template.tf index 1f745df..987d6f2 100644 --- a/drupal-core/template.tf +++ b/drupal-core/template.tf @@ -881,24 +881,52 @@ web_environment: TESTENV_EOF log_setup "✓ .ddev/config.zzz-coder-test-env.yaml written (SIMPLETEST_BASE_URL override)" - # Make Composer install drupal/core from the checked-out core/ directory. - # On an issue branch, Composer gives the root package core's branch - # alias (e.g. 12.x-dev), but gives the core/ path package the raw branch - # name (dev--), which doesn't match the root's - # "self.version" requirement. Composer then takes drupal/core dev-main - # from Packagist, so the branch is built against today's main - # dependencies, and an older branch can't install at all (#238). - # Declaring core/ first, with the version from its own branch alias, - # makes the local copy win. - _core_alias=$(jq -r '(.extra["branch-alias"] // {}) | to_entries | first | .value // empty' core/composer.json 2>/dev/null) - if [ -n "$_core_alias" ] && [ -f composer.local.json ]; then - if jq --arg v "$_core_alias" \ - '.repositories = ({"drupal-core-local": {"type": "path", "url": "core", "options": {"versions": {"drupal/core": $v}}}} + (.repositories // {}))' \ + # Build the checked-out branch the way core's own CI does: with its own + # core/ and composer/Plugin/* code, and the dependency versions in its + # composer.lock (#238). + # + # 1. Path packages. On an issue branch, Composer gives the root package + # core's branch alias (e.g. 12.x-dev), but gives the path packages + # the raw branch name (dev--), which doesn't match the + # root's "self.version" requirements. Composer then takes drupal/core + # and the core-* plugins from Packagist (today's main). Declaring + # every path repository from core's composer.json first, each with + # the version from its own branch alias, makes the local copies win. + # 2. pin-core-lock. The add-on's overlay re-solves everything to the + # newest allowed versions, so an older branch runs against + # dependencies it never saw (a May branch got Symfony 8.1 instead of + # its locked 8.0 and served 404 on every route). The add-on's + # extra.drupal-dev.pin-core-lock restricts packages core's lock has + # to the locked versions; packages it doesn't have (drush and its + # own dependencies) still resolve freely. It needs step 1, since + # the lock records the path packages under the branch alias. + # 3. Security blocking off. Composer refuses versions with published + # advisories, and an older lock always has some, so with pinning on + # the install has nothing to fall back to. This is a throwaway dev + # environment for testing that branch; `composer audit` still + # reports them. Both keys: policy.* is Composer >=2.11, audit.* older. + _path_repos='{}' + for _dir in $(jq -r '.repositories[]? | select(.type == "path") | .url' composer.json 2>/dev/null); do + _name=$(jq -r '.name // empty' "$_dir/composer.json" 2>/dev/null) + _alias=$(jq -r '(.extra["branch-alias"] // {}) | to_entries | first | .value // empty' "$_dir/composer.json" 2>/dev/null) + [ -n "$_name" ] && [ -n "$_alias" ] || continue + _path_repos=$(jq -c --arg n "$_name" --arg u "$_dir" --arg v "$_alias" \ + '. + {("local-" + $n): {"type": "path", "url": $u, "options": {"versions": {($n): $v}}}}' <<< "$_path_repos") + done + _pin_core_lock=false + [ -f composer.lock ] && _pin_core_lock=true + if [ "$_path_repos" != "{}" ] && [ -f composer.local.json ]; then + if jq --argjson r "$_path_repos" --argjson pin "$_pin_core_lock" \ + '.repositories = ($r + (.repositories // {})) + | if $pin then .extra["drupal-dev"]["pin-core-lock"] = true + | .config.policy.advisories.block = false + | .config.audit["block-insecure"] = false + else . end' \ composer.local.json > composer.local.json.tmp && mv composer.local.json.tmp composer.local.json; then - log_setup "✓ composer.local.json: drupal/core pinned to local core/ ($_core_alias)" + log_setup "✓ composer.local.json: core path packages pinned to the checkout ($(jq -r 'keys | map(ltrimstr("local-")) | join(", ")' <<< "$_path_repos")), pin-core-lock=$_pin_core_lock" else rm -f composer.local.json.tmp - log_setup "⚠ Could not pin drupal/core to local core/ in composer.local.json" + log_setup "⚠ Could not pin core path packages in composer.local.json" fi fi From 5977e725c7a1acbc3813166a2c62607a70b2ae8a Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 11 Nov 2026 22:39:42 +0000 Subject: [PATCH 5/5] fix(drupal-core): flush caches when drush cr fails after install, for #238 ## The Issue The "Drupal issue fork drupal-3587098 (GH)" job fails intermittently in "Drupal site externally accessible": `/` returns 404 `No route found`. The same commit passed in one run and failed in the next. The `drupal-site` app's healthcheck requests `/` every 10 seconds, including while `drush si` runs. A request during the install leaves stale caches, and `/` then returns 404 until caches are flushed. Setup runs `drush cr` afterwards, but Drush 14's `cache:rebuild` runs core's `vendor/bin/dr`, which core only has from 11.4 on. So on older branches the flush never happens. ## How This PR Solves The Issue When `ddev drush cr` fails, setup now runs `ddev drush php:eval 'drupal_flush_all_caches();'` and logs which path it took. ## Automated Testing Overview Claude Code ran `terraform fmt -recursive`, `make validate` and `make test-templates`, which all pass. On staging-coder.ddev.com, in workspaces on branch `3587098-add-support-for`, Claude Code requested `/` every 0.3 seconds while `drush si` ran. In 6 of 6 attempts `/` returned 404 afterwards, and `drush cr` failed. The new fallback restored 200 on `/` and `/user/login` in 3 of 3 attempts. With Symfony 8.1.11 instead of the locked 8.0.6, every page returned 500 even after a flush, so the lock pinning from the previous commit is still needed. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UrTUMwsuMweUxTnthbu8zQ --- drupal-core/template.tf | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drupal-core/template.tf b/drupal-core/template.tf index 987d6f2..63b5ab2 100644 --- a/drupal-core/template.tf +++ b/drupal-core/template.tf @@ -1057,9 +1057,21 @@ TESTENV_EOF # Step 6.5: Cache rebuild — ensures a clean state after any successful setup path. # Skipped when setup failed: there is no installed site to rebuild, and running it # anyway just appends a confusing "drush is not available" error to the log. + # + # The drupal-site healthcheck requests / every 10s, including while drush si + # runs. A request during the install leaves stale caches, and / then returns + # 404 "No route found" until they are flushed. Drush 14's cache:rebuild runs + # core's vendor/bin/dr, which core only has from 11.4 on, so it fails on + # older branches. Flush through Drupal's own API instead (#238). if [ "$SETUP_FAILED" != "true" ]; then log_setup "Running cache rebuild..." - ddev drush cr >> "$SETUP_LOG" 2>&1 || true + if ! ddev drush cr >> "$SETUP_LOG" 2>&1; then + if ddev drush php:eval 'drupal_flush_all_caches();' >> "$SETUP_LOG" 2>&1; then + log_setup "✓ Caches flushed with drupal_flush_all_caches() (drush cr failed)" + else + log_setup "⚠ Cache rebuild failed" + fi + fi fi # Step 6.6: Set up phpunit.xml for running core tests