Skip to content

fix(drupal-core): guard against PHP-incompatible issue branches (#217) - #219

Draft
rfay wants to merge 1 commit into
mainfrom
20260927_rfay_fix_php_version_mismatch
Draft

rfay wants to merge 1 commit into
mainfrom
20260927_rfay_fix_php_version_mismatch

Conversation

@rfay

@rfay rfay commented Sep 27, 2026

Copy link
Copy Markdown
Member

Summary

  • Fixes No linked GitHub account — using anonymous Composer downloads and then composer fails #217: an issue-fork branch based on a newer Drupal core than the workspace's drupal_version (e.g. a main/12.x branch checked out into a drupal_version=11 workspace, which configures PHP 8.4) made composer install fail in generateMetapackages with Class "Drupal" not found. That first failure poisons composer.local.lock, so all 3 retries then failed identically in 1-2s each, hiding the real cause.
  • Root cause confirmed live on the reporter's actual workspace: branch requires PHP >=8.5.0, workspace was configured for PHP 8.4.
  • Adds a guard in drupal-core/template.tf that, after checkout and DDEV configuration, reads the checked-out branch's core/composer.json PHP requirement and compares it against the DDEV-configured PHP version. On a mismatch it fails fast with a clear message (naming the required vs. configured PHP versions) instead of burning the composer retry loop.

Note: this should probably not be pulled/merged until after DrupalCon Rotterdam, to avoid template churn during the conference. Opening as draft for visibility in the meantime.

Test plan

  • terraform fmt -recursive
  • make validate
  • make test-templates (41 tests, no regressions)
  • Manually verified the guard's jq/awk extraction against the real broken workspace's files (8.5 required vs 8.4 configured → correctly flagged)

🤖 Generated with Claude Code

…#217

An issue-fork branch can target a newer Drupal core than the workspace's
drupal_version parameter (e.g. a "main"/12.x branch checked out into a
drupal_version=11 workspace, which configures PHP 8.4). Composer then
fails in generateMetapackages, poisons composer.local.lock, and all 3
retries fail identically in 1-2s each without surfacing the real cause.

Read the checked-out branch's core/composer.json PHP requirement and
compare it to the DDEV-configured PHP version before running composer,
failing fast with a clear message instead of burning the retry loop.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://ddev.github.io/coder-ddev/pr-preview/pr-219/

Built to branch gh-pages at 2026-09-27 13:02 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

This branch has not been deployed

No deployments
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.

No linked GitHub account — using anonymous Composer downloads and then composer fails

1 participant