Skip to content

drupal-contrib D12: core/tests missing because dev-branch dist zip strips it via .gitattributes export-ignore #216

Description

@rfay

Summary

drupal-contrib's D12 cell (drupal_version=12) installs drupal/core from the 12.x-dev branch (there's no stable D12 tag yet — see #212). Composer's default prefer-dist install for a -dev/branch version fetches a GitHub zipball (https://api.github.com/repos/drupal/core/zipball/<sha>), which is a git archive snapshot. git archive honors .gitattributes export-ignore rules, and drupal/core's own .gitattributes marks /tests (and other dev-only paths) export-ignore — so the dist zip silently omits core/tests entirely.

Any test that references core directly — including ddev phpunit web/core/modules/system/tests/src/Functional/System/PageTitleTest.php, the project-agnostic smoke test added to CI in #215 — fails with:

Cannot open bootstrap script "/var/www/html/web/core/tests/bootstrap.php"

CI run: https://github.com/ddev/coder-ddev/actions/runs/36280470996/job/108511195288 (Contrib skipto D12 (plain, GH)).

D10/D11 are unaffected — they resolve to real tagged releases, whose composer dist packages already include core/tests (drupal.org's release packaging isn't a plain git archive).

Root cause, verified

  • vendor/composer/installed.json showed drupal/core's dist.url was a GitHub zipball, source.type was git.
  • A plain git clone https://github.com/drupal/core.git (same ref) does include tests/ — confirming export-ignore is the mechanism, not a genuinely trimmed upstream branch.
  • Forcing composer config preferred-install.drupal/core source before ddev poser runs (so Composer does a real git clone instead of downloading the zipball) resolves it: verified core/tests present and ddev phpunit --filter testTitle web/core/modules/system/tests/src/Functional/System/PageTitleTest.php passes.

Fix

Since this was found by (and blocks CI on) #215, the fix — set composer config preferred-install.drupal/core source only when drupal_version=12, in drupal-contrib/template.tf's Phase 5 composer.json setup — is included as an additional commit on that PR rather than a separate one, to keep its new CI coverage green. Filing this issue for traceability and in case the same class of problem needs to be considered again (e.g. if drupal-core's own D12 handling — it doesn't currently support an unreleased major the way drupal-contrib does — ever needs the same treatment).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions