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

feat: upgrade to .NET 9 #166

Merged
merged 3 commits into from
Dec 6, 2024
Merged
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
3 changes: 3 additions & 0 deletions .github/workflows/build-and-analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
with:
dotnet-version: |
8.0.x
9.0.x

- uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -48,6 +49,7 @@ jobs:
with:
dotnet-version: |
8.0.x
9.0.x

# Not used here - but used in the release job
# If this breaks, make sure to update both here
Expand Down Expand Up @@ -104,6 +106,7 @@ jobs:
with:
dotnet-version: |
8.0.x
9.0.x

- name: Set up JDK 17
uses: actions/setup-java@v4
Expand Down
97 changes: 52 additions & 45 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ name: "CodeQL Advanced"

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]
schedule:
- cron: '35 20 * * 0'
- cron: "35 20 * * 0"

jobs:
analyze:
Expand All @@ -43,50 +43,57 @@ jobs:
fail-fast: false
matrix:
include:
- language: csharp
build-mode: none
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
- language: csharp
build-mode: autobuild
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
- name: Checkout repository
uses: actions/checkout@v4

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
with:
dotnet-version: |
8.0.x
9.0.x

- uses: actions/setup-node@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<BaseArtifactsPath Condition=" '$(BaseArtifactsPath)' == '' ">$(MSBuildThisFileDirectory)artifacts\</BaseArtifactsPath>
Expand Down
54 changes: 27 additions & 27 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,43 @@
<PackageVersion Include="CommunityToolkit.Diagnostics" Version="8.3.2" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="FluentAssertions.Analyzers" Version="0.34.1" />
<PackageVersion Include="FluentAssertions" Version="6.12.1" />
<PackageVersion Include="FluentAssertions" Version="7.0.0" />
<PackageVersion Include="Microsoft.ApplicationInsights" Version="2.22.0" />
<PackageVersion Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0" />
<PackageVersion Include="Microsoft.Build.Artifacts" Version="6.1.47" />
<PackageVersion Include="Microsoft.Build.Artifacts" Version="6.1.48" />
<PackageVersion Include="Microsoft.Build.Locator" Version="1.7.8" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.11.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.11.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Embedded" Version="8.0.10" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="8.10.0" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="8.2.2" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="8.1.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.12.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.12.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Embedded" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="9.0.0" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="8.3.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="Nerdbank.Streams" Version="2.11.79" />
<PackageVersion Include="Npgsql.OpenTelemetry" Version="8.0.5" />
<PackageVersion Include="Npgsql" Version="8.0.5" />
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
<PackageVersion Include="Npgsql.OpenTelemetry" Version="9.0.1" />
<PackageVersion Include="Npgsql" Version="9.0.1" />
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.10.0" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.10.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.9.0" />
<PackageVersion Include="OpenTelemetry" Version="1.9.0" />
<PackageVersion Include="Swashbuckle.AspNetCore.Swagger" Version="6.9.0" />
<PackageVersion Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.9.0" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.9.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.10.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.10.0" />
<PackageVersion Include="OpenTelemetry" Version="1.10.0" />
<PackageVersion Include="Swashbuckle.AspNetCore.Swagger" Version="7.1.0" />
<PackageVersion Include="Swashbuckle.AspNetCore.SwaggerGen" Version="7.1.0" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="7.1.0" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageVersion Include="System.CommandLine.Hosting" Version="0.4.0-alpha.22272.1" />
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="8.1.0" />
<PackageVersion Include="System.IO.Pipelines" Version="8.0.0" />
<PackageVersion Include="Testcontainers.PostgreSql" Version="3.10.0" />
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="8.3.0" />
<PackageVersion Include="System.IO.Pipelines" Version="9.0.0" />
<PackageVersion Include="Testcontainers.PostgreSql" Version="4.0.0" />
<PackageVersion Include="Verify.SourceGenerators" Version="2.5.0" />
<PackageVersion Include="Verify.Xunit" Version="28.3.2" />
<PackageVersion Include="Verify.Xunit" Version="28.4.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="Yuniql.Core" Version="1.3.15" />
<PackageVersion Include="Yuniql.PostgreSql" Version="1.3.15" />
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion src/Altinn.Authorization.ProblemDetails/Version.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<Version>3.0.1</Version>
<Version>0.0.0</Version>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@
<PackageReference Include="CommunityToolkit.Diagnostics" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.Build.Artifacts">
<IncludeAssets>build; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@
</ItemGroup>

<ItemGroup>
<ProjectReference
Include="..\ProblemDetails.Abstractions\Altinn.Authorization.ProblemDetails.Abstractions.csproj" />
<ProjectReference Include="..\ProblemDetails.Abstractions\Altinn.Authorization.ProblemDetails.Abstractions.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.Build.Artifacts">
<IncludeAssets>build; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Altinn.Authorization.ServiceDefaults/Version.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<Version>2.7.0</Version>
<Version>0.0.0</Version>
</PropertyGroup>

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

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand All @@ -14,4 +13,10 @@
<ProjectReference Include="..\ServiceDefaults.Npgsql\Altinn.Authorization.ServiceDefaults.Npgsql.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.Build.Artifacts">
<IncludeAssets>build; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@
</ItemGroup>

<ItemGroup>
<ProjectReference
Include="..\ServiceDefaults.Npgsql\Altinn.Authorization.ServiceDefaults.Npgsql.csproj" />
<ProjectReference Include="..\ServiceDefaults.Npgsql\Altinn.Authorization.ServiceDefaults.Npgsql.csproj" />
<ProjectReference Include="..\ServiceDefaults\Altinn.Authorization.ServiceDefaults.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.Build.Artifacts">
<IncludeAssets>build; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@
<ProjectReference Include="..\ServiceDefaults\Altinn.Authorization.ServiceDefaults.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.Build.Artifacts">
<IncludeAssets>build; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

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

<ItemGroup>
<InternalsVisibleTo Include="Altinn.Authorization.ServiceDefaults.Tests"/>
<InternalsVisibleTo Include="Altinn.Authorization.ServiceDefaults.Tests" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.Build.Artifacts">
<IncludeAssets>build; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,10 @@
<ProjectReference Include="..\ServiceDefaults.Telemetry\Altinn.Authorization.ServiceDefaults.Telemetry.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.Build.Artifacts">
<IncludeAssets>build; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Altinn.Cli/Version.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<Version>1.1.0</Version>
<Version>0.0.0</Version>
</PropertyGroup>

</Project>
6 changes: 6 additions & 0 deletions src/Altinn.Cli/src/Altinn.Cli.Jwks/Altinn.Cli.Jwks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@
<PackageReference Include="System.IO.Pipelines" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.Build.Artifacts">
<IncludeAssets>build; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Altinn.Swashbuckle/Version.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<Version>2.1.1</Version>
<Version>0.0.0</Version>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@
<PackageReference Include="Microsoft.Extensions.Options" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.Build.Artifacts">
<IncludeAssets>build; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
Loading
Loading