Skip to content

Commit

Permalink
Merge pull request #162 from openeuropa/EWPP-1918
Browse files Browse the repository at this point in the history
EWPP-1918: Upgrade to PHP8 and Composer v2.
  • Loading branch information
hernani authored Feb 17, 2022
2 parents 898f197 + b0c32cd commit 09bc27a
Show file tree
Hide file tree
Showing 21 changed files with 81 additions and 52 deletions.
19 changes: 12 additions & 7 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ services:
web:
image: registry.fpfis.eu/fpfis/httpd-php:${PHP_VERSION}-ci
environment:
- COMPOSERVER=--2
- DOCUMENT_ROOT=/test/oe_paragraphs
- DRUPAL_SPARQL_HOSTNAME=sparql
- DRUPAL_SPARQL_PORT=8890
Expand All @@ -42,30 +43,33 @@ services:
- DBA_PASSWORD=dba

pipeline:
composer-install:
composer-install-highest:
group: prepare
image: registry.fpfis.eu/fpfis/httpd-php:${PHP_VERSION}-ci
volumes:
- /cache/${DRONE_REPO_NAME}:/cache
commands:
- composer install --ansi --no-suggest --no-progress
- composer self-update --2
- composer install --ansi --no-progress
when:
matrix:
COMPOSER_BOUNDARY: highest

composer-update-lowest:
group: post-prepare
group: prepare
image: registry.fpfis.eu/fpfis/httpd-php:${PHP_VERSION}-ci
volumes:
- /cache/${DRONE_REPO_NAME}:/cache
commands:
# @todo remove "composer install" step once the following issue is fixed.
# @link https://webgate.ec.europa.eu/CITnet/jira/browse/OPENEUROPA-1234
- composer update --prefer-lowest --prefer-stable --ansi --no-suggest --no-progress --no-interaction
- composer update --prefer-lowest --prefer-stable --ansi --no-progress --no-interaction
when:
matrix:
COMPOSER_BOUNDARY: lowest

site-install:
image: registry.fpfis.eu/fpfis/httpd-php:${PHP_VERSION}-ci
commands:
- while ! mysqladmin ping -h mysql --silent; do sleep 1; done
- ./vendor/bin/run drupal:site-install

