Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
package:
name: Build & package
runs-on: ubuntu-22.04 # Important - later versions of ubuntu have a different .NET SDK which breaks trscli. Review on .NET 9 upgrade
runs-on: ubuntu-22.04 # Important - later versions of ubuntu have a different .NET SDK which breaks trscli. Review on .NET 9 upgrade
env:
CONTAINER_REGISTRY: ghcr.io

Expand All @@ -25,7 +25,7 @@ jobs:

- uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.0.x
global-json-file: TeachingRecordSystem/global.json

- name: Get Docker image tag
id: image_tags
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ jobs:

- uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.0.x
global-json-file: TeachingRecordSystem/global.json

- name: Install tools
run: just install-tools

- name: Lint
run: cd TeachingRecordSystem && dotnet dotnet-format --verify-no-changes
run: cd TeachingRecordSystem && dotnet format --verify-no-changes

validate_terraform:
name: Validate Terraform
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:

- uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.0.x
global-json-file: TeachingRecordSystem/global.json

- name: Install tools
run: just install-tools
Expand Down Expand Up @@ -162,7 +162,7 @@ jobs:

- uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.0.x
global-json-file: TeachingRecordSystem/global.json

- name: Install tools
run: just install-tools
Expand Down Expand Up @@ -196,7 +196,7 @@ jobs:
- name: Install Playwright if required
run: |
if [[ "$PROJECT_NAME" =~ .*EndToEndTests ]]; then
pwsh ./bin/Release/net9.0/playwright.ps1 install chromium
pwsh ./bin/Release/net10.0/playwright.ps1 install chromium
fi
working-directory: TeachingRecordSystem/tests/TeachingRecordSystem.${{ matrix.project_short_name }}
env:
Expand Down
9 changes: 1 addition & 8 deletions TeachingRecordSystem/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
"version": 1,
"isRoot": true,
"tools": {
"dotnet-format": {
"version": "9.0.520307",
"commands": [
"dotnet-format"
],
"rollForward": false
},
"dotnet-ef": {
"version": "9.0.10",
"commands": [
Expand All @@ -31,4 +24,4 @@
"rollForward": false
}
}
}
}
4 changes: 2 additions & 2 deletions TeachingRecordSystem/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>13.0</LangVersion>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>14.0</LangVersion>
<TreatWarningsAsErrors Condition="'$(Configuration)' == 'Release'">true</TreatWarningsAsErrors>
<AnalysisMode>Recommended</AnalysisMode>
<Nullable>enable</Nullable>
Expand Down
42 changes: 20 additions & 22 deletions TeachingRecordSystem/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,24 @@
<PackageVersion Include="JustEat.HttpClientInterception" Version="5.1.2" />
<PackageVersion Include="LinqKit" Version="1.2.5" />
<PackageVersion Include="MediatR" Version="12.2.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.10" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="9.0.10" />
<PackageVersion Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="9.0.10" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.10" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="10.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="9.0.11" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.11" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="6.1.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.10" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.10" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.10" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.11" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.11" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.11" />
<PackageVersion Include="Microsoft.Extensions.Azure" Version="1.13.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Options.DataAnnotations" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options.DataAnnotations" Version="10.0.0" />
<PackageVersion Include="Microsoft.Identity.Web" Version="4.0.1" />
<PackageVersion Include="Microsoft.Identity.Web.GraphServiceClientBeta" Version="4.0.1" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.14.0" />
Expand All @@ -75,8 +75,8 @@
<PackageVersion Include="NSign.Client" Version="1.2.1" />
<PackageVersion Include="NSign.SignatureProviders" Version="1.2.1" />
<PackageVersion Include="OneOf" Version="3.0.271" />
<PackageVersion Include="OpenIddict.AspNetCore" Version="7.2.0" />
<PackageVersion Include="OpenIddict.EntityFrameworkCore" Version="7.2.0" />
<PackageVersion Include="OpenIddict.AspNetCore" Version="7.1.0" />
<PackageVersion Include="OpenIddict.EntityFrameworkCore" Version="7.1.0" />
<PackageVersion Include="Optional" Version="4.0.0" />
<PackageVersion Include="Parquet.Net" Version="4.24.0" />
<PackageVersion Include="Polly.Core" Version="8.6.4" />
Expand All @@ -100,10 +100,8 @@
<PackageVersion Include="Swashbuckle.AspNetCore.Annotations" Version="6.6.2" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-rc.2.25502.107" />
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="8.14.0" />
<PackageVersion Include="System.Linq.Async" Version="6.0.3" />
<PackageVersion Include="System.Net.Http.Json" Version="9.0.10" />
<PackageVersion Include="System.Reactive" Version="6.1.0" />
<PackageVersion Include="System.Text.Json" Version="9.0.10" />
<PackageVersion Include="System.Text.Json" Version="10.0.0" />
<PackageVersion Include="xunit.analyzers" Version="1.23.0" />
<PackageVersion Include="xunit.core" Version="2.9.3" />
<PackageVersion Include="Xunit.DependencyInjection" Version="8.9.1" />
Expand All @@ -112,4 +110,4 @@
<PackageVersion Include="xunit.v3.assert" Version="3.2.0" />
<PackageVersion Include="xunit.v3.extensibility.core" Version="3.2.0" />
</ItemGroup>
</Project>
</Project>
12 changes: 6 additions & 6 deletions TeachingRecordSystem/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# syntax=docker/dockerfile:1
FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine3.21
FROM mcr.microsoft.com/dotnet/aspnet:10.0-alpine3.22
ARG GIT_SHA
ENV SENTRY_RELEASE=${GIT_SHA}
ENV GIT_SHA=${GIT_SHA}
ENV ASPNETCORE_HTTP_PORTS=3000
COPY src/TeachingRecordSystem.Api/bin/Release/net9.0/publish/ Apps/Api/
COPY src/TeachingRecordSystem.Cli/bin/Release/net9.0/publish/ Apps/TrsCli/
COPY src/TeachingRecordSystem.SupportUi/bin/Release/net9.0/publish/ Apps/SupportUi/
COPY src/TeachingRecordSystem.Worker/bin/Release/net9.0/publish/ Apps/Worker/
COPY src/TeachingRecordSystem.AuthorizeAccess/bin/Release/net9.0/publish/ Apps/AuthorizeAccess/
COPY src/TeachingRecordSystem.Api/bin/Release/net10.0/publish/ Apps/Api/
COPY src/TeachingRecordSystem.Cli/bin/Release/net10.0/publish/ Apps/TrsCli/
COPY src/TeachingRecordSystem.SupportUi/bin/Release/net10.0/publish/ Apps/SupportUi/
COPY src/TeachingRecordSystem.Worker/bin/Release/net10.0/publish/ Apps/Worker/
COPY src/TeachingRecordSystem.AuthorizeAccess/bin/Release/net10.0/publish/ Apps/AuthorizeAccess/
COPY db.sh Apps/db.sh
WORKDIR /Apps

