Skip to content
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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/Arius.Benchmarks/Arius.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Arius.Cli.Tests/Arius.Cli.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
Expand Down
2 changes: 1 addition & 1 deletion src/Arius.Cli/Arius.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<UserSecretsId>2c53e63e-555d-44f4-a474-29c01fb8c564</UserSecretsId>
<AssemblyName>arius</AssemblyName>

Expand Down
2 changes: 1 addition & 1 deletion src/Arius.Cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<UserSecretsId>1ce3e36f-cb01-4aac-bf1a-e2c0cebdd61c</UserSecretsId>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/Arius.Core.Tests/Arius.Core.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
Expand Down
3 changes: 1 addition & 2 deletions src/Arius.Core/Arius.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -17,7 +17,6 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Options.DataAnnotations" />
<PackageReference Include="System.Linq.Async" />
<PackageReference Include="Zio" />
<!--<PrivateAssets>compile;build;buildTransitive;contentFiles;analyzers;native</PrivateAssets>-->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
}

internal async IAsyncEnumerable<PointerFileEntriesQueryResult> Handle(HandlerContext handlerContext, CancellationToken cancellationToken)
internal async IAsyncEnumerable<PointerFileEntriesQueryResult> Handle(HandlerContext handlerContext, [EnumeratorCancellation] CancellationToken cancellationToken)
{
var resultChannel = Channel.CreateUnbounded<PointerFileEntriesQueryResult>(new UnboundedChannelOptions
{
Expand Down Expand Up @@ -123,7 +123,7 @@
}
}, cancellationToken);

Task.WhenAll(directoryTask, fileTask).ContinueWith(task =>

Check warning on line 126 in src/Arius.Core/Features/Queries/PointerFileEntries/PointerFileEntriesQueryHandler.cs

View workflow job for this annotation

GitHub Actions / 🧪 CLI & Core Tests on ubuntu-latest

Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.

Check warning on line 126 in src/Arius.Core/Features/Queries/PointerFileEntries/PointerFileEntriesQueryHandler.cs

View workflow job for this annotation

GitHub Actions / 🧪 CLI & Core Tests on ubuntu-latest

Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.

Check warning on line 126 in src/Arius.Core/Features/Queries/PointerFileEntries/PointerFileEntriesQueryHandler.cs

View workflow job for this annotation

GitHub Actions / 🧪 CLI & Core Tests on windows-latest

Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.

Check warning on line 126 in src/Arius.Core/Features/Queries/PointerFileEntries/PointerFileEntriesQueryHandler.cs

View workflow job for this annotation

GitHub Actions / 🧪 CLI & Core Tests on windows-latest

Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.

Check warning on line 126 in src/Arius.Core/Features/Queries/PointerFileEntries/PointerFileEntriesQueryHandler.cs

View workflow job for this annotation

GitHub Actions / 🧪 Explorer Tests (Windows)

Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.

Check warning on line 126 in src/Arius.Core/Features/Queries/PointerFileEntries/PointerFileEntriesQueryHandler.cs

View workflow job for this annotation

GitHub Actions / 🧪 Explorer Tests (Windows)

Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.

Check warning on line 126 in src/Arius.Core/Features/Queries/PointerFileEntries/PointerFileEntriesQueryHandler.cs

View workflow job for this annotation

GitHub Actions / 🚀 CLI Build & Release

Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.

Check warning on line 126 in src/Arius.Core/Features/Queries/PointerFileEntries/PointerFileEntriesQueryHandler.cs

View workflow job for this annotation

GitHub Actions / 🚀 CLI Build & Release

Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.

Check warning on line 126 in src/Arius.Core/Features/Queries/PointerFileEntries/PointerFileEntriesQueryHandler.cs

View workflow job for this annotation

GitHub Actions / 🚀 Explorer Build & Release

Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.

Check warning on line 126 in src/Arius.Core/Features/Queries/PointerFileEntries/PointerFileEntriesQueryHandler.cs

View workflow job for this annotation

GitHub Actions / Analyze Arius (csharp)

Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.

Check warning on line 126 in src/Arius.Core/Features/Queries/PointerFileEntries/PointerFileEntriesQueryHandler.cs

View workflow job for this annotation

GitHub Actions / Analyze Arius (csharp)

Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
{
if (task.IsFaulted)
{
Expand Down
14 changes: 10 additions & 4 deletions src/Arius.Core/Shared/Storage/AzureBlobStorageContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using FluentResults;
using Microsoft.Extensions.Logging;
using System.Net;
using System.Runtime.CompilerServices;

namespace Arius.Core.Shared.Storage;

Expand Down Expand Up @@ -77,17 +78,22 @@ public async Task<bool> ContainerExistsAsync()
}
}

public IAsyncEnumerable<StorageProperties> GetAllAsync(string prefix, CancellationToken cancellationToken = default)
public async IAsyncEnumerable<StorageProperties> 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<Result<Stream>> OpenReadAsync(string blobName, IProgress<long>? progress = default, CancellationToken cancellationToken = default)
Expand Down
25 changes: 20 additions & 5 deletions src/Arius.Core/Shared/Storage/EncryptedCompressedStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -41,12 +42,26 @@

// -- STATES

public IAsyncEnumerable<string> GetStates(CancellationToken cancellationToken = default)
public async IAsyncEnumerable<string> 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<string>();

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)
Expand All @@ -69,7 +84,7 @@
await using var fileStream = targetFile.Create();
await decompressedStream.CopyToAsync(fileStream, cancellationToken);
}
catch (InvalidDataException e)

Check warning on line 87 in src/Arius.Core/Shared/Storage/EncryptedCompressedStorage.cs

View workflow job for this annotation

GitHub Actions / 🧪 CLI & Core Tests on ubuntu-latest

The variable 'e' is declared but never used

Check warning on line 87 in src/Arius.Core/Shared/Storage/EncryptedCompressedStorage.cs

View workflow job for this annotation

GitHub Actions / 🧪 CLI & Core Tests on ubuntu-latest

The variable 'e' is declared but never used

Check warning on line 87 in src/Arius.Core/Shared/Storage/EncryptedCompressedStorage.cs

View workflow job for this annotation

GitHub Actions / 🧪 CLI & Core Tests on windows-latest

The variable 'e' is declared but never used

Check warning on line 87 in src/Arius.Core/Shared/Storage/EncryptedCompressedStorage.cs

View workflow job for this annotation

GitHub Actions / 🧪 CLI & Core Tests on windows-latest

The variable 'e' is declared but never used

Check warning on line 87 in src/Arius.Core/Shared/Storage/EncryptedCompressedStorage.cs

View workflow job for this annotation

GitHub Actions / 🧪 Explorer Tests (Windows)

The variable 'e' is declared but never used

Check warning on line 87 in src/Arius.Core/Shared/Storage/EncryptedCompressedStorage.cs

View workflow job for this annotation

GitHub Actions / 🧪 Explorer Tests (Windows)

The variable 'e' is declared but never used

Check warning on line 87 in src/Arius.Core/Shared/Storage/EncryptedCompressedStorage.cs

View workflow job for this annotation

GitHub Actions / 🚀 CLI Build & Release

The variable 'e' is declared but never used

Check warning on line 87 in src/Arius.Core/Shared/Storage/EncryptedCompressedStorage.cs

View workflow job for this annotation

GitHub Actions / 🚀 CLI Build & Release

The variable 'e' is declared but never used

Check warning on line 87 in src/Arius.Core/Shared/Storage/EncryptedCompressedStorage.cs

View workflow job for this annotation

GitHub Actions / 🚀 Explorer Build & Release

The variable 'e' is declared but never used

Check warning on line 87 in src/Arius.Core/Shared/Storage/EncryptedCompressedStorage.cs

View workflow job for this annotation

GitHub Actions / Analyze Arius (csharp)

The variable 'e' is declared but never used

Check warning on line 87 in src/Arius.Core/Shared/Storage/EncryptedCompressedStorage.cs

View workflow job for this annotation

GitHub Actions / Analyze Arius (csharp)

The variable 'e' is declared but never used
{
// TODO add a unit test for this case
targetFile.Delete();
Expand Down
3 changes: 2 additions & 1 deletion src/Arius.Explorer.Tests/Arius.Explorer.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0-windows</TargetFramework>
<TargetFramework>net10.0-windows</TargetFramework>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
3 changes: 2 additions & 1 deletion src/Arius.Explorer/Arius.Explorer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net9.0-windows</TargetFramework>
<TargetFramework>net10.0-windows</TargetFramework>
<EnableWindowsTargeting>true</EnableWindowsTargeting>

<UseWPF>true</UseWPF>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<OpenBrowserOnPublish>False</OpenBrowserOnPublish>
<Platform>Any CPU</Platform>
<ProductName>Arius</ProductName>
<PublishDir>bin\Release\net9.0-windows\app.publish\</PublishDir>
<PublishDir>bin\Release\net10.0-windows\app.publish\</PublishDir>
<PublishProtocol>ClickOnce</PublishProtocol>
<PublishReadyToRun>False</PublishReadyToRun>
<PublishSingleFile>False</PublishSingleFile>
Expand All @@ -30,16 +30,16 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<SignManifests>False</SignManifests>
<SkipPublishVerification>false</SkipPublishVerification>
<SupportUrl>https://github.com/woutervanranst/Arius</SupportUrl>
<TargetFramework>net9.0-windows</TargetFramework>
<TargetFramework>net10.0-windows</TargetFramework>
<UpdateEnabled>True</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateRequired>False</UpdateRequired>
<WebPageFileName>Publish.html</WebPageFileName>
</PropertyGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.NetCore.DesktopRuntime.9.0.x64">
<BootstrapperPackage Include="Microsoft.NetCore.DesktopRuntime.10.0.x64">
<Install>true</Install>
<ProductName>.NET Desktop Runtime 9.0 (x64)</ProductName>
<ProductName>.NET Desktop Runtime 10.0 (x64)</ProductName>
</BootstrapperPackage>
</ItemGroup>
</Project>
1 change: 0 additions & 1 deletion src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
<PackageVersion Include="Serilog.Sinks.File" Version="7.0.0" />
<PackageVersion Include="Shouldly" Version="4.3.0" />
<PackageVersion Include="Spectre.Console" Version="0.53.0" />
<PackageVersion Include="System.Linq.Async" Version="6.0.3" />
<PackageVersion Include="System.Reactive" Version="6.1.0" />
<PackageVersion Include="TngTech.ArchUnitNET" Version="0.12.3" />
<PackageVersion Include="WouterVanRanst.Utils" Version="2.0.10" />
Expand Down
Loading