Skip to content

fix: test the real core issue branch and install drupal/core from it, fixes #238 - #241

Merged
rfay merged 5 commits into
mainfrom
20261111_rfay_core_ci_issue_branch
Nov 11, 2026
Merged

rfay merged 5 commits into
mainfrom
20261111_rfay_core_ci_issue_branch

Conversation

@rfay

@rfay rfay commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

The Issue

Both core issue-fork CI 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.

Once the job tested the real branch, composer install failed. The first run of this PR shows it: https://github.com/ddev/coder-ddev/actions/runs/43060286609/job/130702950256. Users hit the same failure on coder.ddev.com with issue_fork=3587098, issue_branch=3587098-add-support-for, drupal_version=12:

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. Composer gives the root package core's branch alias, 12.x-dev, but gives the core/ path package the raw branch name, dev-3587098-add-support-for. So it takes drupal/core dev-main from Packagist. Every issue workspace was built against current main's dependencies, and a branch from before a major dependency bump could not install.

Installing the branch's own drupal/core was not enough. The add-on's composer.local.json re-solves every dependency to the newest allowed version. Branch 3587098-add-support-for locks Symfony 8.0.6, but the workspace got Symfony 8.1.11. Drupal then served 404 No route found on / and 500 on /user/login: https://github.com/ddev/coder-ddev/actions/runs/43082118728/job/130737581910.

How This PR Solves The Issue

Change File
Pick the most recently committed <issue>-* branch, and fall back to default_branch. This is the same lookup that drupal-contrib-integration-test.yml uses. .github/workflows/drupal-integration-test.yml
After the amateescu/ddev-drupal-dev add-on writes composer.local.json, add every path repository from core's composer.json first: core/ and the four composer/Plugin/*. Give each package the version from its own extra.branch-alias. If the edit fails, leave the file unchanged and log a warning. drupal-core/template.tf
When core has a composer.lock, set the add-on's extra.drupal-dev.pin-core-lock. It limits packages in core's lock to the locked versions. Drush and its own dependencies still resolve freely. Pinning needs the path packages above, because the lock records them under the branch alias. drupal-core/template.tf
Turn off Composer's security-advisory blocking (config.policy.advisories.block and config.audit.block-insecure). An older lock always has advisories, so with pinning on the install fails. composer audit still reports them. drupal-core/template.tf
When ddev drush cr fails after the install, flush caches with drupal_flush_all_caches(). The drupal-site healthcheck requests / during drush si, which leaves stale caches, and / then returns 404 No route found. Drush 14's cache:rebuild needs core's vendor/bin/dr, which core only has from 11.4 on, so on older branches the flush never happened. drupal-core/template.tf
Add a CI step that fails unless ddev composer show drupal/core reports dist : [path] core. A recent issue branch installs even with the bug, so checking that the install succeeded is not enough. .github/workflows/drupal-integration-test.yml

The composer.local.json changes belong in the add-on. The template patch is a workaround until the add-on handles it.

Manual Testing Instructions

coder create <ws> --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 <ws> | grep -E 'core path packages pinned|Composer install|Drupal installed'
# Expect: "pin-core-lock=true", "Composer install complete", "Drupal installed"
ssh <ws>.coder 'cd drupal-core && ddev exec "composer show drupal/core" | grep -E "^(dist|path)"'
# Expect: dist : [path] core
ssh <ws>.coder 'curl -s -o /dev/null -w "%{http_code}\n" http://127.0.0.1/'
# Expect: 200
ssh <ws>.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.

In this PR's CI, the "Drupal issue fork drupal-3587098 (GH)" job must print Resolved: branch=3587098-add-support-for drupal_version=12 and install Drupal. Its "drupal/core installed from the checked-out branch (#238)" step must print a dist : [path] core line.

Automated Testing Overview

Claude Code ran terraform fmt -recursive, make validate and make test-templates, which all pass. Claude Code checked the new branch lookup against git.drupalcode.org, where it returns 3587098-add-support-for. On staging-coder.ddev.com, Claude Code pushed this branch's template as an inactive version. It 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.

Requesting / every 0.3 seconds during drush si on branch 3587098 left / at 404 in 6 of 6 attempts. The drupal_flush_all_caches() fallback restored 200 on / and /user/login in 3 of 3. With Symfony 8.1.11 instead of the locked 8.0.6, every page returned 500 even after a flush, so the lock pinning is still needed.

Release/Deployment Notes

The drupal-core template change takes effect on the next make push-template-drupal-core.

https://claude.ai/code/session_01UrTUMwsuMweUxTnthbu8zQ


Generated by Claude Code

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Previews

The start.coder.ddev.com landing-page preview has been removed. Read the Docs keeps or removes its own docs preview.

@rfay rfay changed the title ci: test the core issue branch, not the fork's main, fixes #238 fix: test the real core issue branch and install drupal/core from it, fixes #238 Nov 11, 2026
rfay and others added 4 commits November 11, 2026 13:38
## 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 `<issue>-*`, 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 <noreply@anthropic.com>
…#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 <ws> --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 <ws> | 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 <ws>.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 <noreply@anthropic.com>
## 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 <sha>` 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 <noreply@anthropic.com>


## 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 <ws> --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 <ws> | grep -E 'core path packages pinned|Composer install|Drupal installed'
# Expect: "pin-core-lock=true", "Composer install complete", "Drupal installed"
ssh <ws>.coder 'cd drupal-core && curl -s -o /dev/null -w "%{http_code}\n" http://127.0.0.1/'
# Expect: 200
ssh <ws>.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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UrTUMwsuMweUxTnthbu8zQ
@rfay
rfay force-pushed the 20261111_rfay_core_ci_issue_branch branch from 1756a49 to 6b682ca Compare November 11, 2026 20:38
@read-the-docs-community

read-the-docs-community Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 coder-ddev | 🛠️ Build #35824749 | 📁 Comparing 5977e72 against latest (44a1dd2)

  🔍 Preview build  

1 file changed
± workspaces/ai-tools/index.html

@rfay rfay closed this Nov 11, 2026
@rfay rfay reopened this Nov 11, 2026
…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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UrTUMwsuMweUxTnthbu8zQ
@rfay
rfay merged commit 25a1676 into main Nov 11, 2026
21 checks passed
@rfay
rfay deleted the 20261111_rfay_core_ci_issue_branch branch November 11, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Core issue-fork CI jobs test the fork's main, not the issue branch

2 participants