Skip to content

Commit

Permalink
v11: Decouple dependencies (umbraco#12907)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ronaldbarendse authored Sep 27, 2022
1 parent d206df0 commit 3873a07
Show file tree
Hide file tree
Showing 90 changed files with 1,048 additions and 1,337 deletions.
8 changes: 4 additions & 4 deletions .github/New BackOffice - README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# New Backoffice
# New backoffice

> **Warning**:
> This is an early WIP, and is set not to be packable since we don't want to release this yet. There will be breaking changes in these projects
> This is an early WIP and is set not to be packable since we don't want to release this yet. There will be breaking changes in these projects.
This solution folder contains the projects for the new BackOffice. If you're looking to fix or improve the existing CMS, this is not the place to do it, although we do very much appreciate your efforts.
This solution folder contains the projects for the new backoffice. If you're looking to fix or improve the existing CMS, this is not the place to do it, although we do very much appreciate your efforts.

### Project structure

Since the new backoffice API is still very much a work in progress we've created new projects for the new backoffice API:
Since the new backoffice API is still very much a work in progress, we've created new projects for the new backoffice API:

* Umbrao.Cms.ManagementApi - The "presentation layer" for the management API
* "New" versions of existing projects, should be merged with the existing projects when the new API is released:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,6 @@ cypress.env.json
/tests/Umbraco.Tests.UnitTests/[Uu]mbraco/[Dd]ata/TEMP/

# Ignore auto-generated schema
/src/Umbraco.Cms.Targets/appsettings-schema.json
/src/Umbraco.Web.UI/appsettings-schema.json
/src/Umbraco.Cms/appsettings-schema.json
/tests/Umbraco.Tests.Integration/appsettings-schema.json
50 changes: 40 additions & 10 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,18 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<!-- Package references and additional files which are consumed by all projects -->
<PropertyGroup>
<Company>Umbraco HQ</Company>
<Authors>Umbraco</Authors>
<Copyright>Copyright © Umbraco $([System.DateTime]::Today.ToString('yyyy'))</Copyright>
<Product>Umbraco CMS</Product>
<PackageProjectUrl>https://umbraco.com/</PackageProjectUrl>
<PackageIconUrl>https://umbraco.com/dist/nuget/logo-small.png</PackageIconUrl>
<PackageIcon>icon.png</PackageIcon>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageTags>umbraco</PackageTags>
<NeutralLanguage>en-US</NeutralLanguage>
<Nullable>enable</Nullable>
<WarningsAsErrors>nullable</WarningsAsErrors>
<ImplicitUsings>enable</ImplicitUsings>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<!-- SourceLink -->
<PropertyGroup>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<!-- Package Validation -->
<PropertyGroup>
<EnablePackageValidation>true</EnablePackageValidation>
<!-- TODO: Change to 11.0.0 and remove all CompatibilitySupressions.xml files when final version shipped -->
<PackageValidationBaselineVersion>10.1.0</PackageValidationBaselineVersion>
<EnableStrictModeForCompatibleFrameworksInPackage>true</EnableStrictModeForCompatibleFrameworksInPackage>
<EnableStrictModeForCompatibleTfms>true</EnableStrictModeForCompatibleTfms>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.406" PrivateAssets="all" IsImplicitlyDefined="true"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" IsImplicitlyDefined="true" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.5.113" PrivateAssets="all" IsImplicitlyDefined="true" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.406" PrivateAssets="all" IsImplicitlyDefined="true" />
<PackageReference Include="Umbraco.Code" Version="2.0.0" PrivateAssets="all" IsImplicitlyDefined="true" />
<PackageReference Include="Umbraco.GitVersioning.Extensions" Version="0.1.1" PrivateAssets="all" IsImplicitlyDefined="true" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Condition="!Exists('packages.config')">
<PrivateAssets>all</PrivateAssets>
<Version>3.5.113</Version>
</PackageReference>

<PackageReference Include="Umbraco.GitVersioning.Extensions" Version="0.1.1">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<Content Include="$(MSBuildThisFileDirectory)icon.png" Pack="true" PackagePath="" Visible="false" />
</ItemGroup>
</Project>
72 changes: 43 additions & 29 deletions build/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ parameters:
default: false

variables:
nodeVersion: 16.17.0
dotnetVersion: 7.x
solution: umbraco.sln
buildConfiguration: Release
SA_PASSWORD: UmbracoIntegration123!
UMBRACO__CMS_GLOBAL__ID: 00000000-0000-0000-0000-000000000042
nodeVersion: 14.18.1
DOTNET_NOLOGO: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
UMBRACO__CMS__GLOBAL__ID: 00000000-0000-0000-0000-000000000042
DOTNET_NOLOGO: true
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true

stages:
###############################################
Expand All @@ -44,7 +47,7 @@ stages:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
displayName: Use node $(nodeVersion)
displayName: Use Node.js $(nodeVersion)
inputs:
versionSpec: $(nodeVersion)
- task: Cache@2
Expand All @@ -65,16 +68,22 @@ stages:
targets: coreBuild
workingDirectory: src/Umbraco.Web.UI.Client
- task: UseDotNet@2
displayName: Use .NET 7.x
displayName: Use .NET $(dotnetVersion)
inputs:
version: 7.x
version: $(dotnetVersion)
performMultiLevelLookup: true
includePreviewVersions: true
- task: DotNetCoreCLI@2
displayName: Run dotnet restore
inputs:
command: restore
projects: $(solution)
- task: DotNetCoreCLI@2
displayName: Run dotnet build
inputs:
command: build
projects: umbraco.sln
arguments: '--configuration $(buildConfiguration)'
projects: $(solution)
arguments: '--configuration $(buildConfiguration) --no-restore -p:ContinuousIntegrationBuild=true'
- script: |
version="$(Build.BuildNumber)"
echo "varsion: $version"
Expand All @@ -101,7 +110,7 @@ stages:
}
}
dotnet pack --configuration $(buildConfiguration) umbraco.sln -o $(Build.ArtifactStagingDirectory)/nupkg
dotnet pack $(solution) --configuration $(buildConfiguration) --no-build --output $(Build.ArtifactStagingDirectory)/nupkg
- script: |
sha="$(Build.SourceVersion)"
sha=${sha:0:7}
Expand Down Expand Up @@ -178,9 +187,9 @@ stages:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
displayName: Use Node 10.15.0
displayName: Use Node.js 10.15.0
inputs:
versionSpec: 10.15.0 # Won't work with 14.18.1
versionSpec: 10.15.0 # Won't work with higher versions
- script: |
npm ci --no-fund --no-audit --prefer-offline
npx gulp docs
Expand Down Expand Up @@ -233,16 +242,17 @@ stages:
artifact: build_output
path: $(Build.SourcesDirectory)
- task: UseDotNet@2
displayName: Use net7
displayName: Use .NET $(dotnetVersion)
inputs:
version: 7.x
version: $(dotnetVersion)
performMultiLevelLookup: true
includePreviewVersions: true
- task: DotNetCoreCLI@2
displayName: Run dotnet test
inputs:
command: test
projects: '**/*.Tests.UnitTests.csproj'
arguments: '--no-build --configuration $(buildConfiguration)'
arguments: '--configuration $(buildConfiguration) --no-build'
testRunTitle: Unit Tests - $(Agent.OS)

