Implements unattended package migrations for both explicit and implicit migrations (#10418)
* Clean up and changes to backoffice for the nuget only packages * temp commit of package logic removal * Lots of package code cleanup and removal * Removes old package data from the test package xml * Updates packaging code to take in XDocument instead of a file since we'll not be dealing with files, starts creating expressions for the package migrations scripting. * fixing tests * Fixes runtime state and boot failed middleware so that it actually runs. Separates out unattended install/upgrade into notification handlers. * Gets unattended package migrations working and running * Gets embedded package.xml resources able to install from package migration. * Implements automatic package migrations for package that just declare an xml data manifest. * fix build * small cleanups * fix build * adds some tests * Fix export test * Fix newlines in test for linux * Typo * removes old todos and updates AutomaticPackgeMigrationPlan to use getter with backing field. Co-authored-by: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
@@ -16,6 +16,7 @@ using Umbraco.Cms.Core.Manifest;
|
||||
using Umbraco.Cms.Core.Media;
|
||||
using Umbraco.Cms.Core.Migrations;
|
||||
using Umbraco.Cms.Core.Models.PublishedContent;
|
||||
using Umbraco.Cms.Core.Notifications;
|
||||
using Umbraco.Cms.Core.Packaging;
|
||||
using Umbraco.Cms.Core.PropertyEditors;
|
||||
using Umbraco.Cms.Core.PropertyEditors.ValueConverters;
|
||||
@@ -37,6 +38,7 @@ using Umbraco.Cms.Infrastructure.Media;
|
||||
using Umbraco.Cms.Infrastructure.Migrations;
|
||||
using Umbraco.Cms.Infrastructure.Migrations.Install;
|
||||
using Umbraco.Cms.Infrastructure.Migrations.PostMigrations;
|
||||
using Umbraco.Cms.Infrastructure.Packaging;
|
||||
using Umbraco.Cms.Infrastructure.Persistence;
|
||||
using Umbraco.Cms.Infrastructure.Runtime;
|
||||
using Umbraco.Cms.Infrastructure.Search;
|
||||
@@ -61,6 +63,9 @@ namespace Umbraco.Cms.Infrastructure.DependencyInjection
|
||||
builder.Services.AddUnique(factory => factory.GetRequiredService<IUmbracoDatabaseFactory>().SqlContext);
|
||||
builder.Services.AddUnique<IRuntimeState, RuntimeState>();
|
||||
builder.Services.AddUnique<IRuntime, CoreRuntime>();
|
||||
builder.Services.AddUnique<PendingPackageMigrations>();
|
||||
builder.AddNotificationAsyncHandler<RuntimeUnattendedInstallNotification, UnattendedInstaller>();
|
||||
builder.AddNotificationAsyncHandler<RuntimeUnattendedUpgradeNotification, UnattendedUpgrader>();
|
||||
|
||||
// composers
|
||||
builder
|
||||
|
||||
@@ -24,10 +24,6 @@ namespace Umbraco.Cms.Infrastructure.DependencyInjection
|
||||
builder.Services.AddScoped<InstallSetupStep, DatabaseInstallStep>();
|
||||
builder.Services.AddScoped<InstallSetupStep, DatabaseUpgradeStep>();
|
||||
|
||||
// TODO: Add these back once we have a compatible Starter kit
|
||||
// composition.Services.AddScoped<InstallSetupStep,StarterKitDownloadStep>();
|
||||
// composition.Services.AddScoped<InstallSetupStep,StarterKitInstallStep>();
|
||||
// composition.Services.AddScoped<InstallSetupStep,StarterKitCleanupStep>();
|
||||
builder.Services.AddScoped<InstallSetupStep, CompleteInstallStep>();
|
||||
|
||||
builder.Services.AddTransient<InstallStepCollection>();
|
||||
|
||||
@@ -14,6 +14,7 @@ using Umbraco.Cms.Core.Packaging;
|
||||
using Umbraco.Cms.Core.Routing;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.Core.Services.Implement;
|
||||
using Umbraco.Cms.Infrastructure.Packaging;
|
||||
using Umbraco.Extensions;
|
||||
|
||||
namespace Umbraco.Cms.Infrastructure.DependencyInjection
|
||||
@@ -70,9 +71,7 @@ namespace Umbraco.Cms.Infrastructure.DependencyInjection
|
||||
builder.Services.AddUnique<ConflictingPackageData>();
|
||||
builder.Services.AddUnique<CompiledPackageXmlParser>();
|
||||
builder.Services.AddUnique<ICreatedPackagesRepository>(factory => CreatePackageRepository(factory, "createdPackages.config"));
|
||||
builder.Services.AddUnique<IInstalledPackagesRepository>(factory => CreatePackageRepository(factory, "installedPackages.config"));
|
||||
builder.Services.AddUnique<PackageDataInstallation>();
|
||||
builder.Services.AddUnique<PackageFileInstallation>();
|
||||
builder.Services.AddUnique<IPackageInstallation, PackageInstallation>();
|
||||
|
||||
return builder;
|
||||
@@ -91,8 +90,6 @@ namespace Umbraco.Cms.Infrastructure.DependencyInjection
|
||||
factory.GetRequiredService<ILocalizationService>(),
|
||||
factory.GetRequiredService<IHostingEnvironment>(),
|
||||
factory.GetRequiredService<IEntityXmlSerializer>(),
|
||||
factory.GetRequiredService<ILoggerFactory>(),
|
||||
factory.GetRequiredService<IUmbracoVersion>(),
|
||||
factory.GetRequiredService<IOptions<GlobalSettings>>(),
|
||||
factory.GetRequiredService<IMediaService>(),
|
||||
factory.GetRequiredService<IMediaTypeService>(),
|
||||
|
||||
Reference in New Issue
Block a user