Repository navigation
Commit 6b682ca
fix(drupal-core): build issue branches against core's own lock, for #238
## 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_01UrTUMwsuMweUxTnthbu8zQ1 parent 047be5c commit 6b682ca
1 file changed
Lines changed: 43 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
881 | 881 | | |
882 | 882 | | |
883 | 883 | | |
884 | | - | |
885 | | - | |
886 | | - | |
887 | | - | |
888 | | - | |
889 | | - | |
890 | | - | |
891 | | - | |
892 | | - | |
893 | | - | |
894 | | - | |
895 | | - | |
896 | | - | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
897 | 925 | | |
898 | | - | |
| 926 | + | |
899 | 927 | | |
900 | 928 | | |
901 | | - | |
| 929 | + | |
902 | 930 | | |
903 | 931 | | |
904 | 932 | | |
| |||
0 commit comments