Skip to content
Snippets Groups Projects

Make the breaking changes

Open Adam G-H requested to merge issue/automatic_updates-3398782:begin into 3.0.x
Files
11
@@ -90,27 +90,23 @@ final class VersionPolicyValidator implements EventSubscriberInterface {
// If this is a cron update, we may need to do additional checks.
if ($stage instanceof ConsoleUpdateStage) {
$mode = $this->cronUpdateRunner->getMode();
// If cron updates are enabled, the installed version must be stable;
// no alphas, betas, or RCs.
$rules[] = StableReleaseInstalled::class;
// It must also be in a supported branch.
$rules[] = SupportedBranchInstalled::class;
if ($mode !== CronUpdateRunner::DISABLED) {
// If cron updates are enabled, the installed version must be stable;
// no alphas, betas, or RCs.
$rules[] = StableReleaseInstalled::class;
// It must also be in a supported branch.
$rules[] = SupportedBranchInstalled::class;
// If the target version is known, more rules apply.
if ($target_version) {
// The target version must be stable too...
$rules[] = TargetVersionStable::class;
// ...and it must be in the same minor as the installed version.
$rules[] = ForbidMinorUpdates::class;
// If only security updates are allowed during cron, the target
// version must be a security release.
if ($mode === CronUpdateRunner::SECURITY) {
$rules[] = TargetSecurityRelease::class;
}
// If the target version is known, more rules apply.
if ($target_version) {
// The target version must be stable too...
$rules[] = TargetVersionStable::class;
// ...and it must be in the same minor as the installed version.
$rules[] = ForbidMinorUpdates::class;
// If only security updates are allowed during cron, the target
// version must be a security release.
if ($this->cronUpdateRunner->getMode() === CronUpdateRunner::SECURITY) {
$rules[] = TargetSecurityRelease::class;
}
}
}
Loading