Skip to content

Extract EventLogExpert.ProviderDatabase library with IProviderDetailsLookup abstraction#536

Merged
jschick04 merged 19 commits into
mainfrom
jschick/provider-db-extraction
May 22, 2026
Merged

Extract EventLogExpert.ProviderDatabase library with IProviderDetailsLookup abstraction#536
jschick04 merged 19 commits into
mainfrom
jschick/provider-db-extraction

Conversation

@jschick04
Copy link
Copy Markdown
Collaborator

Extracts the provider-database EF Core types from EventLogExpert.Eventing into a new EventLogExpert.ProviderDatabase library, breaking the dependency cycle via an IProviderDetailsLookup abstraction.

Changes

TestUtils scaffolding

  • New empty class library projects: Runtime.TestUtils, UI.TestUtils, ProviderDatabase.TestUtils
  • Registered in EventLogExpert.slnx under /tests/Shared/

Characterization tests (+18 tests)

  • ProviderDatabaseSchemaState boundary tests (NeedsUpgrade for Unknown/v1/v2/v3/Current/Current+1)
  • SchemaStateMessages formatting tests
  • DatabaseUpgradeException ctor/property tests
  • ProviderDetails internal lookup tests (GetEventsById, GetMessagesByShortId with ushort promotion edge case, setter cache invalidation)

ProviderDatabase library extraction

  • New EventLogExpert.ProviderDatabase library with EF Core types: ProviderDbContext, CompressedJsonValueConverter, ProviderDetailsMerger, ProviderJsonContext, ProviderJsonSerializerOptions, ProviderDbContextFactory
  • Schema DTOs and interfaces remain in Eventing: IProviderDetailsLookup, IProviderDetailsLookupFactory, ProviderDatabaseSchemaState, ProviderDatabaseSchemaVersion, SchemaStateMessages, DatabaseUpgradeException
  • IProviderDetailsLookup abstraction decouples EventResolver from concrete ProviderDbContext (no EF Core dependency in Eventing)
  • EF Core Sqlite removed from Eventing, replaced with Microsoft.Extensions.Logging.Abstractions
  • Namespace renamed from EventLogExpert.Eventing.ProviderDatabase to EventLogExpert.ProviderDatabase for moved files
  • All consumer ProjectReferences updated (Runtime, EventDbTool, test projects)
  • Factory registered in MauiProgram.cs DI container

Test results

2,193 tests passing (baseline 2,175 + 18 new characterization tests), 0 failures

Copilot AI review requested due to automatic review settings May 21, 2026 04:12
@jschick04 jschick04 requested a review from a team as a code owner May 21, 2026 04:12
@jschick04 jschick04 marked this pull request as draft May 21, 2026 04:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extracts the EF Core/SQLite-backed provider database implementation from EventLogExpert.Eventing into a new EventLogExpert.ProviderDatabase library, and introduces an IProviderDetailsLookup/IProviderDetailsLookupFactory abstraction so EventResolver can query provider databases without depending on EF Core.

Changes:

  • Introduces EventLogExpert.ProviderDatabase project containing the EF Core ProviderDbContext and related serialization/merge utilities, and wires it into solution/project references.
  • Adds IProviderDetailsLookup + IProviderDetailsLookupFactory in Eventing and updates EventResolver to use these abstractions.
  • Adds characterization/unit tests for schema state/messages/upgrade exception and provider details lookup behaviors; adds shared *.TestUtils scaffolding projects.

Reviewed changes

