From 708032c818f281ce91b38d37ecba220b0c522510 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Tue, 23 Apr 2024 20:26:42 +1000 Subject: [PATCH 1/5] Added Twig CS cache file to be excluded from .git. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5e95b2da6..57afd5053 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,7 @@ web/themes/**/node_modules web/themes/**/build .data .logs +.twig-cs-fixer.cache # Ignore local override files. docker-compose.override.yml From 2a975f2433dee485ccf2ab4cc00f570de38263a7 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Tue, 23 Apr 2024 20:28:26 +1000 Subject: [PATCH 2/5] Fixed PHP version in the composer.json. --- composer.json | 4 ++-- phpcs.xml | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 45bcc8ce6..fb4589aba 100644 --- a/composer.json +++ b/composer.json @@ -44,7 +44,7 @@ "drevops/behat-screenshot": "^1", "drevops/behat-steps": "^2.2", "drupal/core-dev": "^10.2.0", - "drupal/drupal-extension": "^5@rc", + "drupal/drupal-extension": "^5", "mglaman/phpstan-drupal": "^1.2", "palantirnet/drupal-rector": "^0.20", "phpcompatibility/php-compatibility": "^9.3", @@ -73,7 +73,7 @@ "pyrech/composer-changelogs": true }, "platform": { - "php": "8.2.13" + "php": "8.2.17" } }, "autoload": { diff --git a/phpcs.xml b/phpcs.xml index 7c643c695..453bb26e8 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -17,8 +17,6 @@ - - circle\.yml From 0ab3986aa8531c7e128fe0d1538891fc6e95b2ff Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Tue, 23 Apr 2024 20:29:27 +1000 Subject: [PATCH 3/5] Added `declare(strict_types=1);` to Rector config. --- rector.php | 5 +++++ tests/behat/bootstrap/FeatureContext.php | 2 ++ tests/phpunit/CircleCiConfigTest.php | 2 ++ tests/phpunit/Drupal/DatabaseSettingsTest.php | 2 ++ tests/phpunit/Drupal/EnvironmentSettingsTest.php | 2 ++ tests/phpunit/Drupal/SettingsTestCase.php | 2 ++ tests/phpunit/Drupal/SwitchableSettingsTest.php | 2 ++ .../custom/ys_core/tests/src/Functional/ExampleTest.php | 2 ++ .../tests/src/Functional/YsCoreFunctionalTestBase.php | 2 ++ web/modules/custom/ys_core/tests/src/Kernel/ExampleTest.php | 2 ++ .../custom/ys_core/tests/src/Kernel/YsCoreKernelTestBase.php | 2 ++ web/modules/custom/ys_core/tests/src/Traits/ArrayTrait.php | 2 ++ web/modules/custom/ys_core/tests/src/Traits/AssertTrait.php | 2 ++ web/modules/custom/ys_core/tests/src/Traits/MockTrait.php | 2 ++ .../custom/ys_core/tests/src/Traits/ReflectionTrait.php | 2 ++ web/modules/custom/ys_core/tests/src/Unit/ExampleTest.php | 2 ++ .../custom/ys_core/tests/src/Unit/YsCoreUnitTestBase.php | 2 ++ web/modules/custom/ys_core/ys_core.deploy.php | 2 ++ web/modules/custom/ys_core/ys_core.module | 2 ++ web/modules/custom/ys_search/ys_search.install | 2 ++ web/sites/default/default.settings.local.php | 2 ++ web/sites/default/includes/modules/settings.clamav.php | 2 ++ web/sites/default/includes/modules/settings.config_split.php | 2 ++ .../includes/modules/settings.environment_indicator.php | 2 ++ web/sites/default/includes/modules/settings.fast404.php | 2 ++ web/sites/default/includes/modules/settings.redis.php | 2 ++ web/sites/default/includes/modules/settings.shield.php | 2 ++ .../default/includes/modules/settings.stage_file_proxy.php | 2 ++ web/sites/default/includes/providers/settings.acquia.php | 2 ++ web/sites/default/includes/providers/settings.lagoon.php | 2 ++ web/sites/default/settings.php | 2 ++ .../your_site_theme/tests/src/Functional/ExampleTest.php | 2 ++ .../tests/src/Functional/YourSiteThemeFunctionalTestBase.php | 2 ++ .../custom/your_site_theme/tests/src/Kernel/ExampleTest.php | 2 ++ .../tests/src/Kernel/YourSiteThemeKernelTestBase.php | 2 ++ .../custom/your_site_theme/tests/src/Unit/ExampleTest.php | 2 ++ .../tests/src/Unit/YourSiteThemeUnitTestBase.php | 2 ++ web/themes/custom/your_site_theme/your_site_theme.theme | 2 ++ 38 files changed, 79 insertions(+) diff --git a/rector.php b/rector.php index 0d73b3ce7..3131d3b5f 100644 --- a/rector.php +++ b/rector.php @@ -27,6 +27,7 @@ use Rector\DeadCode\Rector\If_\RemoveAlwaysTrueIfConditionRector; use Rector\Set\ValueObject\SetList; use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector; +use Rector\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector; return static function (RectorConfig $rectorConfig): void { $rectorConfig->paths([ @@ -37,6 +38,7 @@ // Provided by Rector. SetList::PHP_80, SetList::PHP_81, + SetList::PHP_82, SetList::CODE_QUALITY, SetList::CODING_STYLE, SetList::DEAD_CODE, @@ -48,6 +50,8 @@ Drupal10SetList::DRUPAL_10, ]); + $rectorConfig->rule(DeclareStrictTypesRector::class); + $drupalFinder = new DrupalFinder(); $drupalFinder->locateRoot(__DIR__); @@ -78,6 +82,7 @@ '*/modules/contrib/*', '*/themes/contrib/*', '*/profiles/contrib/*', + '*/sites/default/default.settings.php', // Files. '*/sites/default/files/*', '*/sites/simpletest/*', diff --git a/tests/behat/bootstrap/FeatureContext.php b/tests/behat/bootstrap/FeatureContext.php index 530a71f17..a7e2f408b 100644 --- a/tests/behat/bootstrap/FeatureContext.php +++ b/tests/behat/bootstrap/FeatureContext.php @@ -5,6 +5,8 @@ * YOURSITE Drupal context for Behat testing. */ +declare(strict_types=1); + use DrevOps\BehatSteps\ContentTrait; use DrevOps\BehatSteps\FieldTrait; use DrevOps\BehatSteps\FileTrait; diff --git a/tests/phpunit/CircleCiConfigTest.php b/tests/phpunit/CircleCiConfigTest.php index 1c97274e3..92c554f4a 100644 --- a/tests/phpunit/CircleCiConfigTest.php +++ b/tests/phpunit/CircleCiConfigTest.php @@ -1,5 +1,7 @@ Date: Tue, 23 Apr 2024 20:29:43 +1000 Subject: [PATCH 4/5] Fixed CI not logging into Docker hub. --- .circleci/config.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 306eb753c..8691ac869 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -171,8 +171,8 @@ jobs: name: Export DB after download command: | [ ! -f /tmp/download-db-success ] && echo "==> Database download semaphore file is missing. DB export will not proceed." && exit 0 - docker compose up -d - sleep 15 + ./scripts/drevops/login-docker.sh + docker compose up -d && sleep 15 docker compose exec cli mkdir -p .data && docker compose cp -L .data/db.sql cli:/app/.data/db.sql || true docker compose exec $(env | cut -f1 -d= | sed 's/^/-e /') -T cli bash -c "DREVOPS_PROVISION_POST_OPERATIONS_SKIP=1 ./scripts/drevops/provision.sh" grep -q ^DREVOPS_DB_DOCKER_IMAGE .env && rm .data/db.sql || true @@ -227,6 +227,9 @@ jobs: - v1.19.0-db10-{{ checksum "/tmp/db_cache_branch" }}-{{ checksum "/tmp/db_cache_fallback_yes" }}-{{ checksum "/tmp/db_cache_timestamp" }} - v1.19.0-db10-{{ checksum "/tmp/db_cache_branch" }}-{{ checksum "/tmp/db_cache_fallback_yes" }}- #;> !PROVISION_USE_PROFILE + - run: + name: Login to Docker registry + command: ./scripts/drevops/login-docker.sh - run: name: Build stack command: docker compose up -d From f7659d96fc61de59af9a1e8ffdc0d2f57ae40eb3 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Tue, 23 Apr 2024 20:30:06 +1000 Subject: [PATCH 5/5] Added instructional comment to Docker Compose override config. --- docker-compose.override.default.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker-compose.override.default.yml b/docker-compose.override.default.yml index acc276ae8..39f5b3bde 100644 --- a/docker-compose.override.default.yml +++ b/docker-compose.override.default.yml @@ -1,3 +1,8 @@ +# Local docker services override. +# +# Copy this file to docker-compose.override.yml and set relevant values. +# docker-compose.override.yml is excluded from the repository, + services: chrome: # Chrome image with Apple M1 support.