Skip to content

fix(tests): pin symfony/deprecation-contracts to ^2.5 in Drupal 9.5 fixture - #4049

Merged
Leiyks merged 1 commit into
masterfrom
leiyks/fix-test-web-drupal-95-php74-deprecation-contracts
Jul 24, 2026
Merged

fix(tests): pin symfony/deprecation-contracts to ^2.5 in Drupal 9.5 fixture#4049
Leiyks merged 1 commit into
masterfrom
leiyks/fix-test-web-drupal-95-php74-deprecation-contracts

Conversation

@Leiyks

@Leiyks Leiyks commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

What

  • Pin symfony/deprecation-contracts to ^2.5 in the require block of
    tests/Frameworks/Drupal/Version_9_5/composer.json.

Why

test_web_drupal_95 was failing with a fatal TypeError during Drupal's
install script on PHP 7.4.

The Drupal 9.5 test fixture ships a composer.json with no accompanying
lock file, and the job installs dependencies with
composer install --ignore-platform-reqs. Without a lock file, composer's
solver is free to pick the latest compatible releases of every
transitive dependency; --ignore-platform-reqs additionally defeats the
fixture's platform.php PHP-version pin, so composer happily resolves a
dependency graph that isn't actually compatible with the PHP version the
job runs on.

Concretely, composer resolves guzzlehttp/guzzle to 7.15.1, which
requires symfony/deprecation-contracts and drifts to v3.7.1. That
version's trigger_deprecation() function declares a mixed ...$args
variadic parameter — a typehint combination only valid on PHP 8.0+.
Loading/calling it on PHP 7.4 is a fatal TypeError, which aborts
Drupal's install script and fails the job.

How

Add an explicit "symfony/deprecation-contracts": "^2.5" entry to the
fixture's require block. This constrains composer's solver to a
deprecation-contracts release whose API predates the PHP 8-only
variadic typehint, regardless of what guzzle (or any other transitive
dependency) would otherwise pull in.

…ixture

test_web_drupal_95 was crashing during Drupal's install script with a
fatal TypeError on PHP 7.4. The Drupal 9.5 composer.json has no lock
file, so `composer install --ignore-platform-reqs` resolves guzzlehttp/
guzzle to the latest 7.15.1, which pulls in symfony/deprecation-
contracts v3.7.1. That version's trigger_deprecation() signature uses
a `mixed ...$args` variadic typehint, which is only valid on PHP 8.0+
and is a fatal TypeError when the class is loaded/called on PHP 7.4.

--ignore-platform-reqs defeats platform.php's PHP version pin, so
composer happily selects a dependency graph that is incompatible with
the PHP version the job actually runs.

Pin symfony/deprecation-contracts to ^2.5 directly in the fixture's
require block so composer's solver is constrained to a version whose
API is compatible with PHP 7.4, regardless of what guzzle pulls in
transitively.
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jul 21, 2026

Copy link
Copy Markdown

Pipelines  Tests

Unblock PR with BitsAI

⚠️ Warnings

🚦 4 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-php | ASAN test_c with multiple observers: [8.3]   View in Datadog   GitLab

DataDog/apm-reliability/dd-trace-php | test_extension_ci: [7.1]   View in Datadog   GitLab

DataDog/apm-reliability/dd-trace-php | merge-gate   View in Datadog   GitLab

View all 4 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 54.08% (-0.04%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 2133b06 | Docs | Datadog PR Page | Give us feedback!

@Leiyks
Leiyks marked this pull request as ready for review July 21, 2026 12:05
@Leiyks
Leiyks requested a review from a team as a code owner July 21, 2026 12:05
@Leiyks
Leiyks merged commit 65439ac into master Jul 24, 2026
2155 of 2160 checks passed
@Leiyks
Leiyks deleted the leiyks/fix-test-web-drupal-95-php74-deprecation-contracts branch July 24, 2026 11:45
@github-actions github-actions Bot added this to the 1.24.0 milestone Jul 24, 2026
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.

2 participants