Summary

CI pipeline has three independent failures across three separate jobs:

  • PHPStan Analysis (PHP 8.3, current stack) — 5 static analysis errors.
  • PHPStan Analysis (next major) (PHP 8.5, Drupal 12.0-dev stack) — 3 static analysis errors, a subset of #1.
  • phpunit (next major) (PHP 8.5, Drupal 12.0-dev) — functional tests pass, but the job fails because deprecation warnings are treated as errors.

These are independent problems in independent jobs; fixes below cover all three.


1. PHPStan errors

1a. PHPStan Analysis (PHP 8.3, current stack) — 5 errors

src/Plugin/Field/FieldFormatter/IpAddressPostgreSqlFormatter.php:41
src/Plugin/Field/FieldWidget/IpAddressPostgreSqlWidget.php:37

  • dependencySerializationTraitProperty.unsupportedPrivateProperty
  • dependencySerializationTraitProperty.unsupportedReadOnlyProperty

DependencySerializationTrait (used by the parent base class) does not support private or readonly promoted constructor properties. The readonly restriction only applies on PHP < 8.4, which is why it doesn't appear in the PHP 8.5 job below.

tests/src/Functional/IpAddressFieldTestBase.php:14

nonAbstractTestClass.NameNoSuffixTest — base test class is missing the abstract modifier.

1b. PHPStan Analysis (next major) (PHP 8.5) — 3 errors

Same underlying issues, minus the PHP-version-specific readonly check:

  • IpAddressPostgreSqlFormatter.php:41 — unsupportedPrivateProperty
  • IpAddressPostgreSqlWidget.php:37 — unsupportedPrivateProperty
  • IpAddressFieldTestBase.php:14 — nonAbstractTestClass.NameNoSuffixTest

Fix (covers both jobs)

  • [ ] In IpAddressPostgreSqlFormatter and IpAddressPostgreSqlWidget: change the injected service property from private readonly to protected (or add use DependencySerializationTrait; directly in the class if readonly must be kept).
  • [ ] In IpAddressFieldTestBase: add the abstract modifier to the class declaration.

One fix per file resolves the corresponding errors in both the PHP 8.3 and PHP 8.5 jobs. Do not commit a phpstan-baseline.neon as a workaround — these are three small, legitimate fixes, not legacy debt to suppress.


2. Next-major (Drupal 12) deprecations — phpunit (next major) job

Runs against PHP 8.5 / Drupal 12.0-dev (main-dev branch) with deprecations treated as failures. All 13 + 11 test datasets pass functionally (OK, but there were issues!), but the following module-owned deprecations need fixing before Drupal 12 ships (week of Dec 7, 2026):

  • [ ] field_ipaddress_pgsql_requirements() needs #[LegacyRequirementsHook] attribute (.module file)
  • [ ] @FieldType annotation → #[FieldType] attribute for ipaddress_pgsql and ipaddress_mysql field item classes
  • [ ] @FieldWidget annotation → #[FieldWidget] attribute for ipaddress_pgsql and ipaddress_mysql widgets
  • [ ] @FieldFormatter annotation → #[FieldFormatter] attribute for ipaddress_pgsql and ipaddress_mysql formatters
  • [ ] @Constraint annotation → #[Constraint] attribute for PostgreSqlFormat and MySqlFormat constraint plugins
  • [ ] ConstraintValidator::initialize() deprecated — migrate PostgreSqlFormatValidator / MySqlFormatValidator to validateInContext()

Note: these deprecation messages reference removal in "drupal:13.0.0" — this is expected. Drupal core policy deferred actual removal of several 11.3-deprecated APIs from 12.0 to 13.0 for a smoother upgrade path, but the deprecation notices already fire on 12.0-dev.

Remaining deprecations in the log (cache.backend.memory, cache.static, Symfony DI tagged locators, SYMFONY_DEPRECATIONS_HELPER) are Drupal core/vendor-owned and out of scope for this module.

Acceptance criteria

  • [ ] PHPStan Analysis job passes with 0 errors, no baseline committed
  • [ ] PHPStan Analysis (next major) job passes with 0 errors
  • [ ] phpunit (next major) job passes (or at minimum triggers 0 module-owned deprecations)
  • [ ] Standard phpunit job continues to pass

Comments

wombatbuddy created an issue. See original summary.

wombatbuddy’s picture

Status: Active » Fixed

Looked at the failing GitLab CI job. This doesn't look like a bug in the module.

Both test classes actually pass 100% of assertions (13/13 and 11/11). The job is marked as failed only because PHPUnit reports "OK, but there were issues!" due to 9 triggered deprecation notices, and Drupal's test runner treats any deprecation as a job failure regardless of whether the assertions passed.

All 9 deprecations trace back to Drupal core / Symfony vendor code (DependencyInjection Container, cache.backend.memory, cache.static, ConstraintValidator::initialize(), TestHttpClientMiddleware) — none of them point to any file in this module's src/ tree.

The pipeline runs against DRUPAL_CORE: main-dev (12.0-dev), which is currently mid-migration toward several new internal APIs and produces this deprecation noise for any module tested against it right now.

Suggested fix is CI config, not module code: either pin the required job to a stable core version the module declares support for (e.g. 11.3.x), or mark the main-dev job as allow_failure: true so nightly-core deprecations don't block the pipeline.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

wombatbuddy’s picture

Status: Fixed » Closed (fixed)