diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index a62fb4c..3e52dfd 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -19,9 +19,9 @@ jobs: github.event_name == 'workflow_dispatch' }} uses: simplify9/.github/.github/workflows/reusable-service-cicd.yml@main with: - major-version: '8' + major-version: '10' minor-version: '0' - dotnet-version: '8.0.x' + dotnet-version: '10.0.x' # Build + push the SDK NuGet package (tests off, as before) nuget-projects: 'SW.Surl.Sdk/SW.Surl.Sdk.csproj' diff --git a/Dockerfile b/Dockerfile index f156c70..48ca949 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base WORKDIR /app # .NET 8+ listens on 8080 by default; the surl Helm chart sends traffic to containerPort 80. ENV ASPNETCORE_HTTP_PORTS=80 EXPOSE 80 EXPOSE 443 -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build WORKDIR /src COPY ["SW.Surl.Web/SW.Surl.Web.csproj", "SW.Surl.Web/"] COPY ["SW.Surl.Sdk/SW.Surl.Sdk.csproj", "SW.Surl.Sdk/"] diff --git a/SW.Surl.Sdk/SW.Surl.Sdk.csproj b/SW.Surl.Sdk/SW.Surl.Sdk.csproj index ef05a3b..71bc335 100644 --- a/SW.Surl.Sdk/SW.Surl.Sdk.csproj +++ b/SW.Surl.Sdk/SW.Surl.Sdk.csproj @@ -1,7 +1,7 @@ - net8.0 + net10.0 SimplyWorks.Surl.Sdk SimplyWorks SimplyWorks.Surl.Sdk @@ -9,7 +9,7 @@ - + diff --git a/SW.Surl.Web/SW.Surl.Web.csproj b/SW.Surl.Web/SW.Surl.Web.csproj index 5f7d74c..ad4d826 100644 --- a/SW.Surl.Web/SW.Surl.Web.csproj +++ b/SW.Surl.Web/SW.Surl.Web.csproj @@ -1,6 +1,6 @@  - net8.0 + net10.0 @@ -8,16 +8,16 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - + + + + + + diff --git a/SW.Surl.Web/Startup.cs b/SW.Surl.Web/Startup.cs index 063b6e5..7b857a6 100644 --- a/SW.Surl.Web/Startup.cs +++ b/SW.Surl.Web/Startup.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -52,6 +53,11 @@ public void ConfigureServices(IServiceCollection services) services.AddDbContext(c => { c.EnableSensitiveDataLogging(true); + // created_on is timestamp without time zone in the database but the model maps DateTime + // to timestamptz (Npgsql 6+), which EF 8 ignored and EF 9+ reports as a pending change and + // throws on in Migrate(). Pinning the column type would make Npgsql refuse the UTC + // CreatedOn values the audit writes, so keep EF 8's behaviour. + c.ConfigureWarnings(w => w.Ignore(RelationalEventId.PendingModelChangesWarning)); c.UseSnakeCaseNamingConvention(); c.UseNpgsql(Configuration.GetConnectionString(SurlDbContext.ConnectionString), b => { @@ -79,6 +85,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseEndpoints(endpoints => { endpoints.MapControllers(); + endpoints.MapCqApi(); }); } }