Skip to content
Snippets Groups Projects
Commit 4e350a4c authored by Ted Bowman's avatar Ted Bowman Committed by Adam G-H
Browse files

Issue #3341708 by Wim Leers, tedbow, phenaproxima: Update requirements for 3.x

parent c5a246bf
No related branches found
No related tags found
No related merge requests found
Showing
with 21 additions and 54 deletions
......@@ -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:
......
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
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
name: 'New module'
type: module
core_version_requirement: ^9 || ^10
core_version_requirement: ^9.7 || ^10
project: new_module
name: 'New module'
type: module
core_version_requirement: ^9 || ^10
core_version_requirement: ^9.7 || ^10
project: new_module
......@@ -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",
......
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
name: Alpha
type: module
core_version_requirement: ^9 || ^10
core_version_requirement: ^9.7 || ^10
project: alpha
name: Alpha
type: module
core_version_requirement: ^9 || ^10
core_version_requirement: ^9.7 || ^10
project: alpha
......@@ -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!');
......
......@@ -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
......
......@@ -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
......
......@@ -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\")");
}
}
......@@ -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',
];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment