Skip to content

Commit a43488e

Browse files
committed
bump nuget packages
1 parent 06c8ee7 commit a43488e

10 files changed

Lines changed: 91 additions & 20 deletions

File tree

‎Directory.Build.props‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
<RepositoryUrl>https://github.com/managedcode/Storage</RepositoryUrl>
3030
<PackageProjectUrl>https://github.com/managedcode/Storage</PackageProjectUrl>
3131
<Product>Managed Code - Storage</Product>
32-
<Version>10.0.7</Version>
33-
<PackageVersion>10.0.7</PackageVersion>
32+
<Version>10.0.8</Version>
33+
<PackageVersion>10.0.8</PackageVersion>
3434

3535
</PropertyGroup>
3636

‎Directory.Packages.props‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
44
</PropertyGroup>
55
<ItemGroup>
6-
<PackageVersion Include="AWSSDK.S3" Version="4.0.102.1" />
6+
<PackageVersion Include="AWSSDK.S3" Version="4.0.102.5" />
77
<PackageVersion Include="Azure.Identity" Version="1.21.0" />
8-
<PackageVersion Include="Azure.Storage.Blobs" Version="12.29.1" />
8+
<PackageVersion Include="Azure.Storage.Blobs" Version="12.29.2" />
99
<PackageVersion Include="Azure.Storage.Files.DataLake" Version="12.27.1" />
1010
<PackageVersion Include="coverlet.collector" Version="10.0.1" />
1111
<PackageVersion Include="coverlet.msbuild" Version="10.0.1" />
1212
<PackageVersion Include="CsvHelper" Version="33.1.0" />
13-
<PackageVersion Include="DotNet.ReproducibleBuilds" Version="1.2.25" />
13+
<PackageVersion Include="DotNet.ReproducibleBuilds" Version="2.0.5" />
1414
<PackageVersion Include="Dropbox.Api" Version="7.2.0" />
15-
<PackageVersion Include="Google.Api.Gax" Version="4.14.0" />
16-
<PackageVersion Include="Google.Api.Gax.Rest" Version="4.14.0" />
17-
<PackageVersion Include="Google.Apis.Drive.v3" Version="1.75.0.4218" />
18-
<PackageVersion Include="Google.Apis.Storage.v1" Version="1.75.0.4193" />
15+
<PackageVersion Include="Google.Api.Gax" Version="4.15.0" />
16+
<PackageVersion Include="Google.Api.Gax.Rest" Version="4.15.0" />
17+
<PackageVersion Include="Google.Apis.Drive.v3" Version="1.76.0.4252" />
18+
<PackageVersion Include="Google.Apis.Storage.v1" Version="1.76.0.4250" />
1919
<PackageVersion Include="Google.Cloud.Storage.V1" Version="4.15.0" />
2020
<PackageVersion Include="Humanizer.Core" Version="3.0.10" />
21-
<PackageVersion Include="ManagedCode.Communication" Version="10.1.1" />
22-
<PackageVersion Include="ManagedCode.MimeTypes" Version="10.0.10" />
21+
<PackageVersion Include="ManagedCode.Communication" Version="10.2.2" />
22+
<PackageVersion Include="ManagedCode.MimeTypes" Version="10.1.1" />
2323
<PackageVersion Include="Microsoft.AspNetCore.Http" Version="2.3.12" />
2424
<PackageVersion Include="Microsoft.AspNetCore.Http.Connections.Client" Version="10.0.11" />
2525
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.11" />
@@ -33,12 +33,12 @@
3333
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.11" />
3434
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.11" />
3535
<PackageVersion Include="Microsoft.Extensions.Options" Version="10.0.11" />
36-
<PackageVersion Include="Microsoft.Graph" Version="6.5.0" />
36+
<PackageVersion Include="Microsoft.Graph" Version="6.6.0" />
3737
<PackageVersion Include="Microsoft.JSInterop" Version="10.0.11" />
3838
<PackageVersion Include="Microsoft.Playwright" Version="1.62.0" />
3939
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.9.0" />
40-
<PackageVersion Include="Microsoft.Orleans.Runtime" Version="10.2.2" />
41-
<PackageVersion Include="Microsoft.Orleans.TestingHost" Version="10.2.2" />
40+
<PackageVersion Include="Microsoft.Orleans.Runtime" Version="10.3.1" />
41+
<PackageVersion Include="Microsoft.Orleans.TestingHost" Version="10.3.1" />
4242
<PackageVersion Include="NetArchTest.Rules" Version="1.3.2" />
4343
<PackageVersion Include="Shouldly" Version="4.3.0" />
4444
<PackageVersion Include="SSH.NET" Version="2026.0.0" />

