Skip to content
Snippets Groups Projects
Commit fc3acea2 authored by Kalle Kipinä's avatar Kalle Kipinä
Browse files

Issue #3481130 by kekkis: Setup GitLab CI pipelines for phpcs, phpstan,...

Issue #3481130 by kekkis: Setup GitLab CI pipelines for phpcs, phpstan, eslint, composer validations
parent 7879eae0
Branches 2.0.x
No related tags found
1 merge request!4Resolve #3481130 "Setup gitlab ci"
Pipeline #311974 passed
datasource
################
# DrupalCI GitLabCI template
#
# Gitlab-ci.yml to replicate DrupalCI testing for Contrib
#
# With thanks to:
# * The GitLab Acceleration Initiative participants
# * DrupalSpoons
################
################
# Guidelines
#
# This template is designed to give any Contrib maintainer everything they need to test, without requiring modification. It is also designed to keep up to date with Core Development automatically through the use of include files that can be centrally maintained.
#
# However, you can modify this template if you have additional needs for your project.
################
################
# Includes
#
# Additional configuration can be provided through includes.
# One advantage of include files is that if they are updated upstream, the changes affect all pipelines using that include.
#
# Includes can be overridden by re-declaring anything provided in an include, here in gitlab-ci.yml
# https://docs.gitlab.com/ee/ci/yaml/includes.html#override-included-configuration-values
################
include:
################
# DrupalCI includes:
# As long as you include this, any future includes added by the Drupal Association will be accessible to your pipelines automatically.
# View these include files at https://git.drupalcode.org/project/gitlab_templates/
################
- project: $_GITLAB_TEMPLATES_REPO
# "ref" value can be:
# - Recommended (default) - `ref: $_GITLAB_TEMPLATES_REF` - The Drupal Association will update this value to the recommended tag for contrib.
# - Latest - `ref: main` - Get the latest additions and bug fixes as they are merged into the templates.
# - Minor or Major latests - `ref: 1.x-latest` or `ref: 1.0.x-latest` - Get the latest additions within a minor (mostly bugfixes) or major (bugs and new features).
# - Fixed tag - `ref: 1.0.1` - Set the value to a known tag. This will not get any updates.
ref: $_GITLAB_TEMPLATES_REF
file:
- '/includes/include.drupalci.main.yml'
# EXPERIMENTAL: For Drupal 7, remove the above line and uncomment the below.
# - '/includes/include.drupalci.main-d7.yml'
- '/includes/include.drupalci.variables.yml'
- '/includes/include.drupalci.workflows.yml'
################
# Pipeline configuration variables
#
# These are the variables provided to the Run Pipeline form that a user may want to override.
#
# Docs at https://git.drupalcode.org/project/gitlab_templates/-/blob/main/includes/include.drupalci.variables.yml
################
# variables:
# SKIP_ESLINT: '1'
{
"name": "drupal/search_api_mapping",
"description": "Allows to create static value mappings for index fields.",
"type": "drupal-module",
"homepage": "https://www.drupal.org/project/search_api_mapping",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "Kalle Kipinä (kekkis)",
"homepage": "https://www.drupal.org/u/kekkis",
"role": "Maintainer"
},
{
"name": "Other contributors",
"homepage": "https://www.drupal.org/node/2925951/committers",
"role": "Contributor"
}
],
"support": {
"issues": "https://www.drupal.org/project/issues/search_api_mapping",
"source": "http://git.drupal.org/project/search_api_mapping.git"
},
"require": {
"drupal/search_api": "~1.23"
}
}
# Configuration file for PHPStan static code checking.
# @see: https://git.drupalcode.org/project/drupal/-/blob/10.0.x/core/phpstan.neon.dist
parameters:
level: 1
......@@ -3,3 +3,5 @@ name: 'Search API Value Mapping'
description: 'Provides an Search API field to map source values to custom target values.'
package: search
core_version_requirement: ^8 || ^9 || ^10 || ^11
dependencies:
- search_api:search_api
......@@ -5,9 +5,9 @@ namespace Drupal\search_api_mapping\Plugin\search_api\processor;
use Drupal\search_api\Datasource\DatasourceInterface;
use Drupal\search_api\Item\FieldInterface;
use Drupal\search_api\Item\ItemInterface;
use Drupal\search_api_mapping\Plugin\search_api\processor\Property\MappedFieldProperty;
use Drupal\search_api\Processor\ProcessorPluginBase;
use Drupal\search_api\Utility\Utility;
use Drupal\search_api_mapping\Plugin\search_api\processor\Property\MappedFieldProperty;
/**
* Adds customized mapping of existing fields to the index.
......@@ -30,7 +30,7 @@ class MappedField extends ProcessorPluginBase {
/**
* {@inheritdoc}
*/
public function getPropertyDefinitions(DatasourceInterface $datasource = NULL) {
public function getPropertyDefinitions(?DatasourceInterface $datasource = NULL) {
$properties = [];
if (!$datasource) {
......@@ -61,7 +61,7 @@ class MappedField extends ProcessorPluginBase {
foreach ($mapped_fields as $field) {
$configuration = $field->getConfiguration();
list($datasource_id, $property_path) = Utility::splitCombinedId($configuration['field']);
[$datasource_id, $property_path] = Utility::splitCombinedId($configuration['field']);
$required_properties_by_datasource[$datasource_id][$property_path] = $configuration['field'];
}
......@@ -126,4 +126,3 @@ class MappedField extends ProcessorPluginBase {
}
}
......@@ -53,7 +53,7 @@ class MappedFieldProperty extends ConfigurablePropertyBase {
$field_options = [];
foreach ($fields as $field) {
$combined_id = Utility::createCombinedId($field->getDatasourceId(), $field->getPropertyPath());
list($datasource_id, $name) = Utility::splitCombinedId($combined_id);
[$datasource_id, $name] = Utility::splitCombinedId($combined_id);
if (!$datasource_id && $name == 'mapped_field') {
continue;
......@@ -68,21 +68,21 @@ class MappedFieldProperty extends ConfigurablePropertyBase {
$form['mapping'] = [
'#type' => 'textarea',
'#title' => $this->t('Mapping'),
'#description' => 'Use "orignal_value|new_value". Only one mapping per line.',
'#description' => 'Use "original_value|new_value". Only one mapping per line.',
'#default_value' => $configuration['mapping'],
];
$form['with_value'] = [
'#type' => 'textfield',
'#title' => $this->t('Target value for non empty source values.'),
'#description' => 'This target value is used for all source values which are not catched by the mapping and which are not empty.',
'#description' => 'This target value is used for all source values which are not caught by the mapping and which are not empty.',
'#default_value' => $configuration['with_value'],
];
$form['without_value'] = [
'#type' => 'textfield',
'#title' => $this->t('Target value for empty source values.'),
'#description' => 'This target value is used for all source values which are not catched by the mapping and which are empty.',
'#description' => 'This target value is used for all source values which are not caught by the mapping and which are empty.',
'#default_value' => $configuration['without_value'],
];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment