feat: #3637010 Make the module compatible with Drupal 12

Closes https://www.drupal.org/project/earkiv/issues/3637010

One commit per step. The module now requires Drupal ^11.2 || ^12.

Commits

  1. Attributes for the archiver and storage plugins. New Drupal\earkiv\Attribute\Archiver and Storage; the HTTrack archiver and the local storage use them. The plugin managers get both the attribute and the annotation class, so annotated plugins in other modules keep working.
  2. Runtime requirements hook and severity enum. #[Hook('runtime_requirements')] in Hooks replaces earkiv_requirements(); the plugins use RequirementSeverity. Both need Drupal 11.2.
  3. Version requirements. core_version_requirement: ^11.2 || ^12, drush/drush: ^13 || ^14 (Drush 13 conflicts with Drupal 12).
  4. Attributes for the entity types. #[ContentEntityType] on Archive and Schedule; the unused fieldable key is dropped. Found by the kernel test, which reported the annotation deprecation.
  5. Kernel test (EArkivTest, #[RunTestsInSeparateProcesses]): plugin discovery from the attributes, default configuration, runtime requirements with RequirementSeverity, and removal of the schedule links when a job is deleted.
  6. CI versions: OPT_IN_TEST_PREVIOUS_MINOR, OPT_IN_TEST_NEXT_MAJOR, and own Composer and PHPUnit jobs against Drupal 11.2.14, the lowest supported version, which the template does not test.
  7. Required validation: _ALL_VALIDATE_ALLOW_FAILURE: '0'.

Testing (locally on Drupal 11.4)

  • Kernel test: 4 tests, 40 assertions; the only deprecation comes from Drush.
  • phpstan with the gitlab_templates configuration and phpcs: no findings. No entity definition updates needed.
  • Plugins discovered with their labels; the status report shows the HTTrack requirement; the archive and schedule lists, forms, settings, status report and help page work; a job runs end to end.

Drupal 11.2, 11.3 and 12 are only tested by this pipeline. The Drupal 12 jobs may fail in Composer until Drush 14 is released.

AI-Generated: Yes (Used Claude Code to make the changes, write the test and write this merge request.)

Merge request reports

Loading
Loading