Task #3626937: Enable GitLab CI and add a CHANGELOG.md

Closes #3626937

Changes

GitLab CI and CHANGELOG

  • .gitlab-ci.yml: standard Drupal Association GitLab Templates, with these variables:
    • OPT_IN_TEST_NEXT_MAJOR: '1' adds a Drupal 12 (main-dev) variant, started manually from the pipeline page.
    • _LENIENT_ALLOW_LIST: 'entity,leaflet' lets that variant install Entity API and Leaflet, which do not declare ^12 yet.
    • _ALL_VALIDATE_ALLOW_FAILURE: '0' makes PHPCS, PHPStan, ESLint, stylelint and cspell fail the pipeline, so new findings block a merge request.
    • _CSPELL_IGNORE_PATHS: 'LICENSE': the templates only skip license files that have an extension.
  • composer.json: declares drupal/entity, drupal/geofield and drupal/leaflet. Without it, the CI composer step does not install the contrib dependencies from the info file.
  • CHANGELOG.md: Keep a Changelog format, with entries for 1.0.0-alpha1 to 1.0.0-alpha3 reconstructed from the git history, and an Unreleased section.

Fixes found by the first pipeline

The first pipeline failed with 4 PHPUnit errors. Neither cause showed up locally, because the local test database is PostgreSQL and the local site runs at the web root.

  • 64-bit IDs on MySQL. Core builds the entity_id/revision_id columns of dedicated field tables, and the target_id column of entity reference fields, as 32-bit integers regardless of the referenced ID field's size: big. Mapillary IDs are 15-17 digits, so on MySQL saving field values of real Mapillary entities failed with Numeric value out of range. This is a production bug for every MySQL/MariaDB site, not just a test failure.
    • New MapillaryStorageSchema storage schema handler on all five Mapillary content entity types widens those columns to 64-bit. target_id is widened only when the target has a 64-bit ID, so camera_type (taxonomy terms) stays 32-bit.
    • Update hooks mapillary_entity_update_11107, mapillary_detection_update_11102, mapillary_map_feature_update_11102 and mapillary_organization_update_11103 widen existing tables and sync the stored field schema data and entity type definition.
    • New kernel test DedicatedIdColumnsTest covers a fresh install and the update path.
  • SecurityTokenExposureTest: CI serves the site from a subdirectory, where drupalGet('/') builds the malformed URI base://. It now uses drupalGet('<front>').

Validation clean-up

All findings of the validation jobs are fixed: PHPCS 30 errors and 6 warnings, ESLint 60 problems, cspell 186 issues.

  • PHPCS (Drupal standard): doc comments, line lengths, member variable docs, a doc comment attached to the wrong function in mapillary_field.install, and an unused use statement. mapillary_entity_install() and mapillary_entity_uninstall() move from mapillary_entity.module to mapillary_entity.install.
  • ESLint: prettier formatting, and a /* global L */ directive for the Leaflet global. It also surfaced two real bugs:
    • mapillary-viewer.js used an undefined NULL instead of null, a ReferenceError whenever the behavior context has no querySelector().
    • The mapillary_field/mapillary_viewer library had an empty dependencies key; it now declares core/drupal and core/drupalSettings.
  • cspell: domain words (geofield, pano, latlng, ...) go in .cspell-project-words.txt, test fixture IDs use a file-level cspell:ignore, and misspellings are corrected.

Pipeline behaviour

  • PHPUnit runs automatically on the current stable core (11.4.x) for every push and MR.
  • All validation jobs must pass.
  • A comment in .gitlab-ci.yml records what to revisit once Drupal 12 is stable. At that point the templates move the current variant to 12 and next major to 13, so Drupal 11 would need OPT_IN_TEST_PREVIOUS_MAJOR.

Testing

  • The MySQL failure reproduces locally without the fix.
  • With all changes, the full suite passes on MySQL 8.0 via run-tests.sh (57 test classes).
  • On PostgreSQL, all kernel and unit tests pass (39 files).
  • PHPCS, PHPStan, ESLint, stylelint and cspell pass locally with the same configuration and tools as the templates.
  • Update hooks were run on a PostgreSQL site holding 52,039 detections: no pending entity updates remain, and IDs up to 28028610433389099 load correctly.
  • composer validate --strict passes.
Edited by Orkut Murat Yılmaz

Merge request reports

Loading
Loading