Commit Graph

63 Commits

Author SHA1 Message Date
Paul Johnson
0241649f7f Cleanup AddUmbraco & AddUmbracoCore 2020-11-21 15:22:24 +00:00
Paul Johnson
39657dea6d UmbracoBuilder now requires TypeLoader via ctor 2020-11-20 12:18:25 +00:00
Paul Johnson
5b1ccb0659 Remove the crazy Func param on AddUmbracoCore 2020-11-20 11:13:53 +00:00
Paul Johnson
8b97ce69b1 Removed CoreRuntimeBootstrapper
Establish runtime level at run time not during service registration.
2020-11-19 20:21:45 +00:00
Paul Johnson
3672a9f2f2 Add composers via extension on UmbracoBuilder
reduce scope of CoreRuntimeBootstrapper
2020-11-19 16:20:39 +00:00
Paul Johnson
48b61ec4c4 Simplify UmbracoBuilder setup 2020-11-19 09:12:39 +00:00
Paul Johnson
aec25d5007 Replace Composition with UmbracoBuilder 2020-11-18 17:41:57 +00:00
Paul Johnson
d498c1a2cd Netcore: Turn container validation back on (#9401)
* Remove RuntimeLevelAttribute & disable filtering

* Remove RuntimeLevelAttribute usage on Composers

* Fix broken tests

* Resolve UserManager registration issues.

* Turn container validation back on.

* Resolve lifetime issue post install backoffice.

* Remove final TODO: MSDI
2020-11-17 08:56:04 +01:00
Paul Johnson
3f5f85880e NetCore: MSDI refactor split CoreRuntime & Remove Current (#9356)
* Split Bootstrap code from CoreRuntime

* Make ContentService method signatures match interface
prevents need to hide the concrete class in tests

* Remove Current

Only bit that bugs me is TreeNode for IconFilePath
I get the feeling it's dead code, but can just use a setter in cs or work out path in js if required.

* Fix tests, remember to terminate IRuntime
2020-11-10 09:50:47 +01:00
Paul Johnson
4ae329589a NetCore: MSDI refactor remove IFactory & IRegister (#9308)
* Replace IFactory with IServiceProvider

* Replace IRegister with IServiceCollection

* Fix Rte.cshtml so the view can service locate.

* Replace Composing Lifetime with MSDI ServiceLifetime

* Remove ServiceProvider AddMultipleUnique extension

* Remove Umbraco.Web.Composing.Current.Reset and any calls

* Remove LightInject from net framework projects

* Brought back a helper for setting MediaFileSystem underlying IFileSystem
2020-10-30 12:16:17 +01:00
Paul Johnson
ec66990e72 NetCore: MSDI refactor phase 2 (#9280)
* Moved adapters from Infra -> Core

* Allow Composition to accept a service collection instead of an IRegister

* Composition no longer takes IRegister as constructor arg

all tests passing

* Composition no longer implements IRegister

* Lose _uniques in Composition

* lose Composition OnCreatingFactory actions

* Clean up UmbracoCoreServiceCollectionExtensions & Composition

Less IFactory

* LightInject gone where TFW == netstandard2.0 || TFW == netcoreapp3.1

* Resolve dead code issues

* Rename IFactory methods to match IServiceProvider so they can be trivially swapped later.

* Rename IFactory methods to match IServiceProvider so they can be trivially swapped later (continued)

Thought the counts were low, it's mostly extension method usage
2020-10-27 11:53:01 +01:00
Paul Johnson
a99f625f6a Netcore: Alternate approach for MSDI refactor (#9247)
* Doesn't make much sense to have Concrete on IRegister, only on IFactory

* Handle FilesTreeController requires IFileSystem of type PhysicalFileSystem

* Handle registration of default MediaFileSystem without using RegisterUniqueFor

* Remove RegisterFor / RegisterUniqueFor from IRegister

* Switch over from LightInject to wrappers around MSDI

* Made mapper dependencies more explicit

* Remove registration for AngularJsonMediaTypeFormatter

It's dependencies aren't registered so container validation fails

* Resolve lifetime issue for EnsureValidSessionId by service locating

else resolve scoped in singleton

* Make registration more explicit for backoffice UserManager

* Make install step registrations more explicit

* Disable service provider validation so site can launch

Maybe this is a problem maybe not, we build about 8000 service providers so maybe everything is fine later...

* Further cleanup of IFactory interface

* Further cleanup of IRegister interface

* Revert "Make registration more explicit for backoffice UserManager"

This reverts commit 7215fe836103c597cd0873c66737a79b91ed4c49.

* Resolve issue where NewInstallStep would fail to reset password for "SuperUser"

Before MSDI, somehow BackOfficeIdentityOptions would be configured with token provider map from IdentityBuilder.AddDefaultTokenProviders.
After switchover those config actions are lost.

Subclass IdentityBuilder to ensure BackOfficeIdentityOptions doesn't miss config setup upstream.

* Initialize current.

* Add todo to turn container validation back on.

* Migrated ScopeFileSystemsTests to integration tests

Signed-off-by: Bjarke Berg <mail@bergmania.dk>

* Resolve issue where MediaFileSystem was skipping ShadowFileSystem

* Attempt to fix ScopeFileSystemsTests on azure devops

Signed-off-by: Bjarke Berg <mail@bergmania.dk>

* Be interesting to know what the actual full path is in pipeline.

* Clarify intent of CreateMediaTest

Doesn't help resolve weird UnauthorizedAccessException but it cuts so much cognitive overhead for the future.

* Use ILoggerfactory rather than mock for the manually constructed file PhysicalFileSystem

* Maybe resolve failing test on azure pipeline.

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2020-10-26 11:47:14 +01:00
Bjarke Berg
3551d6e65e Clean up and fixed todos
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-06 21:23:15 +02:00
Bjarke Berg
2779b19737 Fixed test
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-09-24 10:13:22 +02:00
Bjarke Berg
f413f279eb Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/migrate-logging
Signed-off-by: Bjarke Berg <mail@bergmania.dk>

# Conflicts:
#	src/Umbraco.ModelsBuilder.Embedded/LiveModelsProvider.cs
#	src/Umbraco.ModelsBuilder.Embedded/PureLiveModelFactory.cs
#	src/Umbraco.Tests.Integration/Implementations/TestHelper.cs
#	src/Umbraco.Tests.Integration/Persistence/Repositories/TemplateRepositoryTest.cs
#	src/Umbraco.Tests.Integration/RuntimeTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/ColorListValidatorTest.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/EnsureUniqueValuesValidatorTest.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/MultiValuePropertyEditorTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Core/Published/NestedContentTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Core/Published/PropertyCacheLevelTests.cs
#	src/Umbraco.Tests/Components/ComponentTests.cs
#	src/Umbraco.Tests/IO/ShadowFileSystemTests.cs
#	src/Umbraco.Tests/Models/VariationTests.cs
#	src/Umbraco.Tests/Packaging/PackageDataInstallationTests.cs
#	src/Umbraco.Tests/Persistence/DatabaseContextTests.cs
#	src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs
#	src/Umbraco.Tests/Persistence/Repositories/MediaTypeRepositoryTest.cs
#	src/Umbraco.Tests/Persistence/Repositories/MemberRepositoryTest.cs
#	src/Umbraco.Tests/Persistence/Repositories/MemberTypeRepositoryTest.cs
#	src/Umbraco.Tests/Persistence/Repositories/PublicAccessRepositoryTest.cs
#	src/Umbraco.Tests/Persistence/Repositories/TagRepositoryTest.cs
#	src/Umbraco.Tests/Persistence/Repositories/UserRepositoryTest.cs
#	src/Umbraco.Tests/Persistence/SqlCeTableByTableTest.cs
#	src/Umbraco.Tests/Published/ConvertersTests.cs
#	src/Umbraco.Tests/PublishedContent/SolidPublishedSnapshot.cs
#	src/Umbraco.Tests/Routing/ContentFinderByIdTests.cs
#	src/Umbraco.Tests/Routing/ContentFinderByUrlAndTemplateTests.cs
#	src/Umbraco.Tests/Routing/DomainsAndCulturesTests.cs
#	src/Umbraco.Tests/Routing/UmbracoModuleTests.cs
#	src/Umbraco.Tests/Scoping/ScopeEventDispatcherTests.cs
#	src/Umbraco.Tests/Scoping/ScopedNuCacheTests.cs
#	src/Umbraco.Tests/Services/ContentServicePerformanceTest.cs
#	src/Umbraco.Tests/Services/ContentTypeServiceVariantsTests.cs
2020-09-23 07:59:10 +02:00
Mole
438515fa66 Merge Netcore: Use serilog to log all messages and use appsettings as config into Netcore/feature/migrate logging 2020-09-22 15:09:16 +02:00
Andy Butland
1bd22d72c2 Removed configuration model builders. 2020-09-21 21:06:24 +02:00
Mole
d3ae921293 Remove most of the last references and rename LoggerFactory_ to LoggerFactory in UmbracoTestBase 2020-09-21 13:04:57 +02:00
Mole
d61b9f54fa Merge options 2020-09-18 12:53:06 +02:00
berg
f11391961f Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/use-serilog-to-log-all-messages
# Conflicts:
#	src/Umbraco.Tests.Integration/TestServerTest/UmbracoBuilderExtensions.cs
#	src/Umbraco.Web.Common/Extensions/UmbracoCoreServiceCollectionExtensions.cs
#	src/Umbraco.Web/UmbracoApplicationBase.cs
2020-09-18 08:31:09 +02:00
Bjarke Berg
7d3bc9be1c Moved serilog config to appsettings and configured it to also catch MS logging messages.
Added Console log for Development
2020-09-17 09:01:10 +02:00
Nikolaj
87774b789c Add LoggerFactory to TestHelper and fix a bunch of tests 2020-09-16 15:17:42 +02:00
Nikolaj
633d42039e Fix a whole bunch of other errors 2020-09-15 15:14:44 +02:00
Bjarke Berg
e079bd5a50 Cleanup usages of Configs 2020-09-08 13:03:43 +02:00
Bjarke Berg
c8669b18c2 Merge remote-tracking branch 'origin/netcore/netcore' into feature/8651-config-options-patten
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-09-04 14:30:48 +02:00
Shannon
7c78b5b34f Updates CoreRuntime with better dependencies so we can disable caches, fixes integration test to run multiple callbacks registered for TearDown, ensure we TearDown the runtime. 2020-09-04 00:27:43 +10:00
Shannon
f84a93ae20 Adds IUmbracoBuilder to build the config so it's easier to split apart, ensures background tasks don't run in integration tests, uses a custom CoreRuntime to ensure we use SimpleMainDom, re-wires the UmbracoWebApplicationFactory so that duplicate Hosts are not running at the same time, fixes issues with overriding/shadowing, uses RAMDirectory in lucene for tests, fixes CoreRuntime's events that we're moved incorrectly and not backwards compat, adds new real non static events which we can use in integration tests to install the DB before the runtime state is calculated 2020-09-02 18:10:29 +10:00
Andy Butland
4e222f103e Reintroduced legacy config into CoreRuntime to support remaining use of Current.Configs (e.g. in UserInvite) 2020-08-26 18:21:09 +02:00
Andy Butland
8fd59d546e Fixed failing tests. 2020-08-26 07:55:23 +02:00
Andy Butland
adf687579c Restored Umbraco.Tests.IntegrationTests (some failures remaining) 2020-08-24 12:34:37 +02:00
Shannon
42c347dc21 doh fix build 2020-05-12 17:19:19 +10:00
Shannon
a34d94845c Fixes tests 2020-05-12 17:14:39 +10:00
Shannon
bcaede22f1 Cleans up ext methods and where they are located and what they call to ensure dependencies are taken care of, cleans up Startup, moves routing appropriately 2020-05-12 15:18:55 +10:00
Bjarke Berg
e4dfdbb504 AB#6233 - renamed extensions namespace to Umbraco.Extensions 2020-05-07 10:08:23 +02:00
Bjarke Berg
fa740f36b5 fix tests 2020-04-29 08:56:42 +02:00
Bjarke Berg
f76e638f0d Merge remote-tracking branch 'origin/netcore/dev' into netcore/bugfix/logging-fixing
# Conflicts:
#	src/Umbraco.Tests.Integration/RuntimeTests.cs
#	src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs
#	src/Umbraco.Web.Common/Extensions/UmbracoCoreServiceCollectionExtensions.cs
2020-04-22 10:54:54 +02:00
Shannon
46e14f7692 Fixes up all logging. Configures serilog logging to replace MS logging just like serilog does, adds new ILoggerConfiguration so we aren't hard coding things, dynamically adds enrichers when the container is ready to resolve services. 2020-04-22 14:23:56 +10:00
Bjarke Berg
c0ec1bf6ca Introduced GenericDictionaryRequestAppCache, to use the HttpContext.Items from .NET Core 2020-04-20 13:21:09 +02:00
Shannon
4920268ec8 combines application builder extensions to one class 2020-04-03 15:56:34 +11:00
Shannon
60abdd60b5 Starts fixing up integration tests 2020-04-03 13:16:01 +11:00
Bjarke Berg
400fa1ccd4 Initialize Current 2020-04-01 14:19:41 +02:00
Bjarke Berg
2a2903f932 AB#5820 - Review fixes / Clean up 2020-03-31 12:22:11 +02:00
Elitsa Marinovska
7e3b3414d5 Merge branch 'netcore/dev' into netcore/feature/ab5820-webprofiler-aspnetcore 2020-03-30 15:26:51 +02:00
Shannon
3757f722a0 Gets first integration test moved, moves the test options to the common project, ensures that the LocalDb pool is updated on each test 2020-03-30 20:55:13 +11:00
Shannon
9ed925941f Gets DB installation test working with runtime level checking 2020-03-30 17:25:29 +11:00
Bjarke Berg
681a25b861 Moved files from backoffice into Common + Introduced AspNetCoreComponent to invoke the Umbraco Application Init event 2020-03-27 11:39:17 +01:00
Shannon
a5d728cc51 Reduce the usage of BuildServiceProvider 2020-03-25 18:21:44 +11:00
Shannon
2d506c1fd0 Adds container test showing how we can pre-resolve a service and ensures its the same on that gets used. 2020-03-25 17:23:31 +11:00
Shannon
612a47b16b Splits interfaces into separate ones, removes overlap between interfaces, injects the necessary bits, and much more 2020-03-25 15:06:22 +11:00
Shannon
d0a204b984 Cleans up some unused code, fixes a merge issue causing duplicate runtimes to be created, register essential does what it's supposed to do, don't mix things with the webruntime. 2020-03-24 14:48:32 +11:00