Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Create Umbraco/Bellissima Package (Take Two) #17044

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<NeutralLanguage>en-US</NeutralLanguage>
<Nullable>enable</Nullable>
<WarningsAsErrors>nullable</WarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<ImplicitUsings>enable</ImplicitUsings>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
Expand Down
1 change: 0 additions & 1 deletion src/Umbraco.Cms.Api.Common/Umbraco.Cms.Api.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<Title>Umbraco CMS - API Common</Title>
<Description>Contains the bits and pieces that are shared between the Umbraco CMS APIs.</Description>
</PropertyGroup>

<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion src/Umbraco.Cms.Api.Delivery/Umbraco.Cms.Api.Delivery.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
<Title>Umbraco CMS - Delivery API</Title>
<Description>Contains the presentation layer for the Umbraco CMS Delivery API.</Description>
</PropertyGroup>

<PropertyGroup>
<!-- TODO: [ASP0019] use IHeaderDictionary.Append or the indexer to append or set headers and remove this override -->
<WarningsNotAsErrors>ASP0019</WarningsNotAsErrors>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Umbraco.Cms.Api.Common\Umbraco.Cms.Api.Common.csproj" />
<ProjectReference Include="..\Umbraco.Web.Common\Umbraco.Web.Common.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Asp.Versioning;
using Asp.Versioning;
using Examine;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
Expand Down Expand Up @@ -38,7 +38,7 @@ public RebuildIndexerController(
[ProducesResponseType(StatusCodes.Status200OK)]
public async Task<IActionResult> Rebuild(CancellationToken cancellationToken, string indexName)
{
if (!_examineManager.TryGetIndex(indexName, out var index))
if (!_examineManager.TryGetIndex(indexName, out IIndex? index))
{
var invalidModelProblem = new ProblemDetails
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using System;
using System;
using System.Threading.Tasks;
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Infrastructure.ModelsBuilder;
Expand All @@ -16,12 +17,13 @@ public class BuildModelsBuilderController : ModelsBuilderControllerBase
{
private ModelsBuilderSettings _modelsBuilderSettings;
private readonly ModelsGenerationError _mbErrors;
private readonly ModelsGenerator _modelGenerator;
private readonly IModelsGenerator _modelGenerator;

[ActivatorUtilitiesConstructor]
public BuildModelsBuilderController(
IOptionsMonitor<ModelsBuilderSettings> modelsBuilderSettings,
ModelsGenerationError mbErrors,
ModelsGenerator modelGenerator)
IModelsGenerator modelGenerator)
{
_mbErrors = mbErrors;
_modelGenerator = modelGenerator;
Expand All @@ -30,6 +32,26 @@ public BuildModelsBuilderController(
modelsBuilderSettings.OnChange(x => _modelsBuilderSettings = x);
}

[Obsolete("Please use the constructor that accepts IModelsGenerator only. Will be removed in V16.")]
public BuildModelsBuilderController(
IOptionsMonitor<ModelsBuilderSettings> modelsBuilderSettings,
ModelsGenerationError mbErrors,
ModelsGenerator modelGenerator)
: this(modelsBuilderSettings, mbErrors, (IModelsGenerator)modelGenerator)
{
}

// this constructor is required for the DI, otherwise it'll throw an "Ambiguous Constructor" errors at boot time.
[Obsolete("Please use the constructor that accepts IModelsGenerator only. Will be removed in V16.")]
public BuildModelsBuilderController(
IOptionsMonitor<ModelsBuilderSettings> modelsBuilderSettings,
ModelsGenerationError mbErrors,
IModelsGenerator modelGenerator,
ModelsGenerator notUsed)
: this(modelsBuilderSettings, mbErrors, modelGenerator)
{
}

[HttpPost("build")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status428PreconditionRequired)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Security.Claims;
using System.Security.Claims;
using Asp.Versioning;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Authentication;
Expand Down Expand Up @@ -281,7 +281,7 @@ public async Task<IActionResult> LinkLoginKey(string provider)
/// <summary>
/// Called when a user links an external login provider in the back office
/// </summary>
/// <param name="provider"></param>
/// <param name="requestModel"></param>
/// <returns></returns>
// This method is marked as AllowAnonymous and protected with a secret (linkKey) inside the model for the following reasons
// - when a js client uses the fetch api (or old ajax requests) they can send a bearer token
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Umbraco.Cms.Api.Management.ViewModels.MediaType;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Api.Management.ViewModels.MediaType;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.ContentTypeEditing;
using Umbraco.Cms.Core.Services;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
<AssemblyName>Umbraco.Cms.Api.Management</AssemblyName>
<RootNamespace>Umbraco.Cms.Api.Management</RootNamespace>
</PropertyGroup>

<PropertyGroup>
<!-- TODO: Fix all warnings and remove this override -->
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="JsonPatch.Net" />
<PackageReference Include="Swashbuckle.AspNetCore" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<Title>Umbraco CMS - Imaging - ImageSharp</Title>
<Description>Adds imaging support using ImageSharp/ImageSharp.Web to Umbraco CMS.</Description>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="SixLabors.ImageSharp" />
<PackageReference Include="SixLabors.ImageSharp.Web" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<Title>Umbraco CMS - Imaging - ImageSharp 2</Title>
<Description>Adds imaging support using ImageSharp/ImageSharp.Web version 2 to Umbraco CMS.</Description>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="SixLabors.ImageSharp" VersionOverride="[2.1.9, 3)" />
<PackageReference Include="SixLabors.ImageSharp.Web" VersionOverride="[2.0.2, 3)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<Title>Umbraco CMS - Persistence - Entity Framework Core - SQL Server migrations</Title>
<Description>Adds support for Entity Framework Core SQL Server migrations to Umbraco CMS.</Description>
</PropertyGroup>

<ItemGroup>
<!-- Take top-level depedendency on Azure.Identity, because Microsoft.EntityFrameworkCore.SqlServer depends on a vulnerable version -->
<PackageReference Include="Azure.Identity" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<Title>Umbraco CMS - Persistence - Entity Framework Core - SQLite migrations</Title>
<Description>Adds support for Entity Framework Core SQLite migrations to Umbraco CMS.</Description>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,7 @@ public override string ToString()
// Mostly no-op just check that we didn't end up ReadUncommitted for real.
private void ObtainReadLock()
{
IEfCoreScope<T>? efCoreScope = _parent._efCoreScopeAccessor.Value.AmbientScope;

if (efCoreScope is null)
{
throw new PanicException("No current ambient scope");
}
IEfCoreScope<T>? efCoreScope = _parent._efCoreScopeAccessor.Value.AmbientScope ?? throw new PanicException("No current ambient scope");

efCoreScope.ExecuteWithContextAsync<Task>(async database =>
{
Expand All @@ -136,12 +131,7 @@ private void ObtainReadLock()
// lock occurs for entire database as opposed to row/table.
private void ObtainWriteLock()
{
IEfCoreScope<T>? efCoreScope = _parent._efCoreScopeAccessor.Value.AmbientScope;

if (efCoreScope is null)
{
throw new PanicException("No ambient scope");
}
IEfCoreScope<T>? efCoreScope = _parent._efCoreScopeAccessor.Value.AmbientScope ?? throw new PanicException("No ambient scope");

efCoreScope.ExecuteWithContextAsync<Task>(async database =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
<Title>Umbraco CMS - Persistence - Entity Framework Core</Title>
<Description>Adds support for Entity Framework Core to Umbraco CMS.</Description>
</PropertyGroup>

<ItemGroup>
<PropertyGroup>
<!-- TODO: [IDE0270] Simplify null checks, [CS0108] resolve hiding inherited members, [CS1998] remove async or make method synchronous,
and remove this override -->
<WarningsNotAsErrors>IDE0270,CS0108,CS1998</WarningsNotAsErrors>
</PropertyGroup>
<ItemGroup>
<!-- Take top-level depedendency on Azure.Identity, because Microsoft.EntityFrameworkCore.SqlServer depends on a vulnerable version -->
<PackageReference Include="Azure.Identity" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" />
Expand Down
Loading
Loading