From 220ab37fbd884186e4a2c8a9ed8b2545a50c7182 Mon Sep 17 00:00:00 2001 From: Moshe Weitzman Date: Mon, 17 Jan 2022 14:21:20 -0500 Subject: [PATCH 01/10] Bump Symfony --- composer.json | 6 +++--- composer.lock | 42 +++++++++++++++++++++--------------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/composer.json b/composer.json index f3e711bf96..ac864204c0 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "ext-dom": "*", "chi-teck/drupal-code-generator": "^2.3", "composer/semver": "^1.4 || ^3", - "consolidation/annotated-command": "^4.4", + "consolidation/annotated-command": "^4.5", "consolidation/config": "^1.2", "consolidation/filter-via-dot-access-data": "^1", "consolidation/robo": "^3", @@ -46,11 +46,11 @@ "league/container": "^3.4", "psr/log": "~1.0", "psy/psysh": "~0.11", - "symfony/event-dispatcher": "^4.0", + "symfony/event-dispatcher": "^4.0 || ^5.0", "symfony/finder": "^4.0 || ^5", "symfony/polyfill-php80": "^1.23", "symfony/var-dumper": "^4.0 || ^5.0", - "symfony/yaml": "^4.0", + "symfony/yaml": "^4.0 || ^5.0", "webflo/drupal-finder": "^1.2", "webmozart/path-util": "^2.1.0" }, diff --git a/composer.lock b/composer.lock index 88e2df022b..25fea5a0be 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ff8221ae494b4436f105199890276615", + "content-hash": "cb125a34825e500af3466aa3c0249c76", "packages": [ { "name": "chi-teck/drupal-code-generator", @@ -2171,16 +2171,16 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.23.1", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "16880ba9c5ebe3642d1995ab866db29270b36535" + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", - "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", "shasum": "" }, "require": { @@ -2232,7 +2232,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.24.0" }, "funding": [ { @@ -2248,7 +2248,7 @@ "type": "tidelift" } ], - "time": "2021-05-27T12:26:48+00:00" + "time": "2021-11-23T21:10:46+00:00" }, { "name": "symfony/polyfill-intl-idn", @@ -2503,7 +2503,7 @@ }, { "name": "symfony/polyfill-php72", - "version": "v1.23.0", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", @@ -2559,7 +2559,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.24.0" }, "funding": [ { @@ -2579,16 +2579,16 @@ }, { "name": "symfony/polyfill-php73", - "version": "v1.23.0", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", "shasum": "" }, "require": { @@ -2638,7 +2638,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.24.0" }, "funding": [ { @@ -2654,7 +2654,7 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2021-06-05T21:20:04+00:00" }, { "name": "symfony/polyfill-php80", @@ -5433,16 +5433,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.5.1", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" + "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", - "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/93ebd0014cab80c4ea9f5e297ea48672f1b87706", + "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706", "shasum": "" }, "require": { @@ -5477,9 +5477,9 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.0" }, - "time": "2021-10-02T14:08:47+00:00" + "time": "2022-01-04T19:58:01+00:00" }, { "name": "phpspec/prophecy", From 5cd3af9379eaee6ba301cc0551c50de35fa716eb Mon Sep 17 00:00:00 2001 From: Moshe Weitzman Date: Mon, 17 Jan 2022 14:48:19 -0500 Subject: [PATCH 02/10] Allow Drupal 10 --- .circleci/config.yml | 4 ++-- composer.json | 2 +- composer.lock | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 01996ef953..d53f20d92a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -109,7 +109,7 @@ jobs: # PHP 8 test with Drupal tip # Determines whether a newer version of a dependency has broken Drush. - test_81_drupal94_highest: + test_81_drupal10_highest: <<: *defaults docker: - image: wodby/php:latest @@ -122,7 +122,7 @@ jobs: - run: cp .docker/zz-php.ini /usr/local/etc/php/conf.d/ - run: php --version - run: composer -n config platform.php --unset - - run: composer -n require --dev drupal/core-recommended:9.4.x-dev --no-update + - run: composer -n require --dev drupal/core-recommended:10.0.x-dev --no-update - run: composer -n update - run: mkdir -p /tmp/results - run: composer -n lint diff --git a/composer.json b/composer.json index ac864204c0..40f1ea8ddd 100644 --- a/composer.json +++ b/composer.json @@ -58,7 +58,7 @@ "composer/installers": "^1.7", "cweagans/composer-patches": "~1.0", "david-garcia/phpwhois": "4.3.0", - "drupal/core-recommended": "^9", + "drupal/core-recommended": "^9 || ^10", "drupal/semver_example": "2.2.0", "phpunit/phpunit": ">=7.5.20", "rector/rector": "^0.12", diff --git a/composer.lock b/composer.lock index 25fea5a0be..ad1cde6854 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cb125a34825e500af3466aa3c0249c76", + "content-hash": "d7ff9c22bc977b33f9cdd94b5ccc1477", "packages": [ { "name": "chi-teck/drupal-code-generator", From 2b7ef5a34081227f5b166ac66a970bbaed756ebf Mon Sep 17 00:00:00 2001 From: Moshe Weitzman Date: Mon, 17 Jan 2022 14:56:15 -0500 Subject: [PATCH 03/10] fix ci --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d53f20d92a..3673f29275 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -144,7 +144,7 @@ workflows: <<: *requires - test_74_drupal9_mysql: <<: *requires - - test_81_drupal94_highest: + - test_81_drupal10_highest: <<: *requires - test_74_drupal9_sqlite: <<: *requires From bbe56c484ca9f879602e1097ad93109f68d82b1b Mon Sep 17 00:00:00 2001 From: Moshe Weitzman Date: Mon, 17 Jan 2022 15:11:51 -0500 Subject: [PATCH 04/10] Temporarily remove semver_example for Drush10 testing. --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3673f29275..7974ed0bcc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -123,6 +123,8 @@ jobs: - run: php --version - run: composer -n config platform.php --unset - run: composer -n require --dev drupal/core-recommended:10.0.x-dev --no-update + # Bring it back when it is compatible with Drupal 10. + - run: composer -n remove drupal/semver_example - run: composer -n update - run: mkdir -p /tmp/results - run: composer -n lint From d403f85e05483eb48d5485fd93f28bbb87bb4ca0 Mon Sep 17 00:00:00 2001 From: Moshe Weitzman Date: Mon, 17 Jan 2022 15:14:15 -0500 Subject: [PATCH 05/10] no-update --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7974ed0bcc..16f78ef0df 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -124,7 +124,7 @@ jobs: - run: composer -n config platform.php --unset - run: composer -n require --dev drupal/core-recommended:10.0.x-dev --no-update # Bring it back when it is compatible with Drupal 10. - - run: composer -n remove drupal/semver_example + - run: composer -n remove drupal/semver_example --no-update - run: composer -n update - run: mkdir -p /tmp/results - run: composer -n lint From b8280fb66643894c50dfb0b4f944dd2ff25fd5d1 Mon Sep 17 00:00:00 2001 From: Moshe Weitzman Date: Mon, 17 Jan 2022 15:16:27 -0500 Subject: [PATCH 06/10] no-update --dev --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 16f78ef0df..1883ccf605 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -124,7 +124,7 @@ jobs: - run: composer -n config platform.php --unset - run: composer -n require --dev drupal/core-recommended:10.0.x-dev --no-update # Bring it back when it is compatible with Drupal 10. - - run: composer -n remove drupal/semver_example --no-update + - run: composer -n remove drupal/semver_example --no-update --dev - run: composer -n update - run: mkdir -p /tmp/results - run: composer -n lint From a741a38a28d72148d973b76b924887dad6ba9408 Mon Sep 17 00:00:00 2001 From: Moshe Weitzman Date: Mon, 17 Jan 2022 15:43:45 -0500 Subject: [PATCH 07/10] Update info ymls --- .../unish/drush_empty_module/drush_empty_module.info.yml | 2 +- tests/fixtures/modules/woot/composer.json | 2 +- tests/fixtures/modules/woot/woot.info.yml | 2 +- tests/integration/SecurityUpdatesTest.php | 5 +++++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sut/modules/unish/drush_empty_module/drush_empty_module.info.yml b/sut/modules/unish/drush_empty_module/drush_empty_module.info.yml index ebac62f70d..c85994ec0b 100644 --- a/sut/modules/unish/drush_empty_module/drush_empty_module.info.yml +++ b/sut/modules/unish/drush_empty_module/drush_empty_module.info.yml @@ -1,7 +1,7 @@ name: Drush empty module description: 'Drush empty module' core: 8.x -core_version_requirement: ^8 || ^9 +core_version_requirement: ^8 || ^9 || ^10 type: module # Require for the sake of tests - simulate what packaging would do. project: drush_empty_module diff --git a/tests/fixtures/modules/woot/composer.json b/tests/fixtures/modules/woot/composer.json index e2b8325324..a2dceee453 100644 --- a/tests/fixtures/modules/woot/composer.json +++ b/tests/fixtures/modules/woot/composer.json @@ -14,7 +14,7 @@ "extra": { "drush": { "services": { - "drush.services.yml": "^9 || ^10" + "drush.services.yml": "^9 || ^10 || ^11" } } } diff --git a/tests/fixtures/modules/woot/woot.info.yml b/tests/fixtures/modules/woot/woot.info.yml index e1c43e11df..7fe4f3a572 100644 --- a/tests/fixtures/modules/woot/woot.info.yml +++ b/tests/fixtures/modules/woot/woot.info.yml @@ -1,5 +1,5 @@ name: Woot type: module description: Woot Mightily. -core_version_requirement: ^9 +core_version_requirement: ^9 || ^10 package: Other diff --git a/tests/integration/SecurityUpdatesTest.php b/tests/integration/SecurityUpdatesTest.php index 697de3a010..28d0694907 100644 --- a/tests/integration/SecurityUpdatesTest.php +++ b/tests/integration/SecurityUpdatesTest.php @@ -2,6 +2,8 @@ namespace Unish; +use Composer\Semver\Semver; + /** * Tests "pm:security" command. * @group commands @@ -14,6 +16,9 @@ class SecurityUpdatesTest extends UnishIntegrationTestCase */ public function testInsecureDrupalPackage() { + if (Semver::satisfies(\Drupal::VERSION, '^10')) { + $this->markTestSkipped('drupal/semver_example not yet compatible.'); + } list($expected_package, $expected_version) = ['drupal/semver_example', '2.2.0']; $this->drush('pm:security', [], ['format' => 'json'], self::EXIT_ERROR_WITH_CLARITY); $this->assertStringContainsString('One or more of your dependencies has an outstanding security update.', $this->getErrorOutput()); From 405a969355b3613551826350ea3892af599075b6 Mon Sep 17 00:00:00 2001 From: Moshe Weitzman Date: Mon, 17 Jan 2022 16:44:48 -0500 Subject: [PATCH 08/10] Allow modules to be enabled --- tests/unish/CreateEntityType.php | 3 ++- tests/unish/TestModuleHelperTrait.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/unish/CreateEntityType.php b/tests/unish/CreateEntityType.php index 701e5e229e..18b3af6e34 100644 --- a/tests/unish/CreateEntityType.php +++ b/tests/unish/CreateEntityType.php @@ -15,7 +15,8 @@ public static function createContentEntity($testCase): void 'name' => 'Unish Article', 'machine_name' => 'unish_article', 'description' => 'A test module', - 'package' => 'unish', + // See https://www.drupal.org/project/drupal/issues/3096609. + 'package' => 'Testing', 'dependencies' => 'drupal:text', ]; $testCase->drush('generate', ['module'], ['verbose' => null, 'answer' => $answers, 'destination' => Path::join($testCase->webroot(), 'modules/contrib')], null, null, $testCase::EXIT_SUCCESS, null, ['SHELL_INTERACTIVE' => 1]); diff --git a/tests/unish/TestModuleHelperTrait.php b/tests/unish/TestModuleHelperTrait.php index edf7e7c4fe..90d8ea343f 100644 --- a/tests/unish/TestModuleHelperTrait.php +++ b/tests/unish/TestModuleHelperTrait.php @@ -33,7 +33,7 @@ public function setupModulesForTests(array $modules, $sourcePath) $info_path = $targetDir . "/$module.info.yml"; $module_info = file_get_contents($info_path); if (strpos($module_info, 'core_version_requirement') === false) { - $module_info = "core_version_requirement: ^8 || ^9\n$module_info"; + $module_info = "core_version_requirement: ^8 || ^9 || ^10\n$module_info"; file_put_contents($info_path, $module_info); } } From 423bf68bfa76f544b4a756a8be05537f590a93c1 Mon Sep 17 00:00:00 2001 From: Moshe Weitzman Date: Mon, 17 Jan 2022 17:24:08 -0500 Subject: [PATCH 09/10] Edit constraint --- tests/unish/CreateEntityType.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/unish/CreateEntityType.php b/tests/unish/CreateEntityType.php index 18b3af6e34..7f5ec6b349 100644 --- a/tests/unish/CreateEntityType.php +++ b/tests/unish/CreateEntityType.php @@ -20,6 +20,12 @@ public static function createContentEntity($testCase): void 'dependencies' => 'drupal:text', ]; $testCase->drush('generate', ['module'], ['verbose' => null, 'answer' => $answers, 'destination' => Path::join($testCase->webroot(), 'modules/contrib')], null, null, $testCase::EXIT_SUCCESS, null, ['SHELL_INTERACTIVE' => 1]); + // Currently needed for Drush 10.x tests. Harmless on other versions. + $path = Path::join($testCase->webroot(), 'modules/contrib/unish_article/unish_article.info.yml'); + $contents = file_get_contents($path); + file_put_contents($path, str_replace('^8 || ^9', '^8 || ^9 || ^10', $contents)); + + // Create a content entity type and enable its module. // Note that only the values below are used. The keys are for documentation. $answers = [ From 28ba05449cfeeef9862575ac4b26fabc0955deda Mon Sep 17 00:00:00 2001 From: Moshe Weitzman Date: Mon, 17 Jan 2022 17:26:17 -0500 Subject: [PATCH 10/10] Compat with Synfony 6. --- composer.json | 8 ++++---- composer.lock | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 40f1ea8ddd..0bb50d9571 100644 --- a/composer.json +++ b/composer.json @@ -46,11 +46,11 @@ "league/container": "^3.4", "psr/log": "~1.0", "psy/psysh": "~0.11", - "symfony/event-dispatcher": "^4.0 || ^5.0", - "symfony/finder": "^4.0 || ^5", + "symfony/event-dispatcher": "^4.0 || ^5.0 || ^6.0", + "symfony/finder": "^4.0 || ^5 || ^6", "symfony/polyfill-php80": "^1.23", - "symfony/var-dumper": "^4.0 || ^5.0", - "symfony/yaml": "^4.0 || ^5.0", + "symfony/var-dumper": "^4.0 || ^5.0 || ^6.0", + "symfony/yaml": "^4.0 || ^5.0 || ^6.0", "webflo/drupal-finder": "^1.2", "webmozart/path-util": "^2.1.0" }, diff --git a/composer.lock b/composer.lock index ad1cde6854..209a0e3924 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d7ff9c22bc977b33f9cdd94b5ccc1477", + "content-hash": "8ba272546279a9c366d810659d25c2a2", "packages": [ { "name": "chi-teck/drupal-code-generator",