Skip to content

Commit

Permalink
.NET 8 Update Part 3 (#3300)
Browse files Browse the repository at this point in the history
* Reapply "Update to .NET 8 (Again) (#3274)" (#3280)

This reverts commit faf3187.

* Reapply "Update Pkgs for .NET 8" (#3288)

This reverts commit 9832da3.

* Reapply "Set DefaultMapInboundClaims to false to keep roles claim type" (#3293)

This reverts commit ba723a8.

* Reapply "Update mcr.microsoft.com/dotnet/aspnet:8.0.0-alpine3.18-amd64 Docker digest to f8163ae" (#3289)

This reverts commit 1ff2c94.

* Update sdk and runtime

* Update other packages

* Revert regex changes

* Disable invalid tests
  • Loading branch information
wsugarman authored Jan 11, 2024
1 parent 2db2580 commit 521936e
Show file tree
Hide file tree
Showing 76 changed files with 623 additions and 454 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4.1.1

- name: Setup dotnet from global.json
uses: actions/setup-dotnet@v4
if: ${{ matrix.language == 'csharp' }}

- name: 'Setup dotnet 6.x'
uses: actions/setup-dotnet@v4
if: ${{ matrix.language == 'csharp' }}
with:
dotnet-version: '6.x'

- name: Setup dotnet from global.json
uses: actions/setup-dotnet@v4
if: ${{ matrix.language == 'csharp' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
Expand Down
5 changes: 5 additions & 0 deletions .globalconfig
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,14 @@ dotnet_diagnostic.CA1031.severity = error # Do not catch general exception
dotnet_diagnostic.CA1032.severity = suggestion # Implement standard exception constructors
dotnet_diagnostic.CA1054.severity = error # URI parameters should not be strings
dotnet_diagnostic.CA1305.severity = error # Specify IFormatProvider
dotnet_diagnostic.CA1510.severity = none # Use ArgumentNullException throw helper
dotnet_diagnostic.CA1511.severity = none # Use ArgumentException throw helper
dotnet_diagnostic.CA1512.severity = none # Use ArgumentOutOfRangeException throw helper
dotnet_diagnostic.CA1513.severity = none # Use ObjectDisposedException throw helper
dotnet_diagnostic.CA1716.severity = error # Identifiers should not match keywords
dotnet_diagnostic.CA1822.severity = error # Mark members as static
dotnet_diagnostic.CA1848.severity = none # Do not encourage LoggerMessage delegates in every instance
dotnet_diagnostic.CA1863.severity = none # Use 'CompositeFormat'
dotnet_diagnostic.CA2007.severity = none # Do not directly await a Task

# C# Compiler Rules
Expand Down
23 changes: 15 additions & 8 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,48 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<HighEntropyVA>true</HighEntropyVA>
<LangVersion>Latest</LangVersion>
<LtsVersion>net6.0</LtsVersion>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Product>Microsoft Health</Product>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<StsVersion>net7.0</StsVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<TrimMode>partial</TrimMode>
<WarningsAsErrors />
</PropertyGroup>

<!-- Currently the latest version is .NET 7 -->
<!-- Currently the latest version is .NET 8 -->
<PropertyGroup>
<LatestVersion>$(StsVersion)</LatestVersion>
<LibraryFrameworks>$(LtsVersion);$(StsVersion)</LibraryFrameworks>
<LatestVersion>net8.0</LatestVersion>
<LibraryFrameworks>net8.0;net6.0</LibraryFrameworks>
</PropertyGroup>

<!-- SDK Packages -->
<Choose>
<When Condition="'$(TargetFramework)' == '$(LtsVersion)'">
<When Condition="'$(TargetFramework)' == 'net6.0'">
<PropertyGroup>
<DependencyInjectionVersion>6.0.1</DependencyInjectionVersion>
<MediatRVersion>12.1.1</MediatRVersion>
<OTelVersion>1.6.0</OTelVersion>
<SdkPackageVersion>6.0.0</SdkPackageVersion>
<WebUtilitiesVersion>2.2.0</WebUtilitiesVersion>
</PropertyGroup>
</When>
<When Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PropertyGroup>
<DependencyInjectionVersion>8.0.0</DependencyInjectionVersion>
<MediatRVersion>12.2.0</MediatRVersion>
<OTelVersion>1.7.0</OTelVersion>
<SdkPackageVersion>8.0.0</SdkPackageVersion>
<WebUtilitiesVersion>2.2.0</WebUtilitiesVersion>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<DependencyInjectionVersion>7.0.0</DependencyInjectionVersion>
<SdkPackageVersion>7.0.0</SdkPackageVersion>
<DependencyInjectionVersion>8.0.0</DependencyInjectionVersion>
<MediatRVersion>12.2.0</MediatRVersion>
<OTelVersion>1.7.0</OTelVersion>
<SdkPackageVersion>8.0.0</SdkPackageVersion>
<WebUtilitiesVersion>8.0.0</WebUtilitiesVersion>
</PropertyGroup>
</Otherwise>
</Choose>
Expand Down
64 changes: 33 additions & 31 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project>

<ItemGroup>
<PackageVersion Include="Azure.Core" Version="1.36.0" />
<PackageVersion Include="Azure.Data.Tables" Version="12.8.2" />
Expand All @@ -10,18 +11,17 @@
<PackageVersion Include="Azure.Storage.Queues" Version="12.17.1" />
<PackageVersion Include="Azure.Storage.Common" Version="12.18.1" />
<PackageVersion Include="Ensure.That" Version="10.1.0" />
<PackageVersion Include="fo-dicom" Version="5.1.1" />
<PackageVersion Include="fo-dicom" Version="5.1.2" />
<PackageVersion Include="fo-dicom.Codecs" Version="5.11.0" />
<PackageVersion Include="fo-dicom.Imaging.ImageSharp" Version="5.1.0" />
<PackageVersion Include="Google.Protobuf" Version="3.25.1" />
<PackageVersion Include="fo-dicom.Imaging.ImageSharp" Version="5.1.2" />
<PackageVersion Include="HashDepot" Version="3.1.0" />
<PackageVersion Include="Hl7.Fhir.R4" Version="4.3.0" />
<PackageVersion Include="Hl7.Fhir.Support" Version="4.3.0" />
<PackageVersion Include="Hl7.Fhir.Support.Poco" Version="4.3.0" />
<PackageVersion Include="IdentityServer4" Version="4.1.2" />
<PackageVersion Include="IdentityServer4.Storage" Version="4.1.2" />
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.3.0" />
<PackageVersion Include="MediatR" Version="12.1.1" />
<PackageVersion Include="MediatR" Version="$(MediatRVersion)" />
<PackageVersion Include="Microsoft.ApplicationInsights" Version="2.22.0" />
<PackageVersion Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0" />
<PackageVersion Include="Microsoft.ApplicationInsights.WorkerService" Version="2.22.0" />
Expand All @@ -30,15 +30,15 @@
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Versioning" Version="5.1.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="5.1.0" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="$(SdkPackageVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
<PackageVersion Include="Microsoft.AspNetCore.WebUtilities" Version="$(WebUtilitiesVersion)" />
<PackageVersion Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageVersion Include="Microsoft.Azure.ServiceBus" Version="5.2.0" />
<PackageVersion Include="Microsoft.Azure.WebJobs" Version="3.0.39" />
<PackageVersion Include="Microsoft.Azure.WebJobs.Extensions" Version="5.0.0" />
<PackageVersion Include="Microsoft.Azure.WebJobs.Extensions.Storage.Blobs" Version="5.2.2" />
<PackageVersion Include="Microsoft.Azure.WebJobs.Extensions.DurableTask" Version="2.13.0" />
<PackageVersion Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="3.2.0" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.1.2" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.1.4" />
<PackageVersion Include="Microsoft.Extensions.Azure" Version="1.7.1" />
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="$(SdkPackageVersion)" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="$(SdkPackageVersion)" />
Expand All @@ -65,38 +65,39 @@
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="$(SdkPackageVersion)" />
<PackageVersion Include="Microsoft.Extensions.Options.DataAnnotations" Version="$(SdkPackageVersion)" />
<PackageVersion Include="Microsoft.Extensions.Primitives" Version="$(SdkPackageVersion)" />
<PackageVersion Include="Microsoft.Health.Abstractions" Version="7.1.10" />
<PackageVersion Include="Microsoft.Health.Api" Version="7.1.10" />
<PackageVersion Include="Microsoft.Health.Blob" Version="7.1.10" />
<PackageVersion Include="Microsoft.Health.Client" Version="7.1.10" />
<PackageVersion Include="Microsoft.Health.Core" Version="7.1.10" />
<PackageVersion Include="Microsoft.Health.Encryption" Version="7.1.10" />
<PackageVersion Include="Microsoft.Health.Development.IdentityProvider" Version="7.1.10" />
<PackageVersion Include="Microsoft.Health.Extensions.BuildTimeCodeGenerator" Version="7.1.10" />
<PackageVersion Include="Microsoft.Health.Extensions.DependencyInjection" Version="7.1.10" />
<PackageVersion Include="Microsoft.Extensions.TimeProvider.Testing" Version="8.0.0" />
<PackageVersion Include="Microsoft.Health.Abstractions" Version="7.1.11" />
<PackageVersion Include="Microsoft.Health.Api" Version="7.1.11" />
<PackageVersion Include="Microsoft.Health.Blob" Version="7.1.11" />
<PackageVersion Include="Microsoft.Health.Client" Version="7.1.11" />
<PackageVersion Include="Microsoft.Health.Core" Version="7.1.11" />
<PackageVersion Include="Microsoft.Health.Encryption" Version="7.1.11" />
<PackageVersion Include="Microsoft.Health.Development.IdentityProvider" Version="7.1.11" />
<PackageVersion Include="Microsoft.Health.Extensions.BuildTimeCodeGenerator" Version="7.1.11" />
<PackageVersion Include="Microsoft.Health.Extensions.DependencyInjection" Version="7.1.11" />
<PackageVersion Include="Microsoft.Health.Fhir.R4.Client" Version="3.4.294" />
<PackageVersion Include="Microsoft.Health.Functions.Extensions" Version="7.1.10" />
<PackageVersion Include="Microsoft.Health.Operations" Version="7.1.10" />
<PackageVersion Include="Microsoft.Health.Operations.Functions" Version="7.1.10" />
<PackageVersion Include="Microsoft.Health.SqlServer" Version="7.1.10" />
<PackageVersion Include="Microsoft.Health.SqlServer.Api" Version="7.1.10" />
<PackageVersion Include="Microsoft.Health.Test.Utilities" Version="7.1.10" />
<PackageVersion Include="Microsoft.Health.Tools.Sql.Tasks" Version="7.1.10" />
<PackageVersion Include="Microsoft.Health.Functions.Extensions" Version="7.1.11" />
<PackageVersion Include="Microsoft.Health.Operations" Version="7.1.11" />
<PackageVersion Include="Microsoft.Health.Operations.Functions" Version="7.1.11" />
<PackageVersion Include="Microsoft.Health.SqlServer" Version="7.1.11" />
<PackageVersion Include="Microsoft.Health.SqlServer.Api" Version="7.1.11" />
<PackageVersion Include="Microsoft.Health.Test.Utilities" Version="7.1.11" />
<PackageVersion Include="Microsoft.Health.Tools.Sql.Tasks" Version="7.1.11" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="7.1.2" />
<PackageVersion Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.0" />
<PackageVersion Include="Microsoft.NET.Sdk.Functions" Version="4.2.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="Microsoft.OpenApi" Version="1.6.11" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="Microsoft.SqlServer.DACFx" Version="162.1.167" />
<PackageVersion Include="Microsoft.SqlServer.DACFx" Version="162.1.172" />
<PackageVersion Include="Microsoft.TestPlatform.ObjectModel" Version="17.8.0" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="OpenTelemetry" Version="1.6.0" />
<PackageVersion Include="OpenTelemetry.Api" Version="1.6.0" />
<PackageVersion Include="OpenTelemetry.Exporter.Console" Version="1.6.0" />
<PackageVersion Include="OpenTelemetry.Exporter.InMemory" Version="1.6.0" />
<PackageVersion Include="OpenTelemetry" Version="$(OTelVersion)" />
<PackageVersion Include="OpenTelemetry.Api" Version="$(OTelVersion)" />
<PackageVersion Include="OpenTelemetry.Exporter.Console" Version="$(OTelVersion)" />
<PackageVersion Include="OpenTelemetry.Exporter.InMemory" Version="$(OTelVersion)" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="Polly" Version="8.2.0" />
<PackageVersion Include="Polly" Version="8.2.1" />
<PackageVersion Include="Polly.Extensions.Http" Version="3.0.0" />
<PackageVersion Include="SixLabors.ImageSharp" Version="2.1.6" />
<PackageVersion Include="Swashbuckle.AspNetCore.Swagger" Version="6.5.0" />
Expand All @@ -109,8 +110,9 @@
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
<PackageVersion Include="System.Memory" Version="4.5.5" />
<PackageVersion Include="System.Text.Json" Version="$(SdkPackageVersion)" />
<PackageVersion Include="xunit" Version="2.6.1" />
<PackageVersion Include="xunit.assert" Version="2.6.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.3" />
<PackageVersion Include="xunit" Version="2.6.5" />
<PackageVersion Include="xunit.assert" Version="2.6.5" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.6" />
</ItemGroup>

</Project>
8 changes: 4 additions & 4 deletions build/common/build-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ parameters:

steps:
- task: UseDotNet@2
displayName: 'Use .NET sdk'
displayName: 'Use .NET 6 sdk'
inputs:
useGlobalJson: true
version: 6.x

- task: UseDotNet@2
displayName: 'Use .NET 6 sdk'
displayName: 'Use .NET sdk'
inputs:
version: 6.x
useGlobalJson: true

- task: DotNetCoreCLI@2
displayName: 'dotnet build $(buildConfiguration)'
Expand Down
9 changes: 4 additions & 5 deletions build/common/versioning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ jobs:
pool:
vmImage: 'ubuntu-latest'
steps:

- task: UseDotNet@2
displayName: 'Use .NET sdk'
displayName: 'Use .NET 7 sdk'
inputs:
useGlobalJson: true
version: 7.x

- task: UseDotNet@2
displayName: 'Use .NET 6 sdk'
displayName: 'Use .NET sdk'
inputs:
version: 6.x
useGlobalJson: true

- task: DownloadBuildArtifacts@0
inputs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using FellowOakDicom;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using Microsoft.Health.Core.Internal;
using Microsoft.Extensions.Time.Testing;
using Microsoft.Health.Dicom.Client.Models;
using Microsoft.Health.DicomCast.Core.Configurations;
using Microsoft.Health.DicomCast.Core.Exceptions;
Expand All @@ -21,7 +21,6 @@
using Microsoft.Health.DicomCast.Core.Features.State;
using Microsoft.Health.DicomCast.Core.Features.Worker;
using Microsoft.Health.DicomCast.Core.Features.Worker.FhirTransaction;
using Microsoft.Health.Test.Utilities;
using NSubstitute;
using NSubstitute.ExceptionExtensions;
using Polly.Timeout;
Expand All @@ -37,6 +36,7 @@ public class ChangeFeedProcessorTests
private readonly IFhirTransactionPipeline _fhirTransactionPipeline = Substitute.For<IFhirTransactionPipeline>();
private readonly ISyncStateService _syncStateService = Substitute.For<ISyncStateService>();
private readonly IExceptionStore _exceptionStore = Substitute.For<IExceptionStore>();
private readonly FakeTimeProvider _timeProvider = new FakeTimeProvider(DateTimeOffset.UtcNow);
private readonly IOptions<DicomCastConfiguration> _config = Substitute.For<IOptions<DicomCastConfiguration>>();
private readonly DicomCastConfiguration _dicomCastConfiguration = new DicomCastConfiguration();
private readonly ChangeFeedProcessor _changeFeedProcessor;
Expand All @@ -51,6 +51,7 @@ public ChangeFeedProcessorTests()
_fhirTransactionPipeline,
_syncStateService,
_exceptionStore,
_timeProvider,
_config,
NullLogger<ChangeFeedProcessor>.Instance);

Expand Down Expand Up @@ -457,25 +458,21 @@ public async Task GivenAllChangeFeedEntriesAreSuccess_WhenProcessed_ThenSyncStat
{
const long expectedSequence = 10;

ChangeFeedEntry[] changeFeeds = new[]
{
ChangeFeedGenerator.Generate(expectedSequence),
};
ChangeFeedEntry[] changeFeeds = [ChangeFeedGenerator.Generate(expectedSequence)];

// Arrange
_changeFeedRetrieveService.RetrieveLatestSequenceAsync(DefaultCancellationToken).Returns(expectedSequence);
_changeFeedRetrieveService.RetrieveChangeFeedAsync(0, ChangeFeedProcessor.DefaultLimit, DefaultCancellationToken).Returns(changeFeeds);

var instant = new DateTimeOffset(2020, 6, 1, 15, 30, 25, TimeSpan.FromHours(-8));
var instant = DateTimeOffset.UtcNow.AddHours(1);
_timeProvider.SetUtcNow(instant);

using (Mock.Property(() => ClockResolver.UtcNowFunc, () => instant))
{
// Act
await ExecuteProcessAsync();
}
// Act
await ExecuteProcessAsync();

// Assert
await _syncStateService.Received(1)
await _syncStateService
.Received(1)
.UpdateSyncStateAsync(Arg.Is<SyncState>(syncState => syncState != null && syncState.SyncedSequence == expectedSequence && syncState.SyncedDate == instant), DefaultCancellationToken);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
<PackageReference Include="Microsoft.Extensions.Options" />
<PackageReference Include="Microsoft.Extensions.TimeProvider.Testing" />
<PackageReference Include="Microsoft.Health.Core" />
<PackageReference Include="Microsoft.Health.Fhir.R4.Client" />
<PackageReference Include="Microsoft.Health.Test.Utilities" />
Expand Down
Loading

0 comments on commit 521936e

Please sign in to comment.