Skip to content

feat(drupal-core): switch to amateescu/ddev-drupal-dev scaffolding, fixes #142#145

Merged
rfay merged 5 commits into
mainfrom
20260510_rfay_coder_amateescu_ddev-drupal-dev
May 10, 2026
Merged

feat(drupal-core): switch to amateescu/ddev-drupal-dev scaffolding, fixes #142#145
rfay merged 5 commits into
mainfrom
20260510_rfay_coder_amateescu_ddev-drupal-dev

Conversation

@rfay
Copy link
Copy Markdown
Member

@rfay rfay commented May 10, 2026

Summary

  • Replaces `joachim-n/drupal-core-development-project` (composer create-project) with a direct `git clone` of `drupal/drupal` + the `amateescu/ddev-drupal-dev` DDEV add-on
  • Eliminates ~440 lines of bash: inline-alias JSON fixups, json-schema pin, vendor symlink restoration, and branch-aware `composer update -W` are gone — the add-on's `composer.local.json` overlay keeps core's `composer.json` untouched
  • Drush is added via `ddev composer require drush/drush` into `composer.local.json`
  • Issue forks still work: `git remote add issue` + fetch + checkout before `ddev composer install`
  • Non-main branches (10.x, 11.x) work via plain `git checkout` — no composer.json fixups needed
  • Old joachim-n workspaces are detected on restart and kept as-is (with a note to recreate to migrate); docroot auto-detects old vs new scaffolding
  • `cache_path` is now optional (`default = ""`); used as a `git --reference` hint with silent fallback to a direct clone if the cache seed is missing or broken
  • Welcome message and `ddev launch` command now document `ddev add-module`, `ddev phpunit`, and link to https://github.com/amateescu/ddev-drupal-dev

Cache seed — required admin action on both servers

The cache structure has changed. The seed is now a plain git clone at the root of the seed directory (no `repos/drupal/` nesting). The startup script checks for `.git` at the seed root and uses it as a `git --reference` hint.

The old `repos/drupal/` structure is not detected — new workspaces will fall back to a direct clone (slower) until the cache is migrated.

Run these steps on each server:

SEED_DIR=~/cache/drupal-core-seed
REPO=~/workspace/coder-ddev

# 1. Stop the old DDEV seed project
cd "$SEED_DIR" && ddev stop --remove-data 2>/dev/null || true

# 2. Move the git clone to the seed root, remove everything else
mv "$SEED_DIR/repos/drupal" /tmp/drupal-git-tmp
rm -rf "$SEED_DIR"
mv /tmp/drupal-git-tmp "$SEED_DIR"

# 3. Install the updated update script and service
sudo install -m 755 $REPO/drupal-core/scripts/update-drupal-cache   /usr/local/bin/update-drupal-cache
sudo install -m 644 $REPO/drupal-core/scripts/drupal-cache-updater.service   /etc/systemd/system/
sudo systemctl daemon-reload

# 4. Verify it works
sudo systemctl start drupal-cache-updater.service
journalctl -u drupal-cache-updater.service --no-pager | tail -10

After migration, `~/cache/drupal-core-seed` is the git clone itself — `.git` at the root. The updated `update-drupal-cache` script runs `git fetch --all --prune` instead of `ddev composer update`.

Full instructions (including fresh setup for new servers) are in `docs/admin/server-setup.md` Step 10.

Closes #142

Test plan

  • `terraform fmt -recursive` passes
  • `terraform -chdir=drupal-core validate` passes
  • CI Terraform mock unit tests pass (require Terraform ≥ 1.6)
  • Create a new workspace with default parameters (Drupal 12/main) — Drupal installs and site is accessible
  • Create a workspace with an issue fork number and branch — correct branch checked out, Drupal installs
  • Create a workspace with Drupal 11 selected — 11.x branch checked out, Drupal installs
  • Restart an existing old-scaffolding workspace — detects old structure, logs warning, continues working
  • `ddev add-module token` works inside a new workspace
  • `ddev phpunit core/modules/node` works inside a new workspace
  • Run migration steps on both servers; verify `drupal-cache-updater.timer` fires and `git fetch` completes cleanly

🤖 Generated with Claude Code

Replace joachim-n/drupal-core-development-project (composer create-project)
with a direct git clone of drupal/drupal + the amateescu/ddev-drupal-dev
DDEV add-on. This eliminates ~440 lines of bash: the inline-alias JSON
fixups, json-schema pin, vendor symlink restoration, and branch-aware
composer update -W are no longer needed because the add-on's
composer.local.json overlay keeps core's composer.json untouched.

- Drupal version is now set by git branch (main/11.x/10.x), not
  by Composer constraints
- Issue forks still work: git remote add issue + fetch + checkout
- Old joachim-n workspaces are detected and kept as-is with a note
  to recreate; docroot auto-detects old vs new scaffolding
- cache_path is now optional (default = ""); cache seed is used as
  a git --reference hint with fallback to direct clone
- drush added via ddev composer require into composer.local.json
- Welcome message and ddev launch now document ddev add-module,
  ddev phpunit, and link to https://github.com/amateescu/ddev-drupal-dev

Closes #142

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rfay rfay changed the title feat(drupal-core): switch to amateescu/ddev-drupal-dev scaffolding feat(drupal-core): switch to amateescu/ddev-drupal-dev scaffolding, fixes #142 May 10, 2026
rfay and others added 4 commits May 10, 2026 11:20
With amateescu/ddev-drupal-dev, Drupal's index.php is at the project
root (not web/) and the git repo is at drupal-core/ (not repos/drupal/).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
DRUPAL_BRANCH was computed after the git clone block that used it,
causing the empty-branch condition to trigger git checkout of an empty
string. This set SETUP_FAILED=true, skipping drush si and breaking the
CI drush db-connected check.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The cache no longer needs a full DDEV project (vendor/, composer.json,
etc.). Only repos/drupal/ is needed as a git --reference hint for
faster workspace clones. update-drupal-cache now runs git fetch instead
of ddev composer update; service drops the Docker dependency and uses
a 5-minute timeout. server-setup.md Step 10 updated with new initial
setup, migration steps for existing servers, and updated troubleshooting.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The cache seed is now a plain git clone at the seed directory root.
The old repos/drupal/ nesting was pure legacy from the joachim-n
scaffolding. Template checks for $CACHE_SEED/.git; update script
and docs updated accordingly. README, quickstart, and test script
all rewritten for the amateescu/ddev-drupal-dev flow.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rfay rfay merged commit f6b889a into main May 10, 2026
20 checks passed
@rfay rfay deleted the 20260510_rfay_coder_amateescu_ddev-drupal-dev branch May 10, 2026 21:33
rfay added a commit that referenced this pull request May 10, 2026
The migration instructions copied from PR #145 were incomplete:
- Missing timer file install (drupal-cache-updater.timer)
- Missing User=YOURUSER substitution in the service file
- Missing systemctl enable --now drupal-cache-updater.timer

Without these, the hourly auto-update never runs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

Drupal core scaffolding: Consider switching implementation from to joachim-n/drupal-core-development-project to amateescu/ddev-drupal-dev

1 participant