Copilot reviewed 43 out of 43 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Unit/EventLogExpert.Eventing.Tests/Providers/ProviderDetailsTests.cs Adds coverage for provider details cached lookups (events/messages) and cache invalidation.
tests/Unit/EventLogExpert.Eventing.Tests/ProviderDatabase/SchemaStateMessagesTests.cs Adds formatting tests for shared schema-state user messages.
tests/Unit/EventLogExpert.Eventing.Tests/ProviderDatabase/ProviderJsonContextTests.cs Updates namespace import for moved JSON context.
tests/Unit/EventLogExpert.Eventing.Tests/ProviderDatabase/ProviderDetailsMergerTests.cs Updates imports to reference moved merger implementation.
tests/Unit/EventLogExpert.Eventing.Tests/ProviderDatabase/ProviderDatabaseSchemaStateTests.cs Adds boundary tests for NeedsUpgrade across versions.
tests/Unit/EventLogExpert.Eventing.Tests/ProviderDatabase/DatabaseUpgradeExceptionTests.cs Adds tests for DatabaseUpgradeException message/properties.
tests/Unit/EventLogExpert.Eventing.Tests/ProviderDatabase/CompressedJsonValueConverterTests.cs Updates namespace import for moved converter.
tests/Unit/EventLogExpert.Eventing.Tests/EventLogExpert.Eventing.Tests.csproj Adds project reference to EventLogExpert.ProviderDatabase.
tests/Shared/EventLogExpert.UI.TestUtils/EventLogExpert.UI.TestUtils.csproj Adds new shared UI test utils project referencing UI.
tests/Shared/EventLogExpert.Runtime.TestUtils/EventLogExpert.Runtime.TestUtils.csproj Adds new shared runtime test utils project referencing Runtime.
tests/Shared/EventLogExpert.ProviderDatabase.TestUtils/EventLogExpert.ProviderDatabase.TestUtils.csproj Adds new shared provider-db test utils project referencing ProviderDatabase + Eventing.TestUtils.
tests/Shared/EventLogExpert.Eventing.TestUtils/EventLogExpert.Eventing.TestUtils.csproj Adds project reference to EventLogExpert.ProviderDatabase.
tests/Integration/EventLogExpert.Runtime.IntegrationTests/TestUtils/DatabaseSeedUtils.cs Updates namespace import for moved provider DB types.
tests/Integration/EventLogExpert.Eventing.IntegrationTests/Resolvers/VersatileEventResolverTests.cs Updates namespace import for moved provider DB types.
tests/Integration/EventLogExpert.Eventing.IntegrationTests/Resolvers/EventProviderDatabaseEventResolverTests.cs Updates namespace import for moved provider DB types.
tests/Integration/EventLogExpert.Eventing.IntegrationTests/ProviderDatabase/ProviderDbContextTests.cs Updates imports to include moved provider DB implementation.
tests/Integration/EventLogExpert.Eventing.IntegrationTests/EventLogExpert.Eventing.IntegrationTests.csproj Adds project reference to EventLogExpert.ProviderDatabase.
tests/Integration/EventLogExpert.EventDbTool.IntegrationTests/UpgradeDatabaseCommandTests.cs Updates imports to include moved provider DB implementation.
tests/Integration/EventLogExpert.EventDbTool.IntegrationTests/TestUtils/DatabaseTestUtils.cs Updates namespace import for moved provider DB types.
tests/Integration/EventLogExpert.EventDbTool.IntegrationTests/DiffDatabaseCommandTests.cs Updates namespace import for moved provider DB types.
tests/Integration/EventLogExpert.EventDbTool.IntegrationTests/CreateDatabaseCommandTests.cs Updates namespace import for moved provider DB types.
src/EventLogExpert/MauiProgram.cs Registers IProviderDetailsLookupFactory and updates usings.
src/EventLogExpert.Runtime/EventLogExpert.Runtime.csproj Adds project reference to EventLogExpert.ProviderDatabase.
src/EventLogExpert.Runtime/Database/DatabaseService.cs Updates imports to include moved provider DB implementation.
src/EventLogExpert.ProviderDatabase/ProviderJsonSerializerOptions.cs Moves namespace to EventLogExpert.ProviderDatabase.
src/EventLogExpert.ProviderDatabase/ProviderJsonContext.cs Moves namespace to EventLogExpert.ProviderDatabase.
src/EventLogExpert.ProviderDatabase/ProviderDetailsMerger.cs Moves namespace and references schema/exception types retained in Eventing.
src/EventLogExpert.ProviderDatabase/ProviderDbContextFactory.cs Adds concrete factory implementing IProviderDetailsLookupFactory.
src/EventLogExpert.ProviderDatabase/ProviderDbContext.cs Moves namespace; implements IProviderDetailsLookup; sets no-tracking for read-only.
src/EventLogExpert.ProviderDatabase/EventLogExpert.ProviderDatabase.csproj New project for extracted EF Core provider database implementation.
src/EventLogExpert.ProviderDatabase/CompressedJsonValueConverter.cs Moves namespace to EventLogExpert.ProviderDatabase.
src/EventLogExpert.Eventing/Resolvers/EventResolver.cs Switches database access from ProviderDbContext to IProviderDetailsLookup + factory.
src/EventLogExpert.Eventing/ProviderDatabase/IProviderDetailsLookupFactory.cs Adds factory abstraction for creating provider DB lookup instances.
src/EventLogExpert.Eventing/ProviderDatabase/IProviderDetailsLookup.cs Adds lookup abstraction used by EventResolver.
src/EventLogExpert.Eventing/EventLogExpert.Eventing.csproj Removes EF Core dependency; adds logging abstractions package.
src/EventLogExpert.EventDbTool/UpgradeDatabaseCommand.cs Updates imports and adds reference to ProviderDatabase project types.
src/EventLogExpert.EventDbTool/ProviderSource.cs Updates imports and adds reference to ProviderDatabase project types.
src/EventLogExpert.EventDbTool/MergeDatabaseCommand.cs Updates imports and adds reference to ProviderDatabase project types.
src/EventLogExpert.EventDbTool/EventLogExpert.EventDbTool.csproj Adds project reference to EventLogExpert.ProviderDatabase.
src/EventLogExpert.EventDbTool/DiffDatabaseCommand.cs Updates namespace import for moved provider DB types.
src/EventLogExpert.EventDbTool/CreateDatabaseCommand.cs Updates imports for moved provider DB types.
EventLogExpert.slnx Adds ProviderDatabase and new shared test utils projects to solution.
Directory.Packages.props Adds Microsoft.Extensions.Logging.Abstractions package version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/EventLogExpert.Eventing/Resolvers/EventResolver.cs
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 43 out of 43 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings May 21, 2026 18:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 63 out of 63 changed files in this pull request and generated 2 comments.

