Skip to content

Commit

Permalink
CPM and .NET 8.0 (#370)
Browse files Browse the repository at this point in the history
* CPM and .NET 8.0

* Fix autobuild issue, where CodeQL doesn't know about .NET 8.0 yet.

* Health checks
  • Loading branch information
IEvangelist committed Nov 20, 2023
1 parent bcbe2a6 commit a504f0d
Show file tree
Hide file tree
Showing 37 changed files with 268 additions and 183 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
uses: actions/setup-dotnet@main
with:
dotnet-version: |
7.0.x
8.0.x
- name: Install dependencies
run: dotnet restore
Expand All @@ -57,7 +57,7 @@ jobs:
uses: actions/setup-dotnet@main
with:
dotnet-version: |
7.0.x
8.0.x
- name: Install dependencies
run: dotnet restore
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,7 @@ jobs:
uses: actions/setup-dotnet@main
with:
dotnet-version: |
7.0.x
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
8.0.x
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -79,9 +74,12 @@ jobs:
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release
- name: Install dependencies
run: dotnet restore

- name: Build
run: |
dotnet build --configuration Release --no-restore
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
6 changes: 3 additions & 3 deletions .github/workflows/nuget-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: actions/setup-dotnet@main
with:
dotnet-version: |
7.0.x
8.0.x
- name: Install dependencies
run: dotnet restore

Expand All @@ -32,7 +32,7 @@ jobs:
uses: actions/setup-dotnet@main
with:
dotnet-version: |
7.0.x
8.0.x
- name: Install dependencies
run: dotnet restore

Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
uses: actions/setup-dotnet@main
with:
dotnet-version: |
7.0.x
8.0.x
- name: Restore ${{ matrix.project }} dependencies
run: dotnet restore ./src/${{ matrix.project }}/${{ matrix.project }}.csproj
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: actions/setup-dotnet@main
with:
dotnet-version: |
7.0.x
8.0.x
- name: Install dependencies
run: dotnet restore
Expand Down
3 changes: 2 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@

<PropertyGroup>
<CompatibilityTargetFrameworks>netstandard2.0</CompatibilityTargetFrameworks>
<DefaultTargetFrameworks>net7.0</DefaultTargetFrameworks>
<DefaultTargetFrameworks>net7.0;net8.0</DefaultTargetFrameworks>
<LangVersion>preview</LangVersion>
</PropertyGroup>

<PropertyGroup>
Expand Down
93 changes: 93 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<!-- TFM agnostic -->
<ItemGroup>
<PackageVersion Include="Bogus" Version="34.0.2" />
<PackageVersion Include="CorrelationId" Version="3.0.1" />
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.3.0" />
<PackageVersion Include="Microsoft.Azure.Cosmos" Version="3.36.0" />
<PackageVersion Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="MinVer" Version="5.0.0-beta.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.3" />
<PackageVersion Include="xunit" Version="2.6.1" />
<PackageVersion Include="Scrutor" Version="4.2.2" />
</ItemGroup>
<!-- .NET 7.0. bits -->
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageVersion Include="AspNetCore.HealthChecks.CosmosDb" Version="7.1.0" />
<PackageVersion Include="IEvangelist.Azure.CosmosRepository" Version="7.1.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.14" />
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0" />
<PackageVersion Include="Microsoft.NET.Sdk.Functions" Version="4.2.0" />
<PackageVersion Include="Moq.AutoMock" Version="3.5.0" />
<PackageVersion Include="Moq" Version="[4.18.4]" />
<PackageVersion Include="Mumby0168.CleanArchitecture.Exceptions.AspNetCore" Version="1.1.0" />
<PackageVersion Include="Mumby0168.CleanArchitecture.Exceptions" Version="1.0.0" />
<PackageVersion Include="Polly" Version="8.1.0" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
<PackageVersion Include="System.Net.Http.Json" Version="7.0.1" />
</ItemGroup>
<!-- .NET 8.0. bits -->
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageVersion Include="AspNetCore.HealthChecks.CosmosDb" Version="7.1.0" />
<PackageVersion Include="IEvangelist.Azure.CosmosRepository" Version="7.1.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageVersion Include="Microsoft.NET.Sdk.Functions" Version="4.2.0" />
<PackageVersion Include="Moq.AutoMock" Version="3.5.0" />
<PackageVersion Include="Moq" Version="[4.18.4]" />
<PackageVersion Include="Mumby0168.CleanArchitecture.Exceptions.AspNetCore" Version="1.1.0" />
<PackageVersion Include="Mumby0168.CleanArchitecture.Exceptions" Version="1.0.0" />
<PackageVersion Include="Polly" Version="8.2.0" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
<PackageVersion Include="System.Net.Http.Json" Version="8.0.0" />
</ItemGroup>
<!-- .NET Standard -->
<ItemGroup Condition="$(TargetFramework.StartsWith('netstandard'))">
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions Microsoft.Azure.CosmosRepository.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md
CosmosRepository.png = CosmosRepository.png
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
.github\ISSUE_TEMPLATE\feature_request.md = .github\ISSUE_TEMPLATE\feature_request.md
LICENSE = LICENSE
logo-large.png = logo-large.png
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>373fc06c-c3e7-4ecb-bf30-88a8ae4eb700</UserSecretsId>
Expand All @@ -13,11 +13,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.CosmosDb" Version="7.0.0" />
<PackageReference Include="CorrelationId" Version="3.0.1" />
<PackageReference Include="Mumby0168.CleanArchitecture.Exceptions" Version="1.0.0" />
<PackageReference Include="Mumby0168.CleanArchitecture.Exceptions.AspNetCore" Version="1.1.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="AspNetCore.HealthChecks.CosmosDb" />
<PackageReference Include="CorrelationId" />
<PackageReference Include="Mumby0168.CleanArchitecture.Exceptions" />
<PackageReference Include="Mumby0168.CleanArchitecture.Exceptions.AspNetCore" />
<PackageReference Include="Swashbuckle.AspNetCore" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@
using CorrelationId;
using CorrelationId.Abstractions;
using CorrelationId.DependencyInjection;
using Microsoft.Azure.CosmosRepository.Extensions;
using Microsoft.Azure.CosmosEventSourcing.Extensions;
using Microsoft.Azure.CosmosEventSourcing.Stores;
using Microsoft.Azure.CosmosRepository.AspNetCore.Extensions;
using Microsoft.Azure.CosmosRepository.Extensions;
using Microsoft.Azure.Cosmos;

WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
IServiceCollection services = builder.Services;


services.AddHealthChecks().AddCosmosDb(builder.Configuration.GetCosmosRepositoryConnectionString()!);
services.AddHealthChecks().AddAzureCosmosDB(provider =>
{
var connectionString = builder.Configuration.GetCosmosRepositoryConnectionString();
return new CosmosClient(connectionString);
});
services.AddCleanArchitectureExceptionsHandler(options => options.ApplicationName = "EventSourcingShipSample");
services.AddSwaggerGen();
services.AddEndpointsApiExplorer();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>55a00f1c-8604-4ac2-adf3-dd3127af43bc</UserSecretsId>
Expand All @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>ce605ed2-3eba-45c1-8970-76b34c1c2837</UserSecretsId>
Expand All @@ -13,9 +13,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Mumby0168.CleanArchitecture.Exceptions" Version="1.0.0" />
<PackageReference Include="Mumby0168.CleanArchitecture.Exceptions.AspNetCore" Version="1.1.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Mumby0168.CleanArchitecture.Exceptions" />
<PackageReference Include="Mumby0168.CleanArchitecture.Exceptions.AspNetCore" />
<PackageReference Include="Swashbuckle.AspNetCore" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand All @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>66ceb007-2b64-4ecc-8234-8eb82effee6b</UserSecretsId>
Expand All @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(DefaultTargetFrameworks);$(CompatibilityTargetFrameworks)</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>preview</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.2.0" />
<PackageReference Include="Microsoft.Azure.Functions.Extensions" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\Microsoft.Azure.CosmosRepository\Microsoft.Azure.CosmosRepository.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\src\Microsoft.Azure.CosmosRepository\Microsoft.Azure.CosmosRepository.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UserSecretsId>fd4da918-55af-4010-9ba0-e75f0e0dc917</UserSecretsId>
Expand All @@ -13,8 +13,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Bogus" Version="34.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageReference Include="Bogus" />
<PackageReference Include="Microsoft.Extensions.Configuration" />
</ItemGroup>

</Project>
Loading

0 comments on commit a504f0d

Please sign in to comment.