Expand Down
1 change: 1 addition & 0 deletions TeachingRecordSystem/TeachingRecordSystem.sln
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
..\Makefile = ..\Makefile
nuget.config = nuget.config
..\README.md = ..\README.md
global.json = global.json
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TeachingRecordSystem.TestCommon", "tests\TeachingRecordSystem.TestCommon\TeachingRecordSystem.TestCommon.csproj", "{DFE6654C-3222-4B20-A871-79581928D3B2}"
Expand Down
6 changes: 6 additions & 0 deletions TeachingRecordSystem/global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "10.0.100",
"rollForward": "latestFeature"
}
}
4 changes: 0 additions & 4 deletions TeachingRecordSystem/nuget.config
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="dotnet9" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" />
<add key="lib" value="lib" />
</packageSources>
<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
<packageSource key="dotnet9">
<package pattern="dotnet-format" />
</packageSource>
<packageSource key="lib">
<package pattern="Dfe.Analytics" />
</packageSource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ public Task BindModelAsync(ModelBindingContext bindingContext)
{
if (!Enum.TryParse(modelType, v, ignoreCase: true, out var parsed))
{
logger.LogDebug("Failed to parse '{Value}' as {ModelType}.", v, modelType);
#pragma warning disable CA1873
logger.LogDebug("Failed to parse '{Value}' as {ModelType}.", v, modelType.Name);
#pragma warning restore CA1873

bindingContext.Result = ModelBindingResult.Failed();
return Task.CompletedTask;
Expand All @@ -44,7 +46,9 @@ public Task BindModelAsync(ModelBindingContext bindingContext)
}
else
{
logger.LogDebug("Value '{Result}' is not a single flag of {ModelType}.", parsed, modelType);
#pragma warning disable CA1873
logger.LogDebug("Value '{Result}' is not a single flag of {ModelType}.", parsed, modelType.Name);
#pragma warning restore CA1873

bindingContext.Result = ModelBindingResult.Failed();
return Task.CompletedTask;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static async Task<InductionInfo> CreateAsync(
CompletedDate = person.InductionCompletedDate,
ExemptionReasons = await person.GetAllInductionExemptionReasonIds()
.ToAsyncEnumerable()
.SelectAwait(async id => await referenceDataCache.GetInductionExemptionReasonByIdAsync(id))
.Select(async (Guid id, CancellationToken _) => await referenceDataCache.GetInductionExemptionReasonByIdAsync(id))
.ToArrayAsync()
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected async Task<FindPersonsResult> CreateResultAsync(IReadOnlyCollection<Gu
.ToAsyncEnumerable()
.Where(id => persons.ContainsKey(id))
.Select(id => persons[id])
.SelectAwait(async person => new FindPersonsResultItem()
.Select(async (PostgresModels.Person person, CancellationToken _) => new FindPersonsResultItem()
{
Trn = person.Trn!,
DateOfBirth = person.DateOfBirth!.Value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ await MapRoutesToProfessionalStatusesAsync(
CertificateUrl = certificateUrl,
ExemptionReasons = await person.GetAllInductionExemptionReasonIds()
.ToAsyncEnumerable()
.SelectAwait(async id => await referenceDataCache.GetInductionExemptionReasonByIdAsync(id))
.Select(async (Guid id, CancellationToken _) => await referenceDataCache.GetInductionExemptionReasonByIdAsync(id))
.ToArrayAsync()
};

Expand Down Expand Up @@ -439,7 +439,7 @@ private async Task<IEnumerable<GetPersonResultRouteToProfessionalStatus>> MapRou
IEnumerable<PostgresModels.RouteToProfessionalStatus> routes) =>
await routes
.ToAsyncEnumerable()
.SelectAwait(async r => new GetPersonResultRouteToProfessionalStatus()
.Select(async (PostgresModels.RouteToProfessionalStatus r, CancellationToken _) => new GetPersonResultRouteToProfessionalStatus()
{
RouteToProfessionalStatusId = r.QualificationId,
RouteToProfessionalStatusType = r.RouteToProfessionalStatusType!,
Expand All @@ -448,8 +448,8 @@ await routes
TrainingStartDate = r.TrainingStartDate,
TrainingEndDate = r.TrainingEndDate,
TrainingSubjects = await r.TrainingSubjectIds.ToAsyncEnumerable()
.SelectAwait(async id => await referenceDataCache.GetTrainingSubjectByIdAsync(id))
.ToArrayAsync(),
.Select(async (Guid id, CancellationToken _) => await referenceDataCache.GetTrainingSubjectByIdAsync(id))
.ToArrayAsync(CancellationToken.None),
TrainingAgeSpecialism = TrainingAgeSpecialismExtensions.FromRoute(r),
TrainingCountry = TrainingCountry.FromModel(r.TrainingCountry),
TrainingProvider = r.TrainingProvider,
Expand All @@ -473,7 +473,7 @@ private async Task<IEnumerable<GetPersonResultInitialTeacherTraining>> MapInitia
IEnumerable<PostgresModels.RouteToProfessionalStatus> routes) =>
await routes
.ToAsyncEnumerable()
.SelectAwait(async r => new GetPersonResultInitialTeacherTraining()
.Select(async (PostgresModels.RouteToProfessionalStatus r, CancellationToken _) => new GetPersonResultInitialTeacherTraining()
{
Qualification = null,
StartDate = r.TrainingStartDate,
Expand All @@ -486,9 +486,9 @@ await routes
? new GetPersonResultInitialTeacherTrainingProvider { Name = trainingProvider.Name, Ukprn = trainingProvider.Ukprn }
: null,
Subjects = await r.TrainingSubjectIds.ToAsyncEnumerable()
.SelectAwait(async id => await referenceDataCache.GetTrainingSubjectByIdAsync(id))
.Select(async (Guid id, CancellationToken _) => await referenceDataCache.GetTrainingSubjectByIdAsync(id))
.Select(subject => new GetPersonResultInitialTeacherTrainingSubject() { Code = subject.Reference, Name = subject.Name })
.ToArrayAsync()
.ToArrayAsync(CancellationToken.None)
})
.ToArrayAsync();

Expand Down
Loading
Loading