diff --git a/composer/Composer.php b/composer/Composer.php index bdf53cfad137b34015d4247435e5ec6263038f1e..1c868ccac0de7c231288f4dec4516ed4e9ce4c12 100644 --- a/composer/Composer.php +++ b/composer/Composer.php @@ -85,6 +85,13 @@ public static function setDrupalVersion(string $root, string $version): void { protected static function setTemplateProjectStability(string $root, string $version): void { $stability = VersionParser::parseStability($version); + // Drupal 10.0.0-RC1 is being released before Symfony 6.2.0-RC1, so + // temporarily set the stability to beta instead of RC. + // @todo Remove this after Symfony 6.2.0-RC1 is released. + if (str_starts_with($version, '10.0.0-') && ($stability === 'RC')) { + $stability = 'beta'; + } + $templateProjectPaths = static::composerSubprojectPaths($root, 'Template'); foreach ($templateProjectPaths as $path) { $dir = dirname($path); diff --git a/composer/Generator/ComponentGenerator.php b/composer/Generator/ComponentGenerator.php index c82468cbe7b091d23f9e3f0ab614e99bd351ee5f..dc521d954c70796b7f98bade24cdc3ae4209053e 100644 --- a/composer/Generator/ComponentGenerator.php +++ b/composer/Generator/ComponentGenerator.php @@ -150,6 +150,13 @@ protected function getPackage(IOInterface $io, string $original_json): array { $stability = VersionParser::parseStability(\Drupal::VERSION); + // Drupal 10.0.0-RC1 is being released before Symfony 6.2.0-RC1, so + // temporarily set the stability to beta instead of RC. + // @todo Remove this after Symfony 6.2.0-RC1 is released. + if (str_starts_with(\Drupal::VERSION, '10.0.0-') && ($stability === 'RC')) { + $stability = 'beta'; + } + // List of packages which we didn't find in either core requirement. $not_in_core = []; diff --git a/core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php b/core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php index 4faf4c72c967f7cc43aa17e7039c3be64408bccb..f24a2b53e3ea5ca6e0ca0b3209c44d235334bcd4 100644 --- a/core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php +++ b/core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php @@ -86,10 +86,19 @@ public function provideTemplateCreateProject() { * Make sure that static::MINIMUM_STABILITY is sufficiently strict. */ public function testMinimumStabilityStrictness() { + $minimum_minimum_stability = $this->getCoreStability(); + + // Drupal 10.0.0-RC1 is being released before Symfony 6.2.0-RC1, so + // temporarily set minimum_minimum_stability to beta instead of RC. + // @todo Remove this after Symfony 6.2.0-RC1 is released. + if (str_starts_with(\Drupal::VERSION, '10.0.0-') && ($minimum_minimum_stability === 'RC')) { + $minimum_minimum_stability = 'beta'; + } + // Ensure that static::MINIMUM_STABILITY is not less stable than the // current core stability. For example, if we've already released a beta on // the branch, ensure that we no longer allow alpha dependencies. - $this->assertGreaterThanOrEqual(array_search($this->getCoreStability(), static::STABILITY_ORDER), array_search(static::MINIMUM_STABILITY, static::STABILITY_ORDER)); + $this->assertGreaterThanOrEqual(array_search($minimum_minimum_stability, static::STABILITY_ORDER), array_search(static::MINIMUM_STABILITY, static::STABILITY_ORDER)); // Ensure that static::MINIMUM_STABILITY is the same as the least stable // dependency.