Conversation

ejsmith

No description provided.

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 adds custom field support for events by updating the event model and repository logic, removing legacy query visitor code, and updating test infrastructure to support the new behavior.

  • Removed obsolete EventFieldsQueryVisitor usage and file.
  • Introduced automatic custom field creation in the event repository.
  • Updated the PersistentEvent model to implement virtual custom fields and modified test configurations accordingly.

Reviewed Changes

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

Show a summary per file
FileDescription
tests/Exceptionless.Tests/Search/PersistentEventQueryValidatorTests.csRemoved legacy query visitor call in tests.
tests/Exceptionless.Tests/Search/EventIndexTests.csUpdated repository query to include organization filtering.
tests/Exceptionless.Tests/Migrations/FixDuplicateStacksMigrationTests.csSet log level to Trace for migration tests.
tests/Exceptionless.Tests/AppWebHostFactory.csAdded Kibana container configuration.
src/Exceptionless.Core/Repositories/Queries/Visitors/EventFieldsQueryVisitor.csRemoved unused visitor implementation.
src/Exceptionless.Core/Repositories/EventRepository.csAdded auto-creation of custom fields and related tenant logic.
src/Exceptionless.Core/Repositories/Configuration/Indexes/EventIndex.csRemoved legacy dynamic mapping for event index custom fields.
src/Exceptionless.Core/Repositories/Configuration/ExceptionlessElasticConfiguration.csAdded index creation for custom fields.
src/Exceptionless.Core/Models/PersistentEvent.csUpdated Idx property type and implemented IHaveVirtualCustomFields.
Files not reviewed (1)
  • src/Exceptionless.Core/Exceptionless.Core.csproj: Language not supported

public IDictionary<string, object?> Idx { get; set; } = new DataDictionary();

object? IHaveVirtualCustomFields.GetCustomField(string name) => Data?[name];
IDictionary<string, object?> IHaveVirtualCustomFields.GetCustomFields() => Data ?? [];
Copy link
Preview

Copilot AI Apr 30, 2025

Choose a reason for hiding this comment

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

Using an empty array literal '[]' as a fallback for an IDictionary<string, object?> is invalid. Replace '[]' with an appropriate empty dictionary initializer (e.g. 'new DataDictionary()').

Suggested change
IDictionary<string, object?> IHaveVirtualCustomFields.GetCustomFields() => Data ?? [];
IDictionary<string, object?> IHaveVirtualCustomFields.GetCustomFields() => Data ?? new DataDictionary();

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on . Already have an account? Sign in to comment

Successfully merging this pull request may close these issues.