feat: add Reachability Center and Why Drawer components with tests
Some checks failed
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Concelier Attestation Tests / attestation-tests (push) Has been cancelled
Docs CI / lint-and-preview (push) Has been cancelled

- Implemented ReachabilityCenterComponent for displaying asset reachability status with summary and filtering options.
- Added ReachabilityWhyDrawerComponent to show detailed reachability evidence and call paths.
- Created unit tests for both components to ensure functionality and correctness.
- Updated accessibility test results for the new components.
This commit is contained in:
master
2025-12-12 18:50:35 +02:00
parent efaf3cb789
commit 3f3473ee3a
320 changed files with 10635 additions and 3677 deletions

View File

@@ -11,33 +11,33 @@ using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Http;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Time.Testing;
using MongoDB.Bson;
using MongoDB.Driver;
using StellaOps.Concelier.Models;
using StellaOps.Concelier.Connector.Common;
using StellaOps.Concelier.Connector.Common.Http;
using StellaOps.Concelier.Connector.Common.Testing;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Time.Testing;
using StellaOps.Concelier.Bson;
using StellaOps.Concelier.Models;
using StellaOps.Concelier.Connector.Common;
using StellaOps.Concelier.Connector.Common.Http;
using StellaOps.Concelier.Connector.Common.Testing;
using StellaOps.Concelier.Connector.Vndr.Adobe;
using StellaOps.Concelier.Connector.Vndr.Adobe.Configuration;
using StellaOps.Concelier.Storage.Mongo;
using StellaOps.Concelier.Storage.Mongo.Advisories;
using StellaOps.Concelier.Storage.Mongo;
using StellaOps.Concelier.Storage.Mongo;
using StellaOps.Concelier.Storage.Mongo.PsirtFlags;
using StellaOps.Concelier.Testing;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.Advisories;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage;
using StellaOps.Concelier.Storage.PsirtFlags;
using StellaOps.Concelier.Storage.Postgres;
using StellaOps.Concelier.Testing;
namespace StellaOps.Concelier.Connector.Vndr.Adobe.Tests;
[Collection("mongo-fixture")]
[Collection(ConcelierFixtureCollection.Name)]
public sealed class AdobeConnectorFetchTests : IAsyncLifetime
{
private readonly MongoIntegrationFixture _fixture;
private readonly ConcelierPostgresFixture _fixture;
private readonly FakeTimeProvider _timeProvider;
public AdobeConnectorFetchTests(MongoIntegrationFixture fixture)
public AdobeConnectorFetchTests(ConcelierPostgresFixture fixture)
{
_fixture = fixture;
_timeProvider = new FakeTimeProvider(new DateTimeOffset(2025, 9, 10, 0, 0, 0, TimeSpan.Zero));
@@ -259,12 +259,10 @@ public sealed class AdobeConnectorFetchTests : IAsyncLifetime
Assert.Equal(normalizedExpected, normalizedSnapshot);
var flagsCollection = _fixture.Database.GetCollection<BsonDocument>("psirt_flags");
var rawFlags = await flagsCollection.Find(Builders<BsonDocument>.Filter.Empty).ToListAsync();
Assert.NotEmpty(rawFlags);
var flagRecord = rawFlags.Single(doc => doc["_id"].AsString == "APSB25-87");
Assert.Equal("Adobe", flagRecord["vendor"].AsString);
var psirtStore = provider.GetRequiredService<IPsirtFlagStore>();
var flagRecord = await psirtStore.FindAsync("APSB25-87", CancellationToken.None);
Assert.NotNull(flagRecord);
Assert.Equal("Adobe", flagRecord!.Vendor);
}
[Fact]
@@ -321,21 +319,21 @@ public sealed class AdobeConnectorFetchTests : IAsyncLifetime
Assert.True(state.Cursor.TryGetValue("pendingMappings", out var pendingMap) && pendingMap.AsBsonArray.Count == 0);
}
private async Task<ServiceProvider> BuildServiceProviderAsync(CannedHttpMessageHandler handler)
{
await _fixture.Client.DropDatabaseAsync(_fixture.Database.DatabaseNamespace.DatabaseName);
private async Task<ServiceProvider> BuildServiceProviderAsync(CannedHttpMessageHandler handler)
{
await _fixture.TruncateAllTablesAsync();
var services = new ServiceCollection();
services.AddLogging(builder => builder.AddProvider(NullLoggerProvider.Instance));
services.AddSingleton<TimeProvider>(_timeProvider);
services.AddSingleton(handler);
services.AddMongoStorage(options =>
{
options.ConnectionString = _fixture.Runner.ConnectionString;
options.DatabaseName = _fixture.Database.DatabaseNamespace.DatabaseName;
options.CommandTimeout = TimeSpan.FromSeconds(5);
});
services.AddConcelierPostgresStorage(options =>
{
options.ConnectionString = _fixture.ConnectionString;
options.SchemaName = _fixture.SchemaName;
options.CommandTimeoutSeconds = 5;
});
services.AddSourceCommon();
services.AddAdobeConnector(opts =>
@@ -353,11 +351,8 @@ public sealed class AdobeConnectorFetchTests : IAsyncLifetime
});
});
var provider = services.BuildServiceProvider();
var bootstrapper = provider.GetRequiredService<MongoBootstrapper>();
await bootstrapper.InitializeAsync(CancellationToken.None);
return provider;
}
return services.BuildServiceProvider();
}
private static void SeedIndex(CannedHttpMessageHandler handler)
{