Skip to content
Snippets Groups Projects
Verified Commit 566b7d32 authored by Dave Long's avatar Dave Long
Browse files

Issue #3422641 by Wim Leers, longwave, smustgrave, fjgarlin: Add a...

Issue #3422641 by Wim Leers, longwave, smustgrave, fjgarlin: Add a "Validatable config" tests job to GitLab CI to help core evolve towards 100% validatability
parent 4586e9fc
No related branches found
No related tags found
29 merge requests!11131[10.4.x-only-DO-NOT-MERGE]: Issue ##2842525 Ajax attached to Views exposed filter form does not trigger callbacks,!9470[10.3.x-only-DO-NOT-MERGE]: #3331771 Fix file_get_contents(): Passing null to parameter,!8540Issue #3457061: Bootstrap Modal dialog Not closing after 10.3.0 Update,!8528Issue #3456871 by Tim Bozeman: Support NULL services,!8373Issue #3427374 by danflanagan8, Vighneshh: taxonomy_tid ViewsArgumentDefault...,!7526Expose roles in response,!7352Draft: Resolve #3203489 "Set filename as",!3878Removed unused condition head title for views,!3818Issue #2140179: $entity->original gets stale between updates,!3742Issue #3328429: Create item list field formatter for displaying ordered and unordered lists,!3731Claro: role=button on status report items,!3651Issue #3347736: Create new SDC component for Olivero (header-search),!3531Issue #3336994: StringFormatter always displays links to entity even if the user in context does not have access,!3355Issue #3209129: Scrolling problems when adding a block via layout builder,!3154Fixes #2987987 - CSRF token validation broken on routes with optional parameters.,!3133core/modules/system/css/components/hidden.module.css,!2964Issue #2865710 : Dependencies from only one instance of a widget are used in display modes,!2812Issue #3312049: [Followup] Fix Drupal.Commenting.FunctionComment.MissingReturnType returns for NULL,!2794Issue #3100732: Allow specifying `meta` data on JSON:API objects,!2378Issue #2875033: Optimize joins and table selection in SQL entity query implementation,!2062Issue #3246454: Add weekly granularity to views date sort,!1105Issue #3025039: New non translatable field on translatable content throws error,!1073issue #3191727: Focus states on mobile second level navigation items fixed,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!877Issue #2708101: Default value for link text is not saved,!617Issue #3043725: Provide a Entity Handler for user cancelation,!579Issue #2230909: Simple decimals fail to pass validation,!560Move callback classRemove outside of the loop,!555Issue #3202493
Pipeline #118178 passed with warnings
Pipeline: drupal

#118181

    # cspell:ignore codequality Micheh micheh webide
    # cspell:ignore codequality Micheh micheh webide updatedb
    ################
    # Drupal GitLabCI template.
    ......@@ -410,3 +410,60 @@ default:
    echo "HEAD is $(git rev-parse HEAD). \$CI_MERGE_REQUEST_DIFF_BASE_SHA is ${CI_MERGE_REQUEST_DIFF_BASE_SHA}";
    fi;
    - git diff ${CI_MERGE_REQUEST_TARGET_BRANCH_SHA:-$CI_MERGE_REQUEST_DIFF_BASE_SHA} --name-only | sed "s_^_../_" | yarn --cwd=./core run -s spellcheck:core --no-must-find-files --file-list stdin
    '📔 Validatable config':
    <<: [ *default-job-settings-lint ]
    stage: 🪄 Lint
    variables:
    KUBERNETES_CPU_REQUEST: "2"
    # Run on MRs if config schema files have changed, or manually.
    rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
    changes:
    - "**/config/schema/*.schema.yml"
    # Modules may alter config schema using hook_config_schema_info_alter().
    - "**/*.module"
    - when: manual
    allow_failure: true
    artifacts:
    expire_in: 1 week
    expose_as: 'validatable-config'
    paths:
    - HEAD.json
    - MR.json
    # This job must pass, but must also not disrupt Drupal core's CI if dependencies are not core-compatible.
    allow_failure:
    exit_codes:
    # `composer require …` fails (implies no version available compatible with Drupal core)
    - 100
    # `drush pm:install config_inspector …` fails (implies failure during module installation)
    - 101
    script:
    # Revert back to the tip of the branch this MR started from.
    - git checkout -f $CI_MERGE_REQUEST_DIFF_BASE_SHA
    # Composer-install Drush & the Config Inspector module.
    - composer require drush/drush drupal/config_inspector || exit 100
    # Install Drupal's Standard install profile + all core modules + the config inspector module.
    - php core/scripts/drupal install standard
    - ls core/modules | xargs vendor/bin/drush pm:install --yes
    - vendor/bin/drush pm:install config_inspector --yes --quiet || exit 101
    # Compute statistics for coverage of validatable config for HEAD.
    - vendor/bin/drush config:inspect --statistics > HEAD.json
    # Return to the MR commit being tested, conditionally install updates, always rebuild the container.
    - git checkout -f $CI_COMMIT_SHA
    - git diff $CI_MERGE_REQUEST_DIFF_BASE_SHA $CI_COMMIT_SHA --name-only | grep -q '.install$\|.post_update\.php$' && echo '🤖 Installing DB updates…' && vendor/bin/drush updatedb --yes --quiet
    - vendor/bin/drush cr --quiet
    # Compute statistics for coverage of validatable config for MR.
    - vendor/bin/drush config:inspect --statistics > MR.json
    # Output diff, but never fail the job.
    - diff -u HEAD.json MR.json || true
    # Determine if this increased or decreased coverage. Fail the job if it is worse. All the
    # percentages must be equal or higher, with the exception of `typesInUse`.
    - |
    php -r '
    $head = json_decode(file_get_contents("HEAD.json"), TRUE)["assessment"];
    $mr = json_decode(file_get_contents("MR.json"), TRUE)["assessment"];
    unset($head["_description"], $head["typesInUse"], $mr["_description"], $mr["typesInUse"]);
    $impact = array_map(fn (float $h, float $m) => $m-$h, $head, $mr);
    exit((int) (min($impact) < 0));
    '
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment