diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a51dd762..e11145c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: - name: "🧰 Setup .NET" uses: actions/setup-dotnet@v5 with: - dotnet-version: 9.x + dotnet-version: 10.x - name: "🏗️ Build Arius.Cli" run: dotnet build Arius.Cli/Arius.Cli.csproj --configuration Release @@ -79,7 +79,7 @@ jobs: - name: "🧰 Setup .NET" uses: actions/setup-dotnet@v5 with: - dotnet-version: 9.x + dotnet-version: 10.x - name: "🧮 Determine version" id: get_version @@ -164,7 +164,7 @@ jobs: - name: "🧰 Setup .NET" uses: actions/setup-dotnet@v5 with: - dotnet-version: 9.x + dotnet-version: 10.x - name: "🧪 Run Arius.Explorer & Core Tests" env: @@ -205,7 +205,7 @@ jobs: - name: "🧰 Setup .NET" uses: actions/setup-dotnet@v5 with: - dotnet-version: 9.x + dotnet-version: 10.x - name: "🧮 Determine version" run: | diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index fa22e3eb..ee041564 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -38,7 +38,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v5 with: - dotnet-version: 9.x + dotnet-version: 10.x - name: Initialize CodeQL uses: github/codeql-action/init@v4 with: diff --git a/src/Arius.Benchmarks/Arius.Benchmarks.csproj b/src/Arius.Benchmarks/Arius.Benchmarks.csproj index 9e8cd577..c34f1b0f 100644 --- a/src/Arius.Benchmarks/Arius.Benchmarks.csproj +++ b/src/Arius.Benchmarks/Arius.Benchmarks.csproj @@ -2,7 +2,7 @@ Exe - net9.0 + net10.0 diff --git a/src/Arius.Cli.Tests/Arius.Cli.Tests.csproj b/src/Arius.Cli.Tests/Arius.Cli.Tests.csproj index 24e1e61f..8112b277 100644 --- a/src/Arius.Cli.Tests/Arius.Cli.Tests.csproj +++ b/src/Arius.Cli.Tests/Arius.Cli.Tests.csproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 false true diff --git a/src/Arius.Cli/Arius.Cli.csproj b/src/Arius.Cli/Arius.Cli.csproj index 0bd7ad34..d1511e95 100644 --- a/src/Arius.Cli/Arius.Cli.csproj +++ b/src/Arius.Cli/Arius.Cli.csproj @@ -2,7 +2,7 @@ Exe - net9.0 + net10.0 2c53e63e-555d-44f4-a474-29c01fb8c564 arius diff --git a/src/Arius.Cli/Dockerfile b/src/Arius.Cli/Dockerfile index 32660fd4..9e638e8a 100644 --- a/src/Arius.Cli/Dockerfile +++ b/src/Arius.Cli/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/runtime:9.0 +FROM mcr.microsoft.com/dotnet/runtime:10.0 WORKDIR /app # Copy the prebuilt artifacts into the image diff --git a/src/Arius.Core.DbMigrationV3V5/Arius.Core.DbMigrationV3V5.csproj b/src/Arius.Core.DbMigrationV3V5/Arius.Core.DbMigrationV3V5.csproj index 6f34d89a..b0a19b99 100644 --- a/src/Arius.Core.DbMigrationV3V5/Arius.Core.DbMigrationV3V5.csproj +++ b/src/Arius.Core.DbMigrationV3V5/Arius.Core.DbMigrationV3V5.csproj @@ -2,7 +2,7 @@ Exe - net9.0 + net10.0 1ce3e36f-cb01-4aac-bf1a-e2c0cebdd61c diff --git a/src/Arius.Core.Tests/Arius.Core.Tests.csproj b/src/Arius.Core.Tests/Arius.Core.Tests.csproj index 4d4de9c4..596308bd 100644 --- a/src/Arius.Core.Tests/Arius.Core.Tests.csproj +++ b/src/Arius.Core.Tests/Arius.Core.Tests.csproj @@ -1,7 +1,7 @@  - net9.0 + net10.0 false true diff --git a/src/Arius.Core/Arius.Core.csproj b/src/Arius.Core/Arius.Core.csproj index 022c978b..dacfcc90 100644 --- a/src/Arius.Core/Arius.Core.csproj +++ b/src/Arius.Core/Arius.Core.csproj @@ -1,7 +1,7 @@  - net9.0 + net10.0 @@ -17,7 +17,6 @@ runtime; build; native; contentfiles; analyzers - diff --git a/src/Arius.Core/Features/Queries/PointerFileEntries/PointerFileEntriesQueryHandler.cs b/src/Arius.Core/Features/Queries/PointerFileEntries/PointerFileEntriesQueryHandler.cs index f2381bd5..6243be49 100644 --- a/src/Arius.Core/Features/Queries/PointerFileEntries/PointerFileEntriesQueryHandler.cs +++ b/src/Arius.Core/Features/Queries/PointerFileEntries/PointerFileEntriesQueryHandler.cs @@ -33,7 +33,7 @@ public async IAsyncEnumerable Handle(PointerFileE } } - internal async IAsyncEnumerable Handle(HandlerContext handlerContext, CancellationToken cancellationToken) + internal async IAsyncEnumerable Handle(HandlerContext handlerContext, [EnumeratorCancellation] CancellationToken cancellationToken) { var resultChannel = Channel.CreateUnbounded(new UnboundedChannelOptions { diff --git a/src/Arius.Core/Shared/Storage/AzureBlobStorageContainer.cs b/src/Arius.Core/Shared/Storage/AzureBlobStorageContainer.cs index bd799176..5edbbe31 100644 --- a/src/Arius.Core/Shared/Storage/AzureBlobStorageContainer.cs +++ b/src/Arius.Core/Shared/Storage/AzureBlobStorageContainer.cs @@ -6,6 +6,7 @@ using FluentResults; using Microsoft.Extensions.Logging; using System.Net; +using System.Runtime.CompilerServices; namespace Arius.Core.Shared.Storage; @@ -77,17 +78,22 @@ public async Task ContainerExistsAsync() } } - public IAsyncEnumerable GetAllAsync(string prefix, CancellationToken cancellationToken = default) + public async IAsyncEnumerable GetAllAsync(string prefix, [EnumeratorCancellation] CancellationToken cancellationToken = default) { logger.LogDebug("Listing blobs with prefix '{Prefix}' from container '{ContainerName}'", prefix, blobContainerClient.Name); - return blobContainerClient.GetBlobsAsync(prefix: prefix, traits: BlobTraits.Metadata, cancellationToken: cancellationToken) - .Select(blob => new StorageProperties( + + await foreach (var blob in blobContainerClient + .GetBlobsAsync(prefix: prefix, traits: BlobTraits.Metadata, cancellationToken: cancellationToken) + .WithCancellation(cancellationToken)) + { + yield return new StorageProperties( Name: blob.Name, ContentType: blob.Properties.ContentType, Metadata: blob.Metadata, StorageTier: blob.Properties.AccessTier.ToStorageTier(), ContentLength: blob.Properties.ContentLength ?? -1 - )); + ); + } } public async Task> OpenReadAsync(string blobName, IProgress? progress = default, CancellationToken cancellationToken = default) diff --git a/src/Arius.Core/Shared/Storage/EncryptedCompressedStorage.cs b/src/Arius.Core/Shared/Storage/EncryptedCompressedStorage.cs index 5a86a7e0..f6695c62 100644 --- a/src/Arius.Core/Shared/Storage/EncryptedCompressedStorage.cs +++ b/src/Arius.Core/Shared/Storage/EncryptedCompressedStorage.cs @@ -3,6 +3,7 @@ using Arius.Core.Shared.Hashing; using FluentResults; using System.IO.Compression; +using System.Runtime.CompilerServices; using Zio; namespace Arius.Core.Shared.Storage; @@ -41,12 +42,26 @@ public Task ContainerExistsAsync() // -- STATES - public IAsyncEnumerable GetStates(CancellationToken cancellationToken = default) + public async IAsyncEnumerable GetStates([EnumeratorCancellation] CancellationToken cancellationToken = default) { - return container.GetAllAsync(statesFolderPrefix, cancellationToken) - .OrderBy(sp => sp.Name) - .Where(sp => sp.Metadata != null && sp.Metadata.TryGetValue("DatabaseVersion", out var version) && version == "5") // Get all v5 states - .Select(sp => sp.Name[statesFolderPrefix.Length..]); // remove the "states/" prefix + var states = new List(); + + await foreach (var storageProperties in container + .GetAllAsync(statesFolderPrefix, cancellationToken) + .WithCancellation(cancellationToken)) + { + if (storageProperties.Metadata != null + && storageProperties.Metadata.TryGetValue("DatabaseVersion", out var version) + && version == "5") + { + states.Add(storageProperties.Name[statesFolderPrefix.Length..]); + } + } + + foreach (var state in states.OrderBy(static name => name, StringComparer.Ordinal)) + { + yield return state; + } } public async Task DownloadStateAsync(string stateName, FileEntry targetFile, CancellationToken cancellationToken = default) diff --git a/src/Arius.Explorer.Tests/Arius.Explorer.Tests.csproj b/src/Arius.Explorer.Tests/Arius.Explorer.Tests.csproj index f4f1be0d..743c5177 100644 --- a/src/Arius.Explorer.Tests/Arius.Explorer.Tests.csproj +++ b/src/Arius.Explorer.Tests/Arius.Explorer.Tests.csproj @@ -1,7 +1,8 @@  - net9.0-windows + net10.0-windows + true false diff --git a/src/Arius.Explorer/Arius.Explorer.csproj b/src/Arius.Explorer/Arius.Explorer.csproj index 0c1863d0..9f5f70de 100644 --- a/src/Arius.Explorer/Arius.Explorer.csproj +++ b/src/Arius.Explorer/Arius.Explorer.csproj @@ -2,7 +2,8 @@ WinExe - net9.0-windows + net10.0-windows + true true diff --git a/src/Arius.Explorer/Properties/PublishProfiles/ClickOnceProfile.pubxml b/src/Arius.Explorer/Properties/PublishProfiles/ClickOnceProfile.pubxml index 8c3ef3a8..3b90f118 100644 --- a/src/Arius.Explorer/Properties/PublishProfiles/ClickOnceProfile.pubxml +++ b/src/Arius.Explorer/Properties/PublishProfiles/ClickOnceProfile.pubxml @@ -20,7 +20,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. False Any CPU Arius - bin\Release\net9.0-windows\app.publish\ + bin\Release\net10.0-windows\app.publish\ ClickOnce False False @@ -30,16 +30,16 @@ https://go.microsoft.com/fwlink/?LinkID=208121. False false https://github.com/woutervanranst/Arius - net9.0-windows + net10.0-windows True Foreground False Publish.html - + true - .NET Desktop Runtime 9.0 (x64) + .NET Desktop Runtime 10.0 (x64) diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 81c2efcf..10abcffc 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -44,7 +44,6 @@ -