Commit Graph

21 Commits

Author SHA1 Message Date
Ronald Barendse
3873a0735c v11: Decouple dependencies (#12907)
* Move core dependencies and MSBuild targets from Umbraco.Cms to Umbraco.Cms.Targets

* Re-add appsettings.Tests.json

* Include appsettings-schema.json

* Use .NET 7.x in CodeQL build

* Fix duplicate Directory.Build.props import

* Decouple ImageSharp/ImageSharp.Web implementations

* Further decouple SqlServer implementation

* Add SupportedImageFileTypes to IImageDimensionExtractor

* Update descriptions

* Update project metadata

* Re-enable package validation

* Add embedded package icon

* Move ContinuousIntegrationBuild to build script

* Move shared properties to root Directory.Build.props

* Fix GetInstallState throwing exception when default provider isn't configured

* Remove redundant PackageRequireLicenseAcceptance and update version to 11.0.0-rc1

* Update build script

* Remove LangVersion preview

* Disable app-local ICU for MacOS integration test

* Disable app-local ICU for all integration tests

* Fix RuntimeState_Run test assertion

* Update projects and build script to require Node.js 16.17 (latest LTS)

* Remove app-local ICU from unit tests

* Add missing project reference

* Generate XML documentation files

* Expose management API in Web.UI project

* Update .NET 7 dependencies to RC1

* Update package-lock.json files

* Downgrade Cypress version
2022-09-27 14:22:34 +02:00
Bjarke Berg
d206df0cac Updated dependencies and cleaned up 2022-09-23 14:56:23 +02:00
Bjarke Berg
d139f4acc0 Updated dependencies and fixed new NRT issues
(cherry picked from commit 803c044b60)
(cherry picked from commit b2b2903a6e)
2022-09-20 10:48:29 +02:00
Sebastiaan Janssen
40035aa629 Merge branch 'v10/dev' into v11/dev 2022-09-20 09:13:22 +02:00
Sebastiaan Janssen
8d5fb41ab7 Revert "Updated dependencies and fixed new NRT issues"
This reverts commit b2b2903a6e.
2022-09-20 09:08:28 +02:00
Sebastiaan Janssen
db5d05d641 Revert files that shouldn't change back in v11 2022-09-19 16:37:24 +02:00
Bjarke Berg
b2b2903a6e Updated dependencies and fixed new NRT issues
(cherry picked from commit 803c044b60)
2022-09-19 16:21:50 +02:00
Sebastiaan Janssen
87c06f5f98 Back to 10.2.0-ish 2022-09-19 16:14:16 +02:00
Bjarke Berg
803c044b60 Updated dependencies and fixed new NRT issues 2022-09-19 12:36:45 +02:00
Nikolaj Geisle
1b5225f4cd V11/feature/update to dotnet 7 (#12712)
* Update projects to .NET 7

* Fix nullability errors

* Fix up pipelines to run 7.0

* Update langversion to preview

* Revert "Fix up pipelines to run 7.0"

This reverts commit d0fa8d01b8126a4eaa59832a3814a567705419ae.

* Fix up pipelines again, this time without indentation changes

* Include preview versions

* Versions not Version

* Fix ModelTypeTests

* Fix MemberPasswordHasherTests

Microsoft wants to use SHA512 instead of SHA256, so our old hashes will return SuccessRehashNeeded now

* Use dotnet cli instead of nuget restore

* Update src/Umbraco.Web.UI/Umbraco.Web.UI.csproj

* Update dependencies

* Fix nullability issues

* Fix unit test

* Fix nullability in ChangingPasswordModel

OldPassword can be null, if we're changing the password with password reset enabled. Additionally, we might as well use the new required keyword instead of supressing null.

* Use required keyword instead of supressing null

* Fix up pipelines again

* fix up spelling-error

* Use dotnet cli instead of nuget restore

* Fix up another NuGet command

* Use dotnet version 7 before building

* Include preview versions

* Remove condition

* Use dotnet 7 before running powershell script

* Update templates to .net 7

* Download version 7 before running linux container

* Move use dotnet 7 even earlier in E2E process

* Remove dotnet 7

* Reintroduce .NET 7 task

* Update linux docker container and remove dotnet 7 from yml

* Fix up dockerfile with ARG

* Fix up docker file with nightly builds of dotnet 7

* Reintroduce dotnet 7 so windows can use it

* Use aspnet 7 in docker

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2022-08-23 11:31:05 +02:00
Nikolaj Geisle
7aeb400fce V10: fix build warnings in test projects (#12509)
* Run code cleanup

* Dotnet format benchmarks project

* Fix up Test.Common

* Run dotnet format + manual cleanup

* Run code cleanup for unit tests

* Run dotnet format

* Fix up errors

* Manual cleanup of Unit test project

* Update tests/Umbraco.Tests.Benchmarks/HexStringBenchmarks.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update tests/Umbraco.Tests.Integration/Testing/TestDbMeta.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update tests/Umbraco.Tests.Benchmarks/TypeFinderBenchmarks.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update tests/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update tests/Umbraco.Tests.Integration/Umbraco.Core/Events/EventAggregatorTests.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Fix according to review

* Fix after merge

* Fix errors

Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2022-06-21 08:09:38 +02:00
Mole
8ffede0441 V10: merge release branch 20220620 (#12590)
* Add Umbraco specific global usings

* Enable implicit usings

* v10: Wait for updated ConnectionStrings during install (#12536)

* Do not change/reload configuration

* Wait for updated connection string options

* recase assigndomain (#12448)

* Add depth property to ICoreScope (#12540)

* Remove ambient scope stack from httpcontext.items. (#12539)

This change makes it easier to use service calls in parallel whilst
a httpcontext is available.

* v10: Prefer SQLite primitive types to flexible types (#12541)

* Prefer SQLite primitive types to flexible types.

* SQLite - column mappings use TEXT for decimals

Thanks @mattbrailsford for sense check.

* Fix issue where languages files are not found in subdir of package dir (#12543)

* Make FindContent return type nullable (#12545)

* Updated nuget dependencies (07-06-2022) (#12525)

* Updated nuget dependencies

* Move Nerdbank.GitVersioning update to Directory.Build.props

* Updated more dependencies

* Improve FlagOutOfDateModels property behaviour.

(cherry picked from commit 54077725c373495fce0d3fbc5cdb6469aad3b676)

* Fix logic error WRT models builder flag out of date models. (#12548)

(cherry picked from commit 6b0149803a879d1c6902a5f61d1f2e9dc8545aac)

* Fixed issue with expected null value. (#12550)

Fixes https://github.com/umbraco/Umbraco-CMS/issues/12526

* Updated Examine to 3.0.0

* Fixes relation issue, when moving a root item to recycle bin, the "Relate Parent Media Folder On Delete"/"Relate Parent Document On Delete" cannot get the parent node type, because it is a fake root.

* Fix possible null error

* Bump version to 10.0.0 final

* Fix attempting to write lock files to LocalTempPath before it exists (#12563)

* Re fix usage statements

Co-authored-by: Ronald Barendse <ronald@barend.se>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
Co-authored-by: Paul Johnson <pmj@umbraco.com>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2022-06-20 09:20:47 +02:00
Paul Johnson
551f523079 V10 - Reduce usage of temp AspNetCoreHostingEnvironment (#12270)
* Move MapPathWebRoot & MapPathContentRoot to extension methods.

* Set AspNetCoreHostingEnvironment ApplicationId without service provider.

* Drop some usages of TempHostingEnvironment

* Logging setup cleanup - AppDomainId has no value (it is always "1")

Creating new AppDomains isn't possible in .Net core.
Attempting to do so results in a platform exception.

A dotnet core process has a single AppDomain instance whose Id property
is always the integer 1.

* Setup logging without IHostingEnvironment

* Mark IUmbracoBuilder.BuilderHostingEnvironment obsolete
And remove internal usages.

* Typeloader no longer uses umbraco-types.list

* Added UmbracoHost - setup serilog two-stage init.

* Add ApplicationIdEnricher

* Defensive tweaks for those not using UmbracoHost

* Drop UmbracoHost static class

* Setup runtime logger without host builder extensions.

* Prevent RefreshingRazorViewEngine related explosions

* Filescoped namespaces for new classes.

* Apply suggestions from code review
2022-04-25 16:27:53 +02:00
Bjarke Berg
379d2e3e4e Dependency updates (#12283)
* Upgraded MailKit

* Upgraded Microsoft.* packages

* Upgrades various nuget packages to latest version

* Upgrades various nuget packages related to test
2022-04-22 09:24:30 +02:00
Bjarke Berg
b19dab5f3a Fix merge issues 2022-04-20 15:42:27 +02:00
Bjarke Berg
23a49161d6 Merge remote-tracking branch 'origin/v9/dev' into v10/dev
# Conflicts:
#	build/build.ps1
#	build/templates/UmbracoPackage/.template.config/template.json
#	build/templates/UmbracoProject/.template.config/dotnetcli.host.json
#	build/templates/UmbracoProject/.template.config/ide.host.json
#	build/templates/UmbracoProject/.template.config/template.json
#	src/Umbraco.Core/Constants-System.cs
#	src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Services.cs
#	src/Umbraco.Infrastructure/Security/BackOfficeUserStore.cs
#	src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs
#	umbraco-netcore-only.sln
2022-04-20 11:09:28 +02:00
Paul Johnson
3961c4c233 v10 SQLite support + distributed locking abstractions (#11922)
* Created Persistence.SQLite project skeleton.

* SQLite database initialization

* Various changes and hacks to make things work.

* WIP integration tests

* Fix thread safety tests

* Fix tests that relied on tie breaker sorting.

Spent a fair amount of time looking for a less lazy fix but gave up.

* Convert right join to left join ContentTypeRepository.PerformGetByQuery
SQLite doesn't support right join

* Fix test Can_Generate_Delete_SubQuery_Statement

Worth noting that NPoco.DatabaseTypes.SQLiteDatabaseType doesn't override
EscapeSqlIdentifier so NPoco will escape with [].

SQLite docs say > "A keyword enclosed in square brackets is an identifier.
This is not standard SQL.
This quoting mechanism is used by MS Access and SQL Server and is
included in SQLite for compatibility."

Also could have updated SqliteSyntaxProvider to match npoco but
decided against it.

* Fixes for paginated custom order by

* Fix tests broken by lack of unique indexes.

* Fix SqlServerTableByTableTest tests.

These tests didn't actually do anything as the tables already exist so schema creator just returned.

Did however point out that the default implementation for DoesTableExist just returns false so added a default naive implementation.

* Fix ValidateLoginSession - SelectTop must come later

* dry up database cleanup

* Fix up db migration tests.
We can't drop pk in sqlite without recreating table.
Test looks to be testing that add column works as intended which we can test.

* Prevent schema creation errors.

* SQLite ignore lock tests, WAL back on.

* Fix package schema tests

* Fix NPocoFetchTests - case sensitivity not under test

* Fix AdvancedMigrationTests (where possible)

Migrations probably need a good look later.
Maybe nuke old migrations and only support moving to v10 from v9.

If we do that can do some cleanup.

* Cleanup test database configuration

* Run integration tests against SQLite on build agent.

* Drop MS.Data.SQLite
System.Data.SQLite was quicker to roll out due to more CLR type mapping

* YAML

* Skip Umbraco.Tests.Integration.SqlCe

* Drop SqlServerTableByTable tests.

Until this week they did nothing anyway as they with NewSchemaPerTest
so the tests all passed as CreateTable was no op (already exists).

Also all of the tables are created in an empty database by SchemaValidationTest.cs
DatabaseSchemaCreation_Produces_DatabaseSchemaResult_With_Zero_Errors

* Might aswell run against macOS also.

* Copy azure pipelines task header layout

* Delete SQLCe projects

* Remove SQL CE specific code.

* Remove SQL CE NuSpec, template params, build script setup

* Delete umbraco-netcore-only.sln

* Add SkipTests solution configuration and use for codeql

* Remove reference to deleted nuspec file.

* Refactor ConnectionStrings WRT DataDirectory placeholder & ProviderName.

At this point you can try out SQLite support by setting the following
in appsettings.json and then completing the install process.

"ConnectionStrings": {
  "umbracoDbDSN": "Data Source=|DataDirectory|/umbraco.sqlite",
  "umbracoDbDSN_ProviderName": "System.Data.SQLite"
},

Not currently possible via installer UI without provider name pre-set in
configuration.

* Switch to Microsoft.Data.Sqlite

Some gross hacks but will be good to find out if this works
with apple silicon.

* Enable selection of SQLite via installer UI (also quick install)

* Remove SqlServerDbProviderFactoryCreator to cleanup a TODO

* Move SQL Server support to its own class library

* Add persistence dependencies to Umbraco.CMS metapackage

* Bugfix packages delete query

Created invalid query for SQLite.

* Try out cypress tests Linux + SQLite

* Prevent cypress test artifact upload failure on attempt 2+

* LocalDb bugfixes

* Drop redundant enum

* Move SqlClient constant

* Misc whitespace

* Remove IsSqlCe extension (TODO: drop non 9->10 migrations later).

* Umbraco.Persistence.* -> Umbraco.Cms.Persistence.*

* Display quick install defaults and per provider default database name.

* Misc remove old comment

* little re-arrange

* Remove almost all usages of IsSqlite extension.

* visual adjustments

* Custom Database Configuration is last step and should then say Install.

* use text instead of disabled inputs

* move legend, rename to Install

* Update SqlMainDomLock to work without distributed locks.

* Added IDistributedLockingMechanism interface and in memory impl.

* Drop locking from ISqlSyntaxProvider & wire up scope to abstraction.

* Added SqlServerDistributedLockingMechanism

* Move distributed locking interfaces and exceptions to Core + xmldocs.

* Fix tests, Misc cleanup, Add SQL distributed locking integration tests

* Provide mechanism to specify DistributedLockingMechanism in config
(even if added by composer)

* Nomplementation -> NoImplementation

* Fix misleading comment

* Integration tests use SqlServerDistributedLockingMechanism when possible

* Handle up-gradable locks SqlServerDistributedLockingMechanism.
TODO: InMemoryDistributedLockingMechanism.

Note: Nuked SqlServerDistributedLockingMechanismTests, will still sleep
at night.
Is covered by Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.LockTests

* Make tests pass for InMemoryDistributedLockingMechanism, pretty hacky.

* Tweak constraints on WithCollectionBuilder so i can drop bad constructor

* Added SqliteDistributedLockingMechanism

* Dropped InMemoryDistributedMechanism + magic

InMemoryDistributedMechanism was pretty rubbish and now we have
a decent implementation for SQLite as we no longer block readers
see 8d1f42b.

Also drop the CollectionBuilder setup, instead do the same as we do
for syntax providers etc, it's more automagical so we never require an
explicit selection although we are allowing for it.

However keeping the optional IUmbracoBuilder constructor param for
CollectionBuilders as it's extremely useful.

* Fix quick install "" database name.

* Hide Database Configuration section when a connection string is pre-set.

Doesn't seem worth it to extract db name from connection string.

* Ensure wal test 2+

* Fix logging inconsistencies.

* Ensure in transaction when obtaining locks + no-op the SQLite read lock.

There's no point in running the query just to make a single test pass.

* Fix installer database display names

* Allow SQLite shared cache without losing deferred transactions

* Opt into shared cache for new SQLite databases + fix filename

* Fix misc inconsistency in .gitignore

* Prefer our interceptor interface

* Restore DEBUG_DATABASES code OnConnectionOpened in case it's used.

* Back to private cache.

* Added retry strategy for SQLite + refactor out SQL server specific stuff

* Fix SQL server tests.

* Misc - Orphaned comment, incorrect casing.

* InMemory SQLite test database & turn shared cache back on everywhere.

Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
2022-03-11 17:14:20 +01:00
Ronald Barendse
2dc9ccda6d Disable packaging of JsonSchema and test projects 2022-02-24 10:24:27 +01:00
Paul Johnson
2ead758a99 Update to npoco5 2022-01-18 15:23:53 +00:00
Elitsa Marinovska
61f459670c Update to .NET6 and ASP.NET Core 6 (#11652)
* Changed targetFramework in nuspec file & project files + updated NuGet dependencies

* Updated .net version in pipelines

* Updated .net version in templates

* Update more dependencies

* Fixed ambiguous call to DistinctBy() - part of Umbraco.Extensions and System.Linq

* Disabling the Razor source generators in .NET 6 due to error: "Cannot find the fallback endpoint specified by route values..."

* Fixed unit tests

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-11-18 15:35:42 +01:00
Paul Johnson
00133e880d Move test projects from src/ to tests/ (#11357)
* Update gitignore

* Move csproj

* Update project references

* Update solutions

* Update build scripts

* Tests used to share editorconfig with projects in src

* Fix broken tests.

* Stop copying around .editorconfig

merged root one with linting

* csharp_style_expression_bodied -> suggestion

* Move StyleCop rulesets to matching directories and update shared build properties

* Remove legacy build files, update NuGet.cofig and solution files

* Restore myget source

* Clean up .gitignore

* Update .gitignore

* Move new test classes to tests after merge

* Gitignore + nuget config

* Move new test

Co-authored-by: Ronald Barendse <ronald@barend.se>
2021-10-18 08:14:04 +01:00