Skip to content

Commit 71cb3b5

Browse files
Merge pull request #682 from PathfinderHonorManager/develop
Upgraded fluent validation
2 parents d541ea8 + a0b0c31 commit 71cb3b5

File tree

7 files changed

+17
-12
lines changed

7 files changed

+17
-12
lines changed

.github/workflows/main_pathfinderhonormanager.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v4
2020
- uses: ./.github/actions/setup-dotnet
21-
- name: Build solution
21+
- name: Build solution (Debug)
2222
run: dotnet build --no-incremental
2323
- name: Test with the dotnet CLI (OpenCover)
2424
run: dotnet test PathfinderHonorManager.Tests/PathfinderHonorManager.Tests.csproj /p:CollectCoverage=true /p:CoverletOutput=TestResults/coverage.opencover.xml /p:CoverletOutputFormat=opencover /p:Exclude="[PathfinderHonorManager.Tests*]*"
@@ -65,7 +65,7 @@ jobs:
6565
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
6666
run: |
6767
./.sonar/scanner/dotnet-sonarscanner begin /k:"PathfinderHonorManager_PathfinderHonorManagerAPI" /o:"pathfinderhonormanager" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="coverage.opencover.xml"
68-
- name: Build solution (SonarQube)
68+
- name: Build solution (for SonarQube)
6969
run: dotnet build --no-incremental
7070
- name: SonarQube end analysis
7171
env:
@@ -74,15 +74,13 @@ jobs:
7474

7575
build:
7676
needs: [sonar, test]
77+
if: github.ref == 'refs/heads/main'
7778
runs-on: ubuntu-latest
7879
steps:
7980
- uses: actions/checkout@v4
80-
8181
- uses: ./.github/actions/setup-dotnet
82-
83-
- name: Build with dotnet
82+
- name: Build with dotnet (Release)
8483
run: dotnet build --configuration Release
85-
8684
- name: dotnet publish
8785
run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp
8886

@@ -100,7 +98,6 @@ jobs:
10098
name: .net-app
10199
path: ${{env.DOTNET_ROOT}}/myapp
102100

103-
# Deployment job that only runs on main
104101
deploy:
105102
needs: build
106103
runs-on: ubuntu-latest

PathfinderHonorManager.Tests/PathfinderHonorManager.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1313
<PrivateAssets>all</PrivateAssets>
1414
</PackageReference>
15-
<PackageReference Include="FluentValidation" Version="11.11.0" />
15+
<PackageReference Include="FluentValidation" Version="12.0.0" />
1616
<PackageReference Include="Moq" Version="4.20.72" />
1717
<PackageReference Include="NUnit" Version="4.3.2" />
1818
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
1919
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
2020
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="9.0.4" />
2121
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.4" />
2222
<PackageReference Include="FluentValidation.Validators.UnitTestExtension" Version="1.11.0.2" />
23-
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.11.0" />
23+
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="12.0.0" />
2424
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.4" />
2525
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.4" />
2626
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />

PathfinderHonorManager/Auth/HasScopeHandler.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
using System.Linq;
22
using System.Threading.Tasks;
33
using Microsoft.AspNetCore.Authorization;
4+
using System.Diagnostics.CodeAnalysis;
45

56
namespace PathfinderHonorManager.Auth
67
{
8+
[ExcludeFromCodeCoverage]
79
public class HasScopeHandler : AuthorizationHandler<HasScopeRequirement>
810
{
911
protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, HasScopeRequirement requirement)

PathfinderHonorManager/Auth/HasScopeRequirement.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
using System;
22
using Microsoft.AspNetCore.Authorization;
3+
using System.Diagnostics.CodeAnalysis;
34

45
namespace PathfinderHonorManager.Auth
56
{
7+
[ExcludeFromCodeCoverage]
68
public class HasScopeRequirement : IAuthorizationRequirement
79
{
810
public string Issuer { get; }

PathfinderHonorManager/Controllers/AbstractController.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using Microsoft.AspNetCore.Mvc;
2+
using System.Diagnostics.CodeAnalysis;
23

34
namespace PathfinderHonorManager.Controllers
45
{
6+
[ExcludeFromCodeCoverage]
57
public abstract class CustomApiController : Controller
68
{
79
[NonAction]

PathfinderHonorManager/PathfinderHonorManager.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
<PropertyGroup Condition=" '$(RunConfiguration)' == 'PathfinderHonorManager' " />
1111
<ItemGroup>
12-
<PackageReference Include="FluentValidation" Version="11.11.0" />
13-
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.11.0" />
12+
<PackageReference Include="FluentValidation" Version="12.0.0" />
13+
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="12.0.0" />
1414
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.4" />
1515
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.4" />
1616
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.4" />
@@ -19,7 +19,7 @@
1919
<PackageReference Include="Npgsql" Version="9.0.3" />
2020
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="9.0.4" />
2121
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
22-
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.0" />
22+
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.1" />
2323
<PackageReference Include="Swashbuckle.AspNetCore" Version="8.1.1" />
2424
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="9.0.4" />
2525
<PackageReference Include="AspNetCore.HealthChecks.NpgSql" Version="9.0.0" />

PathfinderHonorManager/Swagger/HealthCheckEndpointFilter.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
33
using Microsoft.OpenApi.Models;
44
using Swashbuckle.AspNetCore.SwaggerGen;
5+
using System.Diagnostics.CodeAnalysis;
56

67
namespace PathfinderHonorManager.Swagger
78
{
9+
[ExcludeFromCodeCoverage]
810
public class HealthCheckEndpointFilter : IDocumentFilter
911
{
1012
public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)

0 commit comments

Comments
 (0)