‎ManagedCode.Storage.VirtualFileSystem/Implementations/VirtualFileSystem.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ public async ValueTask<bool> FileExistsAsync(VfsPath path, CancellationToken can
7979

8080
try
8181
{
82-
var blobInfo = await _metadataManager.GetBlobInfoAsync(path.ToBlobKey(), cancellationToken);
83-
var exists = blobInfo != null;
82+
var result = await _storage.ExistsAsync(path.ToBlobKey(), cancellationToken);
83+
var exists = result.IsSuccess && result.Value;
8484

8585
if (_options.EnableCache)
8686
{

‎Storages/ManagedCode.Storage.Azure/AzureStorage.cs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,10 @@ protected override async Task<Result<BlobMetadata>> GetBlobMetadataInternalAsync
394394
MimeType = properties.Value.ContentType
395395
});
396396
}
397+
catch (RequestFailedException ex) when (ex.Status is 404)
398+
{
399+
return Result<BlobMetadata>.Fail(ex);
400+
}
397401
catch (Exception ex)
398402
{
399403
logger.LogException(ex);

‎Tests/ManagedCode.Storage.Tests/Storages/Azure/AzureBlobTests.cs‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,39 @@
1+
using System;
2+
using System.Collections.Concurrent;
3+
using System.Threading.Tasks;
4+
using ManagedCode.Storage.Azure;
5+
using ManagedCode.Storage.Azure.Options;
16
using ManagedCode.Storage.Tests.Common;
27
using ManagedCode.Storage.Tests.Storages.Abstracts;
38
using Microsoft.Extensions.DependencyInjection;
9+
using Microsoft.Extensions.Logging;
10+
using Shouldly;
411
using Testcontainers.Azurite;
12+
using Xunit;
513

614
namespace ManagedCode.Storage.Tests.Storages.Azure;
715

816
public class AzureBlobTests : BlobTests<AzuriteContainer>
917
{
18+
[Fact]
19+
public async Task GetBlobMetadataAsync_WhenBlobIsMissing_ShouldNotLogException()
20+
{
21+
var logger = new CapturingLogger<AzureStorage>();
22+
var storage = new AzureStorage(
23+
new AzureStorageOptions
24+
{
25+
ConnectionString = Container.GetConnectionString(),
26+
Container = $"metadata-{Guid.NewGuid():N}",
27+
CreateContainerIfNotExists = true
28+
},
29+
logger);
30+
31+
var result = await storage.GetBlobMetadataAsync($"missing-{Guid.NewGuid():N}.txt");
32+
33+
result.IsSuccess.ShouldBeFalse();
34+
logger.Exceptions.ShouldBeEmpty();
35+
}
36+
1037
protected override AzuriteContainer Build()
1138
{
1239
return new AzuriteBuilder(ContainerImages.Azurite)
@@ -18,4 +45,26 @@ protected override ServiceProvider ConfigureServices()
1845
{
1946
return AzureConfigurator.ConfigureServices(Container.GetConnectionString());
2047
}
48+
49+
private sealed class CapturingLogger<T> : ILogger<T>
50+
{
51+
public ConcurrentQueue<Exception> Exceptions { get; } = [];
52+
53+
public IDisposable? BeginScope<TState>(TState state) where TState : notnull => null;
54+
55+
public bool IsEnabled(LogLevel logLevel) => true;
56+
57+
public void Log<TState>(
58+
LogLevel logLevel,
59+
EventId eventId,
60+
TState state,
61+
Exception? exception,
62+
Func<TState, Exception?, string> formatter)
63+
{
64+
if (exception is not null)
65+
{
66+
Exceptions.Enqueue(exception);
67+
}
68+
}
69+
}
2170
}

‎Tests/ManagedCode.Storage.Tests/Storages/Orleans/ManagedCodeGrainStorageTests.cs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ public async Task ManagedCodeGrainStorage_ReadWriteClear_ShouldRoundTripState()
146146

147147
reloaded.RecordExists.ShouldBeTrue();
148148
reloaded.ETag.ShouldBe(state.ETag);
149+
reloaded.State.ShouldNotBeNull();
149150
reloaded.State.Name.ShouldBe("initial");
150151
reloaded.State.Count.ShouldBe(3);
151152

@@ -200,6 +201,7 @@ public async Task ManagedCodeGrainStorage_Write_WhenEtagMismatches_ShouldThrow()
200201

201202
var latest = new GrainState<TestState>();
202203
await grainStorage.ReadStateAsync("profile", grainId, latest);
204+
latest.State.ShouldNotBeNull();
203205
latest.State.Name = "latest";
204206
await grainStorage.WriteStateAsync("profile", grainId, latest);
205207

@@ -284,7 +286,7 @@ private sealed class TestGrainStorageSerializer : IGrainStorageSerializer
284286

285287
private static readonly JsonSerializerOptions SerializerOptions = new(JsonSerializerDefaults.Web);
286288

287-
public BinaryData Serialize<T>(T input)
289+
public BinaryData Serialize<T>(T? input)
288290
{
289291
return new BinaryData(JsonSerializer.SerializeToUtf8Bytes(input, SerializerOptions));
290292
}

‎Tests/ManagedCode.Storage.Tests/Storages/Orleans/ManagedCodeOrleansClusterFixture.cs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ public async Task DisposeAsync()
132132

133133
public IServiceProvider GetSiloServiceProvider()
134134
{
135-
return Cluster.GetSiloServiceProvider(Cluster.Primary.SiloAddress);
135+
var primary = Cluster.Primary ?? throw new InvalidOperationException("The test cluster has no primary silo.");
136+
return Cluster.GetSiloServiceProvider(primary.SiloAddress);
136137
}
137138

138139
public IManagedCodeStorageBackedGrain GetGrain(string providerName, string grainKey)

‎Tests/ManagedCode.Storage.Tests/VirtualFileSystem/VirtualFileSystemTests.cs‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public async Task FileExistsAsync_ShouldCacheResults()
5858
metadataManager.ResetCounters();
5959
var firstCheck = await vfs.FileExistsAsync(path);
6060
firstCheck.ShouldBeTrue();
61-
metadataManager.BlobInfoRequests.ShouldBe(1);
61+
metadataManager.BlobInfoRequests.ShouldBe(0);
6262

6363
metadataManager.ResetCounters();
6464
var secondCheck = await vfs.FileExistsAsync(path);
@@ -123,14 +123,27 @@ public async Task DeleteFile_ShouldRemoveFromUnderlyingStorage()
123123

124124
var existsAfterDelete = await vfs.FileExistsAsync(path);
125125
existsAfterDelete.ShouldBeFalse();
126-
metadataManager.BlobInfoRequests.ShouldBe(1);
126+
metadataManager.BlobInfoRequests.ShouldBe(0);
127127

128128
metadataManager.ResetCounters();
129129
var secondCheck = await vfs.FileExistsAsync(path);
130130
secondCheck.ShouldBeFalse();
131131
metadataManager.BlobInfoRequests.ShouldBe(0);
132132
}
133133

134+
[Fact]
135+
public async Task FileExistsAsync_WhenFileIsMissing_ShouldNotReadMetadata()
136+
{
137+
await using var context = await CreateContextAsync();
138+
var path = new VfsPath($"/missing/{Guid.NewGuid():N}.txt");
139+
140+
context.MetadataManager.ResetCounters();
141+
var exists = await context.FileSystem.FileExistsAsync(path);
142+
143+
exists.ShouldBeFalse();
144+
context.MetadataManager.BlobInfoRequests.ShouldBe(0);
145+
}
146+
134147
[Fact]
135148
public async Task GetMetadataAsync_ShouldCacheCustomMetadata()
136149
{

‎docs/Features/provider-azure-blob.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ builder.Services.AddAzureStorageAsDefault(options =>
5151
- Supports container creation when `CreateContainerIfNotExists = true`.
5252
- Uses Azure SDK transfer options when configured (`UploadTransferOptions`).
5353
- Builds the upload result from the successful Azure upload response and the caller's options, without issuing a second blob-properties request that can race with deletion or lifecycle processing.
54+
- Returns a failed metadata result for an absent blob without logging the expected Azure `404 BlobNotFound` response as an unhandled exception; other metadata failures retain error logging.
5455

5556
## Tests
5657

‎docs/Features/virtual-file-system.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public sealed class MyService(IVirtualFileSystem vfs)
8080
## Current Behavior
8181

8282
- Existence checks and metadata can be cached in `IMemoryCache` when enabled via `VfsOptions`.
83+
- File existence checks use `IStorage.ExistsAsync(...)`; they do not fetch blob metadata or turn an expected missing file into provider exception telemetry.
8384
- `OpenWriteAsync` currently uses a buffered write stream (`VfsWriteStream`) that uploads when the stream is disposed.
8485
- Concurrency checks can be enforced via `WriteOptions.ExpectedETag` where supported by the underlying provider.
8586

0 commit comments

Comments
 (0)