Problem/Motivation

Create a new release based on the 3.x branch to support Drupal 12.
Drop core versions below 10.3 to introduce core API changes.

Steps to reproduce

Proposed resolution

Create the development branch 3.1.x, as compatibility for older core versions is being dropped.

Among some of the expected changes:

  • Update module's core version requirement to: core_version_requirement: ^10.3 || 11 || ^12
  • Move all .module file's hooks to a Hook class with PHP attributes
  • Remove Kernel migrate drupal tests, see: https://www.drupal.org/node/3576115
  • Add types to all function signatures and declare strict types
  • Normalize composer.json file
  • Any other changes

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dydave created an issue. See original summary.

dydave’s picture

Version: 3.0.x-dev » 3.1.x-dev

Created new branch and release 3.1.x:
https://www.drupal.org/project/block_class/releases/3.1.x-dev

so the compatibility changes could be applied.

  • dydave committed a5b53f32 on 3.1.x
    Issue #3590369 by dydave: Added support for Drupal 12 and dropped...
dydave’s picture

Issue summary: View changes
Status: Active » Fixed

Quick follow-up on this issue:

While working on this issue and the code changes, issue #3594758: Automated Drupal 12 compatibility fixes for block_class 3.1.x-dev was created with MR !80 in which I saw the Backwards-compatible Hook implementation for Drupal versions from 10.1 to 11.0, with the services.yml, .module changes and Hook class, allowing to support versions above 10.1.
Since down the road we would like to support schema validation as well, I thought we could probably aim at dropping support below 10.3 and updated the issue summary.

Another problem encountered was with the drupal migrate Kernel tests:
The Migrate Drupal module is deprecated and removed in D12.
Therefore, to be able to still provide support for drupal migrate tests on D11, the Kernel tests had to be conditionally skipped for D12.
The solution to conditionally use an abstract class to skip the Kernel tests for D12 was generated with AI.

Then, a PHPSTAN Neon file inspired from:
https://git.drupalcode.org/project/upgrade_status/-/blob/5.x/phpstan.neon
had to be added to exclude validation for file: tests/src/Kernel/BlockClassMigrationTest.php.

In other words: Drupal migrate Kernel tests are marked as deprecated, to be dropped when support for D11 is dropped.
Maintenance only for these tests, validation is no longer necessary.

Lastly, disabled temporarily the phpstan validation job for previous major (10.6.x): maintenance only:
PHPUNIT Kernel and Functional tests still work, but phpstan validation is no longer necessary.
Solution: #3482464-40: Backport Hook and LegacyHook Attribute.

Created initial merge request MR !81 above at #3 with all the changes described in the issue summary.
Since all the jobs and tests were passing 🟢 and everything worked fine when testing locally, I went ahead and merged the changes above at #4.

To summarize:

  • Module now supports 10.3 up to 12
  • Migrate Drupal tests run for 10 and 11, but not for 12.
  • Migrate Drupal tests are not validated with phpstan anymore
  • Previous major phpstan is not validated anymore.

These points will be added to the next 3.1.0 release page.

At this point, since all the work to be carried in this issue should now have been completed, marking it as Fixed for now.

Feel free to let us know if you have any questions or concerns on any of the recent code changes or this ticket in general, we would surely be glad to help.
Thanks in advance for your testing feedback! 😊

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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.