grumphp:
Expand Down Expand Up @@ -98,4 +102,5 @@ matrix:
- lowest
- highest
PHP_VERSION:
- 7.3
- 7.4
- 8.0
61 changes: 38 additions & 23 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,44 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=7.3",
"php": ">=7.4",
"drupal/allowed_formats": "^1.4",
"drupal/core": "^8.9 || ^9.1",
"drupal/core": "^9.2",
"drupal/paragraphs": "^1.12",
"drupal/typed_link": "^2.0"
},
"require-dev": {
"behat/behat": "^3.10",
"behat/mink-extension": "^2.3.1",
"composer/installers": "^1.5",
"consolidation/annotated-command": "^2.8.2",
"cweagans/composer-patches": "^1.7",
"drupal/address": "^1.9",
"drupal/composite_reference": "^1.0-alpha",
"drupal/composite_reference": "^2.1",
"drupal/config_devel": "^1.2",
"drupal/core-composer-scaffold": "^8.9 || ^9.1",
"drupal/drupal-extension": "^4.0",
"drupal/core-composer-scaffold": "^9.2",
"drupal/core-dev": "^9.2",
"drupal/description_list_field": "^1.0",
"drupal/drupal-extension": "^4.0",
"drupal/entity_browser": "^2.5",
"drupal/json_field": "^1.0.0-rc3",
"drupaltest/behat-traits": "dev-GH-6",
"drupaltest/behat-traits": "^0.3",
"drush/drush": "^10.3",
"easyrdf/easyrdf": "1.0.0 as 0.9.2",
"egulias/email-validator": "^2.1.22 || ^3.0",
"instaclick/php-webdriver": "^1.4.9",
"nikic/php-parser": "^3.0",
"nikic/php-parser": "^4.12.0",
"openeuropa/behat-transformation-context": "^0.1",
"openeuropa/code-review": "^1.6",
"openeuropa/drupal-core-require-dev": "^8.9 || ^9.1",
"openeuropa/oe_content": "2.x-dev",
"openeuropa/rdf_skos": "1.0.0-alpha5",
"openeuropa/oe_media": "^1.12",
"openeuropa/code-review": "^2.0",
"openeuropa/oe_content": "^2.8",
"openeuropa/oe_media": "^1.15",
"openeuropa/oe_webtools": "^1.12",
"openeuropa/task-runner-drupal-project-symlink": "^1.0",
"phpspec/prophecy-phpunit": "^1 || ^2"
"openeuropa/rdf_skos": "^1.0.0-alpha6",
"openeuropa/task-runner-drupal-project-symlink": "^1.0-beta5",
"phpspec/prophecy-phpunit": "^2",
"symfony/dom-crawler": "^4.4.12"
},
"suggest": {
"openeuropa/oe_media": "Allows usage of paragraphs with different media attached to it."
},
"_readme": [
"We explicitly require consolidation/robo to allow lower 'composer update --prefer-lowest' to complete successfully.",
"We explicitly require consolidation/annotated-command to allow lower 'composer update --prefer-lowest' to complete successfully.",
"We explicitly require openeuropa/rdf_skos 1.0.0-alpha5 to use correct interface for class in sparql_entity_storage till new release of openeuropa/oe_content."
],
"scripts": {
"post-install-cmd": "./vendor/bin/run drupal:site-setup",
"post-update-cmd": "./vendor/bin/run drupal:site-setup"
Expand Down Expand Up @@ -82,16 +80,33 @@
"locations": {
"web-root": "./build"
}
}
},
"_readme": [
"Explicit requirement for egulias/email-validator due to https://www.drupal.org/project/drupal/issues/3061074#comment-14300579. It can be removed when Drupal core 9.2 support is droppped.",
"Explicit minimum version requirement of behat library due to PHP compatibility.",
"Explicit minimum version requirement for symfony/dom-crawler due to its lower versions using the deprecated function libxml_disable_entity_loader() in PHP8.",
"Explicit requirement of cweagans/composer-patches to allow patches to be applied."
]
},
"repositories": [
{
"type": "vcs",
"url": "https://git.drupalcode.org/project/description_list_field.git"
},
{
"type": "composer",
"url": "https://packages.drupal.org/8"
}
],
"config": {
"sort-packages": true,
"discard-changes": true
"discard-changes": true,
"allow-plugins": {
"composer/installers": true,
"drupal/core-composer-scaffold": true,
"cweagans/composer-patches": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpro/grumphp": true
}
}
}
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
version: '2'
services:
web:
image: fpfis/httpd-php-dev:7.3
image: fpfis/httpd-php-dev:8.0
working_dir: /var/www/html
ports:
- 8080:8080
volumes:
- .:/var/www/html # Non Mac users.
# - nfsmount:/var/www/html # Mac Users with the nfsmount volume.
environment:
COMPOSERVER: "--2"
XDEBUG_CONFIG: "client_host=172.17.0.1" # Non-Mac users.
# XDEBUG_CONFIG: "client_host=host.docker.internal" # Mac users.
XDEBUG_MODE: "develop, debug"
Expand Down
14 changes: 12 additions & 2 deletions grumphp.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,19 @@ parameters:

extra_tasks:
phpparser:
ignore_patterns: "%tasks.phpcs.ignore_patterns%"
ignore_patterns:
- vendor/
- build/
visitors:
declare_strict_types: ~
triggered_by: "%tasks.phpcs.triggered_by%"
triggered_by:
- php
- module
- inc
- theme
- install
grumphp:
extensions:
- OpenEuropa\CodeReview\ExtraTasksExtension
git_hook_variables:
EXEC_GRUMPHP_COMMAND: 'docker-compose exec -T web'
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: ^8.9 || ^9.1
core_version_requirement: ^9.2

