diff --git a/DEVELOPING.md b/DEVELOPING.md index 99f277518575a4fd6e7731329106a80252c17e3f..557eaa5ec09e59a1b02e4c27d7ec15ec697a8ea4 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -26,7 +26,7 @@ That's it. The success message will display next steps. ### System requirements * A *nix-based operating system, such as Linux or macOS. -* PHP 7.4 or later. +* Drupal 10 or later. * Composer 2 or later. (Automatic Updates is not compatible with Composer 1.) * Git must be installed. @@ -39,7 +39,7 @@ That's it. The success message will display next steps. Several details of your setup can be customized via environment variables. Set these before running [the installation command above](#local-development-environment-setup). ```shell -DRUPAL_CORE_BRANCH="9.5.x" # The branch of Drupal core that will be installed. +DRUPAL_CORE_BRANCH="10.0.x" # The branch of Drupal core that will be installed. DRUPAL_CORE_SHALLOW_CLONE="TRUE" # Whether or not to do a "shallow clone" of Drupal core. (Defaults to TRUE.) See note below. AUTOMATIC_UPDATES_BRANCH="8.x-2.x" # The branch of the Automatic Updates module that will be installed. SITE_DIRECTORY="auto_updates_dev" # The path to the directory where the dev environment will be installed. @@ -48,10 +48,12 @@ SITE_HOST=".test" # The path for Drupal's TRUSTED_HOST_PATTERN. Note: A shallow Git clone is much smaller and therefore faster, but it removes the ability to do debugging operations such as `git bisect` or `git blame`. To recover these abilities, [you can convert your repository to a full clone after the fact](https://stackoverflow.com/questions/6802145/how-to-convert-a-git-shallow-clone-to-a-full-clone): +// cSpell:disable ```shell cd auto-updates-dev git fetch --unshallow ``` +// cSpell:enable ### Alternative setup options You can download the setup script first to review its contents or modify it before running it: diff --git a/automatic_updates.info.yml b/automatic_updates.info.yml index 119d1f4b970b530d95ea7f019206fa28ad85f366..8240f6e933578fb8ad05813dfdddedcf70754105 100644 --- a/automatic_updates.info.yml +++ b/automatic_updates.info.yml @@ -1,7 +1,7 @@ name: 'Automatic Updates' type: module description: 'Automatically updates Drupal core.' -core_version_requirement: ^9.3 || ^10 +core_version_requirement: ^9.7 || ^10 dependencies: - drupal:package_manager - drupal:update diff --git a/automatic_updates_extensions/automatic_updates_extensions.info.yml b/automatic_updates_extensions/automatic_updates_extensions.info.yml index d430f2f7819f995a9e89696fc68f79656077567c..6cfd52e6c419595b0e60c90b60413cbf50e12ddf 100644 --- a/automatic_updates_extensions/automatic_updates_extensions.info.yml +++ b/automatic_updates_extensions/automatic_updates_extensions.info.yml @@ -1,7 +1,7 @@ name: 'Automatic Updates Extensions' type: module description: 'Allows updates to themes and modules' -core_version_requirement: ^9.3 || ^10 +core_version_requirement: ^9.7 || ^10 lifecycle: experimental dependencies: - drupal:automatic_updates diff --git a/automatic_updates_extensions/tests/fixtures/new_module/1.0.0/new_module.info.yml.hide b/automatic_updates_extensions/tests/fixtures/new_module/1.0.0/new_module.info.yml.hide index 4a4b0ec8038fd68108e9e7064bbeb823807b6154..30488a90e3f4dad0ee69f266eea0e2baac2cb14f 100644 --- a/automatic_updates_extensions/tests/fixtures/new_module/1.0.0/new_module.info.yml.hide +++ b/automatic_updates_extensions/tests/fixtures/new_module/1.0.0/new_module.info.yml.hide @@ -1,4 +1,4 @@ name: 'New module' type: module -core_version_requirement: ^9 || ^10 +core_version_requirement: ^9.7 || ^10 project: new_module diff --git a/automatic_updates_extensions/tests/fixtures/new_module/1.1.0/new_module.info.yml.hide b/automatic_updates_extensions/tests/fixtures/new_module/1.1.0/new_module.info.yml.hide index 4a4b0ec8038fd68108e9e7064bbeb823807b6154..30488a90e3f4dad0ee69f266eea0e2baac2cb14f 100644 --- a/automatic_updates_extensions/tests/fixtures/new_module/1.1.0/new_module.info.yml.hide +++ b/automatic_updates_extensions/tests/fixtures/new_module/1.1.0/new_module.info.yml.hide @@ -1,4 +1,4 @@ name: 'New module' type: module -core_version_requirement: ^9 || ^10 +core_version_requirement: ^9.7 || ^10 project: new_module diff --git a/composer.json b/composer.json index 7e1ac027723d1e60acef03c321ac85a8b7da3cca..b38377eadd6c6d53b69ee944ef75e036160b5380 100644 --- a/composer.json +++ b/composer.json @@ -12,19 +12,13 @@ }, "require": { "ext-json": "*", - "drupal/core": "^9.3 || ^10", + "drupal/core": "^9.7 || ^10", "php-tuf/composer-stager": "^1.2", "composer/composer": "^2.2.12 || ^2.3.5", "composer-runtime-api": "^2.1", "symfony/config": "^4.4 || ^6.1", - "php": ">=7.4.0", "symfony/finder": "^4.4 || ^6.1" }, - "config": { - "platform": { - "php": "7.4.0" - } - }, "scripts": { "phpcbf": "scripts/phpcbf.sh", "phpcs": "scripts/phpcs.sh", diff --git a/package_manager/package_manager.info.yml b/package_manager/package_manager.info.yml index a100892645b7b49ad0110d50968d2357aa9c5858..5aad751530d572130725b733a23eef8b3482ef3a 100644 --- a/package_manager/package_manager.info.yml +++ b/package_manager/package_manager.info.yml @@ -1,7 +1,6 @@ name: 'Package Manager' type: module description: 'API module providing functionality to stage package installs and updates with Composer.' -core_version_requirement: ^9.3 || ^10 -php: 7.4 +core_version_requirement: ^9.7 || ^10 dependencies: - drupal:update diff --git a/package_manager/tests/fixtures/build_test_projects/alpha/1.0.0/alpha.info.yml.hide b/package_manager/tests/fixtures/build_test_projects/alpha/1.0.0/alpha.info.yml.hide index 877af2ef708fc4ee6ff62ed5c8d0b9a7dd611e31..3029b2a6d90fd4e0b170a8c3b68da96226f3e8c2 100644 --- a/package_manager/tests/fixtures/build_test_projects/alpha/1.0.0/alpha.info.yml.hide +++ b/package_manager/tests/fixtures/build_test_projects/alpha/1.0.0/alpha.info.yml.hide @@ -1,4 +1,4 @@ name: Alpha type: module -core_version_requirement: ^9 || ^10 +core_version_requirement: ^9.7 || ^10 project: alpha diff --git a/package_manager/tests/fixtures/build_test_projects/alpha/1.1.0/alpha.info.yml.hide b/package_manager/tests/fixtures/build_test_projects/alpha/1.1.0/alpha.info.yml.hide index 877af2ef708fc4ee6ff62ed5c8d0b9a7dd611e31..3029b2a6d90fd4e0b170a8c3b68da96226f3e8c2 100644 --- a/package_manager/tests/fixtures/build_test_projects/alpha/1.1.0/alpha.info.yml.hide +++ b/package_manager/tests/fixtures/build_test_projects/alpha/1.1.0/alpha.info.yml.hide @@ -1,4 +1,4 @@ name: Alpha type: module -core_version_requirement: ^9 || ^10 +core_version_requirement: ^9.7 || ^10 project: alpha diff --git a/package_manager/tests/src/Kernel/PathExcluder/GitExcluderTest.php b/package_manager/tests/src/Kernel/PathExcluder/GitExcluderTest.php index 0940642449c1dfc22e6457953795467ed35642de..4c60627ebf793cda883bb369253fbd5b4c9806be 100644 --- a/package_manager/tests/src/Kernel/PathExcluder/GitExcluderTest.php +++ b/package_manager/tests/src/Kernel/PathExcluder/GitExcluderTest.php @@ -106,7 +106,7 @@ class GitExcluderTest extends PackageManagerKernelTestBase { Yaml::encode([ 'name' => 'Unknown to composer in stage', 'type' => 'module', - 'core_version_requirement' => '^9.3 || ^10', + 'core_version_requirement' => '^9.7 || ^10', ]) ); file_put_contents("$path/.git/ignored.txt", 'Phoenix!'); diff --git a/scripts/install_module.sh b/scripts/install_module.sh index 91b4dd48a793bb33fdfdf6ee2c911ac5280e5536..2d363b4e692d428e293db45bd948cd0060906e2d 100755 --- a/scripts/install_module.sh +++ b/scripts/install_module.sh @@ -52,12 +52,6 @@ composer config \ # Prevent Composer from symlinking path repositories. export COMPOSER_MIRROR_PATH_REPOS=1 -# Remove the Composer platform PHP requirement, but only on Drupal 9. -CORE_BRANCH=$(git rev-parse --abbrev-ref HEAD) -if [[ "$CORE_BRANCH" =~ 9.* ]]; then - composer config --unset platform.php -fi - # Prevent Composer from installing symlinks from common packages known to # contain them. # @see https://www.drupal.org/docs/develop/using-composer/using-drupals-vendor-hardening-composer-plugin diff --git a/scripts/setup_local_dev.sh b/scripts/setup_local_dev.sh index 4d034f17b3275eb578ec9784bd1a7e3bf98055ec..0fe4a4eb1af835f8c0111064253d535133ab9307 100755 --- a/scripts/setup_local_dev.sh +++ b/scripts/setup_local_dev.sh @@ -159,12 +159,6 @@ composer config \ # Prevent Composer from symlinking path repositories. export COMPOSER_MIRROR_PATH_REPOS=1 -# Remove the Composer platform PHP requirement, but only on Drupal 9. -CORE_BRANCH=$(git rev-parse --abbrev-ref HEAD) -if [[ "$CORE_BRANCH" =~ 9.* ]]; then - composer config --unset platform.php -fi - # Prevent Composer from installing symlinks from common packages known to # contain them. # @see https://www.drupal.org/docs/develop/using-composer/using-drupals-vendor-hardening-composer-plugin diff --git a/tests/src/Functional/AvailableUpdatesReportTest.php b/tests/src/Functional/AvailableUpdatesReportTest.php index 5b9241285ba9cc52e892e641db86d2a1f18530a9..f169650e9205490677fd1f7945374dec4cd4ce40 100644 --- a/tests/src/Functional/AvailableUpdatesReportTest.php +++ b/tests/src/Functional/AvailableUpdatesReportTest.php @@ -56,7 +56,7 @@ class AvailableUpdatesReportTest extends AutomaticUpdatesFunctionalTestBase { $this->checkForUpdates(); $assert->pageTextContains('Security update required! Update now'); $assert->elementAttributeContains('named', ['link', 'Update now'], 'href', $form_url); - $this->assertVersionLink('9.8.1', $form_url); + $this->assertVersionIsListed('9.8.1'); $this->setReleaseMetadata("$fixture_directory/drupal.9.8.2-older-sec-release.xml"); $this->mockActiveCoreVersion('9.7.0'); @@ -65,17 +65,17 @@ class AvailableUpdatesReportTest extends AutomaticUpdatesFunctionalTestBase { $assert->elementAttributeContains('named', ['link', 'Update now'], 'href', $form_url); // Releases that will available on the form should link to the form. - $this->assertVersionLink('9.8.2', $form_url); - $this->assertVersionLink('9.7.1', $form_url); + $this->assertVersionIsListed('9.8.2'); + $this->assertVersionIsListed('9.7.1'); // Releases that will not be available in the form should link to the // project release page. - $this->assertVersionLink('9.8.1', 'http://example.com/drupal-9-8-1-release'); + $this->assertVersionIsListed('9.8.1'); $this->setReleaseMetadata("$fixture_directory/drupal.9.8.2.xml"); $this->checkForUpdates(); $assert->pageTextContains('Update available Update now'); $assert->elementAttributeContains('named', ['link', 'Update now'], 'href', $form_url); - $this->assertVersionLink('9.8.2', $form_url); + $this->assertVersionIsListed('9.8.2'); } /** @@ -83,19 +83,9 @@ class AvailableUpdatesReportTest extends AutomaticUpdatesFunctionalTestBase { * * @param string $version * The version. - * @param string $url - * The expected URL. */ - private function assertVersionLink(string $version, string $url): void { - $assert = $this->assertSession(); - $row = $assert->elementExists('css', "table.update .project-update__version:contains(\"$version\")"); - // In Drupal 9.5 and later, the "Download" link does not exist. We can drop - // this assertion (and likely this entire method) when Drupal 9.5 is the - // minimum supported version of core. - $link = $row->findLink('Download'); - if ($link) { - $this->assertStringEndsWith($url, $link->getAttribute('href')); - } + private function assertVersionIsListed(string $version): void { + $this->assertSession()->elementExists('css', "table.update .project-update__version:contains(\"$version\")"); } } diff --git a/tests/src/Functional/UpdatePathTest.php b/tests/src/Functional/UpdatePathTest.php index 3d57d1cb1ec14470f05ae5438ab882c35cdece2d..0ce34f995ee485a57087e265fad2e7cdf77f03e3 100644 --- a/tests/src/Functional/UpdatePathTest.php +++ b/tests/src/Functional/UpdatePathTest.php @@ -21,14 +21,8 @@ class UpdatePathTest extends UpdatePathTestBase { * {@inheritdoc} */ protected function setDatabaseDumpFiles() { - // phpcs on 9.5 expects one thing, on 10.0 another. 🤷 - // @see https://www.drupal.org/project/automatic_updates/issues/3314137#comment-14771510 - // phpcs:disable - [$version] = explode('.', \Drupal::VERSION, 2); $this->databaseDumpFiles = [ - $version == 9 - ? $this->getDrupalRoot() . '/core/modules/system/tests/fixtures/update/drupal-9.3.0.filled.standard.php.gz' - : $this->getDrupalRoot() . '/core/modules/system/tests/fixtures/update/drupal-9.4.0.filled.standard.php.gz', + $this->getDrupalRoot() . '/core/modules/system/tests/fixtures/update/drupal-9.4.0.filled.standard.php.gz', __DIR__ . '/../../fixtures/automatic_updates-installed.php', ]; }