- stage: Integration
Expand All @@ -269,16 +279,17 @@ stages:
artifact: build_output
path: $(Build.SourcesDirectory)
- task: UseDotNet@2
displayName: Use net7
displayName: Use .NET $(dotnetVersion)
inputs:
version: 7.x
version: $(dotnetVersion)
performMultiLevelLookup: true
includePreviewVersions: true
- task: DotNetCoreCLI@2
displayName: Run dotnet test
inputs:
command: test
projects: '**/*.Tests.Integration.csproj'
arguments: '--no-build --configuration $(buildConfiguration)'
arguments: '--configuration $(buildConfiguration) --no-build'
testRunTitle: Integration Tests SQLite - $(Agent.OS)
env:
Tests__Database__DatabaseType: 'Sqlite'
Expand All @@ -301,6 +312,8 @@ stages:
connectionString: 'Server=localhost,1433;User Id=sa;Password=$(SA_PASSWORD);'
pool:
vmImage: $(vmImage)
variables:
SA_PASSWORD: UmbracoIntegration123!
steps:
- task: DownloadPipelineArtifact@2
displayName: Download build artifacts
Expand All @@ -318,7 +331,7 @@ stages:
inputs:
command: test
projects: '**/*.Tests.Integration.csproj'
arguments: '--no-build --configuration $(buildConfiguration)'
arguments: '--configuration $(buildConfiguration) --no-build'
testRunTitle: Integration Tests SQL Server - $(Agent.OS)
env:
Tests__Database__DatabaseType: $(testDb)
Expand Down Expand Up @@ -371,7 +384,7 @@ stages:
artifact: nupkg
path: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/misc/nupkg
- task: NodeTool@0
displayName: Use Node $(nodeVersion)
displayName: Use Node.js $(nodeVersion)
inputs:
versionSpec: $(nodeVersion)
- task: Cache@2
Expand Down Expand Up @@ -403,9 +416,10 @@ stages:
displayName: Create database (Windows only)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
- task: UseDotNet@2
displayName: Use .Net 7.x
displayName: Use .NET $(dotnetVersion)
inputs:
version: 7.x
version: $(dotnetVersion)
performMultiLevelLookup: true
includePreviewVersions: true
# Linux containers smooth
- task: PowerShell@2
Expand All @@ -419,7 +433,7 @@ stages:
docker build -t $(dockerImageName):$sha -f $(dockerfile) .
mkdir -p $(Build.ArtifactStagingDirectory)/docker-images
docker save -o $(Build.ArtifactStagingDirectory)/docker-images/$(dockerImageName).$sha.tar $(dockerImageName):$sha
docker run --name $(dockerImageName) -dp 8080:5000 -e UMBRACO__CMS_GLOBAL__ID=$(UMBRACO__CMS_GLOBAL__ID) $(dockerImageName):$sha
docker run --name $(dockerImageName) -dp 8080:5000 -e UMBRACO__CMS__GLOBAL__ID=$(UMBRACO__CMS__GLOBAL__ID) $(dockerImageName):$sha
docker ps
# Windows containers take forever.
# --no-launch-profile stops ASPNETCORE_ENVIRONMENT=Development which breaks the users.ts tests (smtp config = invite user button)
Expand All @@ -434,8 +448,8 @@ stages:
dotnet new --install ./nupkg/Umbraco.Templates.*.nupkg
dotnet new umbraco --name Cypress -o . --no-restore
dotnet restore --configfile ./nuget.config
dotnet build --no-restore -c Release
Start-Process -FilePath "dotnet" -ArgumentList "run --no-build -c Release --no-launch-profile --urls $(CYPRESS_BASE_URL)"
dotnet build --configuration $(buildConfiguration) --no-restore
Start-Process -FilePath "dotnet" -ArgumentList "run --configuration $(buildConfiguration) --no-build --no-launch-profile --urls $(CYPRESS_BASE_URL)"
- task: PowerShell@2
displayName: Wait for app
inputs:
Expand Down Expand Up @@ -496,12 +510,12 @@ stages:
displayName: dotnet restore
inputs:
command: restore
projects: '**/umbraco.sln'
projects: $(solution)
# TODO: Use NuGetCommand instead of DotNetCoreCLI
# - task: NuGetCommand@2
# displayName: Restore NuGet Packages
# inputs:
# restoreSolution: 'umbraco.sln'
# restoreSolution: $(solution)
# feedsToUse: config
- stage: Deploy_NuGet
displayName: NuGet release
Expand All @@ -523,7 +537,7 @@ stages:
displayName: dotnet restore
inputs:
command: restore
projects: '**/umbraco.sln'
projects: $(solution)

- stage: Upload_API_Docs
pool:
Expand Down
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 0 additions & 53 deletions opened-issue-first-comment.yml

This file was deleted.

54 changes: 0 additions & 54 deletions src/Directory.Build.props

This file was deleted.

Loading

0 comments on commit 3873a07

Please sign in to comment.