dependencies:
- oe_media:oe_media_avportal
Expand Down
2 changes: 1 addition & 1 deletion modules/oe_paragraphs_chart/oe_paragraphs_chart.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: OpenEuropa Paragraphs Chart
type: module
description: Provides a paragraph type that displays Webtools charts.
package: OpenEuropa
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2

dependencies:
- oe_paragraphs:oe_paragraphs_media_field_storage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: OpenEuropa Paragraphs Contact
type: module
description: Provides a paragraph type that references Contact entities.
package: OpenEuropa
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2

dependencies:
- oe_paragraphs:oe_paragraphs
Expand Down
2 changes: 1 addition & 1 deletion modules/oe_paragraphs_demo/oe_paragraphs_demo.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: OpenEuropa Paragraphs demo
type: module
description: Provides a content type using OE Paragraphs for demonstration purposes.
package: OpenEuropa
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2

dependencies:
- drupal:path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'OpenEuropa Paragraphs Horizontal description list'
type: module
description: 'Provides Horizontal description list paragraph that renders items grouped in HTML Description list tag.'
package: OpenEuropa
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2

dependencies:
- description_list_field:description_list_field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: OpenEuropa Paragraphs Document
type: module
description: Provides a paragraph type that references document media entities.
package: OpenEuropa
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2

dependencies:
- oe_media:oe_media
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'OpenEuropa Paragraphs Iframe'
type: module
description: 'Provides an Iframe paragraph that displays an Iframe.'
package: OpenEuropa
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2

dependencies:
- oe_media:oe_media_iframe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'OpenEuropa Paragraphs Illustration Lists'
type: module
description: 'Provides group of Illustration lists paragraphs.'
package: OpenEuropa
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2

dependencies:
- composite_reference:composite_reference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ type: module
description: 'Used by the automated tests for the OE Paragraphs Illustration Lists.'
package: Testing
hidden: true
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2
2 changes: 1 addition & 1 deletion modules/oe_paragraphs_map/oe_paragraphs_map.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: OpenEuropa Paragraphs Map
type: module
description: Provides Map paragraph type that uses map media.
package: OpenEuropa
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2

dependencies:
- oe_paragraphs:oe_paragraphs_media_field_storage
Expand Down
2 changes: 1 addition & 1 deletion modules/oe_paragraphs_media/oe_paragraphs_media.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: OpenEuropa Text with featured Media paragraph
type: module
description: Provides Text with Featured Media paragraph that uses media elements.
package: OpenEuropa
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2

dependencies:
- oe_media:oe_media_avportal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: OpenEuropa Paragraphs Media Field Storage
type: module
description: Provides storage for field_oe_media field.
package: OpenEuropa
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2

dependencies:
- oe_media:oe_media_avportal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: OpenEuropa Paragraphs Social feed
type: module
description: Provides Social feed paragraph that uses social feed media type.
package: OpenEuropa
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2

dependencies:
- oe_paragraphs:oe_paragraphs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: OpenEuropa Paragraphs Timeline
type: module
description: Provides timeline paragraph that uses the timeline field type.
package: OpenEuropa
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2

dependencies:
- oe_paragraphs:oe_paragraphs
Expand Down
2 changes: 1 addition & 1 deletion oe_paragraphs.info.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: OpenEuropa Paragraphs
type: module
description: A collection of Paragraph types based on ECL components.
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2
package: OpenEuropa

dependencies:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ type: module
description: 'Used by the automated tests for the OE Paragraphs allowed values option events tests.'
package: Testing
hidden: true
core_version_requirement: ^8.9 || ^9.1
core_version_requirement: ^9.2
4 changes: 1 addition & 3 deletions tests/src/Functional/ParagraphsTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ abstract class ParagraphsTestBase extends BrowserTestBase {
protected function setUp(): void {
parent::setUp();

$this->drupalLogin($this->drupalCreateUser([
'administer content types',
]));
$this->drupalLogin($this->drupalCreateUser([], '', TRUE));
$this->drupalCreateContentType([
'type' => 'paragraphs_test',
'name' => 'Paragraphs Test',
Expand Down

0 comments on commit 09bc27a

Please sign in to comment.