Comment thread src/EventLogExpert.Eventing/Resolvers/EventResolver.cs Outdated
Comment thread tests/Unit/EventLogExpert.Runtime.Tests/EventLog/EffectsTests.cs
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 63 out of 63 changed files in this pull request and generated 1 comment.

Comment thread src/EventLogExpert.UI/Menu/MenuBar.razor.cs
@jschick04 jschick04 marked this pull request as ready for review May 22, 2026 01:24
Copilot AI review requested due to automatic review settings May 22, 2026 01:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 140 out of 148 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

src/EventLogExpert.Filtering/Evaluation/ResolvedEventExtensions.cs:8

  • using EventLogExpert.Filtering.Evaluation; is redundant here since the file is already in the EventLogExpert.Filtering.Evaluation namespace, and it can introduce unnecessary-using warnings. Removing it keeps the file cleaner and avoids analyzer noise.
    src/EventLogExpert.Filtering/Evaluation/FilterExtensions.cs:6
  • using EventLogExpert.Filtering.Evaluation; is unnecessary in a file that already declares namespace EventLogExpert.Filtering.Evaluation;. Dropping it avoids redundant-usings warnings and keeps the header minimal.

Comment thread src/EventLogExpert.Eventing/Resolvers/EventResolver.cs
bill-long
bill-long previously approved these changes May 22, 2026
…adapters, align Filtering test mirrors and Common/<Domain>/
Copilot AI review requested due to automatic review settings May 22, 2026 07:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 199 out of 207 changed files in this pull request and generated 2 comments.

Comment thread src/EventLogExpert.Eventing/Resolvers/EventResolver.cs
@jschick04 jschick04 merged commit 9608ba1 into main May 22, 2026
7 checks passed
@jschick04 jschick04 deleted the jschick/provider-db-extraction branch May 22, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants