Route indexing events through a typed Event value end to end - #1394
Closed
myronmarston wants to merge 2 commits into
Closed
myronmarston wants to merge 2 commits into
myronmarston wants to merge 2 commits into
Conversation
- The indexer copied the envelope `id` into the record for every format. Only the JSON adapter knows that `record` is a Hash, so the copy belongs there. This removes the last format-specific `is_a?` check from the operation factory. - `ValidationResult` now carries the event to build operations from, so an adapter can return a prepared copy of the event. - Prepares for a typed `Event` whose `record` type is a per-format generic parameter. - Narrows `validation_result.record_preparer`/`.event` with `# : ...` type comments instead of `or raise`: both are always present together by construction once `failure` is nil, so the assertion can't fire. Generated with Claude Code
- Introduces Indexer::Event, a Data value object with a validated envelope (op, type, id, version, record, schema_version, ingestion_format, message_id, latency_timestamps), and MalformedEventError for payloads whose envelope an ingestion adapter can't turn into an Event. - Replaces raw event Hashes with Event across FailedEventError, IndexingFailuresError, Operation::Factory/Update, the JSON ingestion adapter, and the indexer_lambda/warehouse_lambda consumers. - IngestionAdapter#events_from validates each event's envelope up front and builds a MalformedEventError per malformed one, before an Event exists. - Fix _RecordPreparer[untyped] annotation in Operation::Factory to match the interface's new generic param (was left bare, which Steep now rejects). - FailedEventError delegates id/op/type/version/record/message_id to its event via Forwardable instead of manual wrapper methods. - FailedEventError and MalformedEventError include IndexingFailuresError:: _IndexingFailure so Steep enforces the interface they already satisfy. Generated with Claude Code
Collaborator
Author
|
This change is part of the following stack: Change managed by git-spice. |
myronmarston
force-pushed
the
myron/move-record-id-preparation-to-json-adapter
branch
from
September 18, 2026 19:31
7f9f74b to
bdf3b01
Compare
myronmarston
force-pushed
the
myron/move-record-id-preparation-to-json-adapter
branch
from
September 18, 2026 20:06
bdf3b01 to
d880756
Compare
myronmarston
force-pushed
the
myron/move-record-id-preparation-to-json-adapter
branch
3 times, most recently
from
September 20, 2026 01:03
f8d2c6b to
2d4edee
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Indexer::EventacrossFailedEventError,IndexingFailuresError,Operation::Factory/Update, the JSON ingestion adapter, and the indexer_lambda/warehouse_lambda consumers.IngestionAdapter#events_fromvalidates each event's envelope up front and builds aMalformedEventErrorper malformed one, before anEventexists.FailedEventError/MalformedEventErrorincludeIndexingFailuresError::_IndexingFailureso Steep enforces the interface they already satisfy;FailedEventErrordelegates toeventviaForwardableinstead of manual wrapper methods.🤖 Generated with Claude Code