Skip to content

Commit

Permalink
Merge pull request #219 from openeuropa/EWPP-3966
Browse files Browse the repository at this point in the history
EWPP-3966: Support D10.2 and drop D9.
  • Loading branch information
nagyad authored Feb 16, 2024
2 parents 7989a67 + ad3e110 commit 1fd0cc0
Show file tree
Hide file tree
Showing 80 changed files with 186 additions and 119 deletions.
29 changes: 23 additions & 6 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ services:
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
selenium:
image: registry.fpfis.eu/fpfis/selenium:standalone-chrome-3.141.59-oxygen
image: registry.fpfis.eu/fpfis/selenium:standalone-chrome-4.1.3-20220405
shm_size: 2g
environment:
- DISPLAY=:99
- SE_OPTS=-debug
- SCREEN_WIDTH=1280
- SCREEN_HEIGHT=800
- NODE_MAX_INSTANCES=5
Expand All @@ -43,6 +42,22 @@ services:
- DBA_PASSWORD=dba

pipeline:
composer-change-patch:
group: warmup
image: registry.fpfis.eu/fpfis/httpd-php:${PHP_VERSION}-ci
volumes:
- /cache:/cache
commands:
# Change the patch for 10.1.x.
- >
composer config --merge --json "extra.patches.drupal/core" '{"https://www.drupal.org/project/drupal/issues/2230909": "https://www.drupal.org/files/issues/2022-07-26/2230909-269.patch"}'
- >
composer config --merge --json "extra.patches-ignore.openeuropa/oe_content" '{"drupal/core": {"Drupal 10.2.x only - see README.md for 10.1.x - https://www.drupal.org/project/drupal/issues/2230909": "https://www.drupal.org/files/issues/2023-12-21/2230909-309.patch"}}'
when:
matrix:
CORE_VERSION: "10.1.0"


composer-install:
group: prepare
image: registry.fpfis.eu/fpfis/httpd-php:${PHP_VERSION}-ci
Expand Down Expand Up @@ -85,9 +100,11 @@ pipeline:

