Repository navigation
fix: test the real core issue branch and install drupal/core from it, fixes #238 - #241
Merged
Merged
Conversation
PreviewsThe start.coder.ddev.com landing-page preview has been removed. Read the Docs keeps or removes its own docs preview. |
## 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
force-pushed
the
20261111_rfay_core_ci_issue_branch
branch
from
November 11, 2026 20:38
1756a49 to
6b682ca
Compare
Documentation build overview
|
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Issue
Both core issue-fork CI jobs in
drupal-integration-test.ymltook the branch from the GitLab fork'sdefault_branch. For a core issue fork this is alwaysmain, a frozen copy of core from when the fork was created. The nightly run loggedResolved: branch=main, so the jobs never tested an issue branch.Once the job tested the real branch,
composer installfailed. 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 withissue_fork=3587098,issue_branch=3587098-add-support-for,drupal_version=12:The branch's own
core/composer.jsonrequiresguzzlehttp/psr7 ^2.8. Composer gives the root package core's branch alias,12.x-dev, but gives thecore/path package the raw branch name,dev-3587098-add-support-for. So it takesdrupal/coredev-mainfrom Packagist. Every issue workspace was built against currentmain's dependencies, and a branch from before a major dependency bump could not install.Installing the branch's own
drupal/corewas not enough. The add-on'scomposer.local.jsonre-solves every dependency to the newest allowed version. Branch3587098-add-support-forlocks Symfony 8.0.6, but the workspace got Symfony 8.1.11. Drupal then served 404No route foundon/and 500 on/user/login: https://github.com/ddev/coder-ddev/actions/runs/43082118728/job/130737581910.How This PR Solves The Issue
<issue>-*branch, and fall back todefault_branch. This is the same lookup thatdrupal-contrib-integration-test.ymluses..github/workflows/drupal-integration-test.ymlamateescu/ddev-drupal-devadd-on writescomposer.local.json, add everypathrepository from core'scomposer.jsonfirst:core/and the fourcomposer/Plugin/*. Give each package the version from its ownextra.branch-alias. If the edit fails, leave the file unchanged and log a warning.drupal-core/template.tfcomposer.lock, set the add-on'sextra.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.tfconfig.policy.advisories.blockandconfig.audit.block-insecure). An older lock always has advisories, so with pinning on the install fails.composer auditstill reports them.drupal-core/template.tfddev drush crfails after the install, flush caches withdrupal_flush_all_caches(). Thedrupal-sitehealthcheck requests/duringdrush si, which leaves stale caches, and/then returns 404No route found. Drush 14'scache:rebuildneeds core'svendor/bin/dr, which core only has from 11.4 on, so on older branches the flush never happened.drupal-core/template.tfddev composer show drupal/corereportsdist : [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.ymlThe
composer.local.jsonchanges belong in the add-on. The template patch is a workaround until the add-on handles it.Manual Testing Instructions
Repeat with
drupal_version=12anddrupal_version=11and 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=12and install Drupal. Its "drupal/core installed from the checked-out branch (#238)" step must print adist : [path] coreline.Automated Testing Overview
Claude Code ran
terraform fmt -recursive,make validateandmake test-templates, which all pass. Claude Code checked the new branch lookup against git.drupalcode.org, where it returns3587098-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, plaindrupal_version=12, and plaindrupal_version=11. All three installed Drupal, served 200 on/and/user/login, and passed CI'sdist : [path] corecheck. Each installed thesymfony/routingversion in its own core lock: 8.0.6, 8.1.6 and 7.4.23.Requesting
/every 0.3 seconds duringdrush sion branch 3587098 left/at 404 in 6 of 6 attempts. Thedrupal_flush_all_caches()fallback restored 200 on/and/user/loginin 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