matrix:
include:
- CORE_VERSION: 9.4.0
PHP_VERSION: 8.0
- CORE_VERSION: 9.4.0
- CORE_VERSION: 10.1.0
PHP_VERSION: 8.1
- CORE_VERSION: 10.0
- CORE_VERSION: 10.1.0
PHP_VERSION: 8.2
- CORE_VERSION: 10.2.0
PHP_VERSION: 8.1
- CORE_VERSION: 10.2.0
PHP_VERSION: 8.2
25 changes: 24 additions & 1 deletion behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,30 @@ default:
ajax_timeout: 10
selenium2:
wd_host: '${selenium.host}:${selenium.port}/wd/hub'
capabilities: { "browser": "chrome", "version": "*" }
capabilities:
browser: chrome
nativeEvents: true
marionette: true
browserName: chrome
version: '*'
extra_capabilities:
chromeOptions:
w3c: false
args:
- '--no-sandbox'
- '--start-maximized'
- '--disable-gpu'
- '--window-size=1440,900'
- '--disable-dev-shm-usage'
- '--disable-setuid-sandbox'
- '--disable-web-security'
- '--DNS-prefetch-disable'
- '--disable-translate'
- '--ignore-certificate-errors'
- '--test-type'
- '--disable-extensions'
- '--incognito'
- '--disable-infobars'
base_url: "${drupal.base_url}"
files_path: "%paths.base%/tests/fixtures/"
Drupal\DrupalExtension:
Expand Down
20 changes: 10 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=8.0",
"cweagans/composer-patches": "~1.4",
"php": ">=8.1",
"cweagans/composer-patches": "^1.7 || ^2.0",
"drupal/allowed_formats": "^2.0 || ^3.0",
"drupal/core": "^9.4 || ^10",
"drupal/core": "^10",
"drupal/paragraphs": "^1.15",
"drupal/typed_link": "^2.0"
},
Expand All @@ -18,24 +18,24 @@
"drupal/address": "^1.9",
"drupal/composite_reference": "^2.1",
"drupal/config_devel": "^1.9",
"drupal/core-composer-scaffold": "^9.4 || ^10",
"drupal/core-utility": "^9.4 || ^10",
"drupal/core-composer-scaffold": "^10",
"drupal/core-utility": "^10",
"drupal/description_list_field": "^1.0",
"drupal/drupal-extension": "^5.0",
"drupal/entity_browser": "^2.5",
"drupal/inline_entity_form": "^1.0-rc12",
"drupal/json_field": "^1.1",
"drush/drush": "^11.1",
"drush/drush": "^12",
"nikic/php-parser": "^4",
"openeuropa/behat-transformation-context": "^0.1",
"openeuropa/code-review": "^2.0",
"openeuropa/oe_content": "^3.0.0-alpha11",
"openeuropa/oe_content": "^3.0.0",
"openeuropa/oe_media": "^1.23.1",
"openeuropa/oe_webtools": "^1.22",
"openeuropa/rdf_skos": "^1.0.0-alpha10",
"openeuropa/task-runner-drupal-project-symlink": "^1.0-beta6",
"phpspec/prophecy-phpunit": "^2",
"symfony/phpunit-bridge": "^6.0",
"symfony/validator": "~v4.4.48 || ~v6.2.5"
"symfony/phpunit-bridge": "^6.0"
},
"suggest": {
"openeuropa/oe_media": "Allows usage of paragraphs with different media attached to it."
Expand Down Expand Up @@ -76,7 +76,7 @@
},
"_readme": [
"Explicit requirement of symfony/phpunit-bridge to replace drupal/core-dev testing classes and traits.",
"Using symfony/validator v6.2.5 for D10 like core-recommended does because 6.3 breaks BC with the signature changes to the ExecutionContextInterface. Remove when 6.3.1 is realased."
"Explicit requirement of nikic/php-parser ^4 as later versions are not compatible with grumphp @see https://github.com/phpro/grumphp/issues/1119"
]
},
"repositories": [
Expand Down
12 changes: 3 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,16 @@ services:
- DBA_PASSWORD=dba
ports:
- "8890:8890"
# Spawn a Selenium server which also includes a VNC server on localhost:5900 (the password is "secret")
# Visit localhost:7900 to access the browser.
selenium:
image: selenium/standalone-chrome-debug:3.141.59-oxygen
expose:
- '4444'
image: selenium/standalone-chrome:4.1.3-20220405
environment:
- DISPLAY=:99
- SE_OPTS=-debug
- SCREEN_WIDTH=1280
- SCREEN_HEIGHT=800
- VNC_NO_PASSWORD=1
ports:
- '4444:4444'
- '5900:5900'
volumes:
- /dev/shm:/dev/shm
- '7900:7900'
shm_size: 2g

#### Mac users: uncomment the "volumes" key to enable the NFS file sharing. You can find more information about Docker for Mac here: https://github.com/openeuropa/openeuropa/blob/master/docs/starting/tooling.md#using-docker-on-macos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: OpenEuropa Paragraphs AV Media
type: module
description: Provides a Media paragraph that references an image or a video.
package: OpenEuropa
core_version_requirement: ^9.4 || ^10
core_version_requirement: ^10

dependencies:
- oe_media:oe_media_avportal
Expand Down
2 changes: 1 addition & 1 deletion modules/oe_paragraphs_banner/oe_paragraphs_banner.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: OpenEuropa Paragraphs Banner
type: module
description: Provides a Banner paragraph that uses media images.
package: OpenEuropa
core_version_requirement: ^9.4 || ^10
core_version_requirement: ^10

dependencies:
- oe_media:oe_media_avportal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Post update functions for the OE Paragraphs Banner module.
*/

declare(strict_types = 1);
declare(strict_types=1);

use Drupal\Core\Config\FileStorage;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,3 @@ services:
oe_paragraphs_banner.paragraph_updater:
class: Drupal\oe_paragraphs_banner\BannerParagraphUpdater
arguments: [ '@entity_type.manager' ]
oe_paragraphs_banner.banner_paragraph_update:
class: Drupal\oe_paragraphs_banner\Commands\UpdateBannerData
arguments: [ '@entity_type.manager', '@oe_paragraphs_banner.paragraph_updater', '@messenger' ]
tags:
- { name: drush.command }
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\oe_paragraphs_banner;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\oe_paragraphs_banner\Commands;
namespace Drupal\oe_paragraphs_banner\Drush\Commands;

use Drupal\Core\Batch\BatchBuilder;
use Drupal\Core\DependencyInjection\DependencySerializationTrait;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Messenger\MessengerInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\oe_paragraphs_banner\BannerParagraphUpdater;
use Drush\Attributes as CLI;
use Drush\Commands\DrushCommands;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
* Updates Banner paragraph data.
*
* Migrates the "Banner type" field value to "Alignment" and "Size" fields.
*/
class UpdateBannerData extends DrushCommands {
final class BannerCommands extends DrushCommands {

use StringTranslationTrait;
use DependencySerializationTrait;
Expand Down Expand Up @@ -55,10 +57,27 @@ public function __construct(EntityTypeManagerInterface $entityTypeManager, Banne
}

/**
* Triggers the update of the Banner paragraph data.
* Return an instance of these Drush commands.
*
* @param \Symfony\Component\DependencyInjection\ContainerInterface $container
* The container.
*
* @command oe-paragraphs-update-banner-data:run
* @return \Drupal\oe_paragraphs_banner\Drush\Commands\BannerCommands
* The instance of Drush commands.
*/
public static function create(ContainerInterface $container): BannerCommands {
return new BannerCommands(
$container->get('entity_type.manager'),
$container->get('oe_paragraphs_banner.paragraph_updater'),
$container->get('messenger'),
);
}

/**
* Triggers the update of the Banner paragraph data.
*/
#[CLI\Command(name: 'oe-paragraphs-update-banner-data:run', aliases: [])]
#[CLI\Usage(name: 'oe-paragraphs-update-banner-data:run', description: 'Updates Banner paragraph data.')]
public function updateBannerData(): void {
$ids = $this->entityTypeManager->getStorage('paragraph')->getQuery()
->condition('type', 'oe_banner')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\Tests\oe_paragraphs_banner\Kernel;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: OpenEuropa Paragraphs Carousel
type: module
description: Provides the Carousel paragraph that allows users to create carousel items similar to a banner with multiple slides.
package: OpenEuropa
core_version_requirement: ^9.4 || ^10
core_version_requirement: ^10

dependencies:
- oe_media:oe_media_avportal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* OE Paragraphs Carousel module.
*/

declare(strict_types = 1);
declare(strict_types=1);

use Drupal\Core\Entity\EntityTypeInterface;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Post update functions for the OE Paragraphs Carousel module.
*/

declare(strict_types = 1);
declare(strict_types=1);

use Drupal\Core\Config\FileStorage;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,3 @@ services:
oe_paragraphs_carousel.paragraph_updater:
class: Drupal\oe_paragraphs_carousel\CarouselParagraphUpdater
arguments: [ '@entity_type.manager' ]
oe_paragraphs_carousel.carousel_paragraph_update:
class: Drupal\oe_paragraphs_carousel\Commands\UpdateCarouselData
arguments: [ '@entity_type.manager', '@oe_paragraphs_carousel.paragraph_updater', '@messenger' ]
tags:
- { name: drush.command }
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\oe_paragraphs_carousel;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\oe_paragraphs_carousel\Commands;
namespace Drupal\oe_paragraphs_carousel\Drush\Commands;

use Drupal\Core\Batch\BatchBuilder;
use Drupal\Core\DependencyInjection\DependencySerializationTrait;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Messenger\MessengerInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\oe_paragraphs_carousel\CarouselParagraphUpdater;
use Drush\Attributes as CLI;
use Drush\Commands\DrushCommands;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
* Sets default "Size" value for existing Carousel paragraphs.
*/
class UpdateCarouselData extends DrushCommands {
final class CarouselCommands extends DrushCommands {

use StringTranslationTrait;
use DependencySerializationTrait;
Expand Down Expand Up @@ -53,10 +55,27 @@ public function __construct(EntityTypeManagerInterface $entityTypeManager, Carou
}

/**
* Triggers the update of the Carousel paragraph data.
* Return an instance of these Drush commands.
*
* @param \Symfony\Component\DependencyInjection\ContainerInterface $container
* The container.
*
* @command oe-paragraphs-update-carousel-data:run
* @return \Drupal\oe_paragraphs_carousel\Drush\Commands\CarouselCommands
* The instance of Drush commands.
*/
public static function create(ContainerInterface $container): CarouselCommands {
return new CarouselCommands(
$container->get('entity_type.manager'),
$container->get('oe_paragraphs_carousel.paragraph_updater'),
$container->get('messenger'),
);
}

/**
* Triggers the update of the Carousel paragraph data.
*/
#[CLI\Command(name: 'oe-paragraphs-update-carousel-data:run', aliases: [])]
#[CLI\Usage(name: 'oe-paragraphs-update-carousel-data:run', description: 'Updates Carousel paragraph data.')]
public function updateCarouselData(): void {
$ids = $this->entityTypeManager->getStorage('paragraph')->getQuery()
->condition('type', 'oe_carousel')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\oe_paragraphs_carousel\Plugin\Validation\Constraint;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\oe_paragraphs_carousel\Plugin\Validation\Constraint;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\Tests\oe_paragraphs_carousel\Functional;

Expand Down
Loading

0 comments on commit 1fd0cc0

Please sign in to comment.