Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullMapper in form of Default + null serializer #575

Merged
merged 4 commits into from Apr 24, 2019
Merged

Conversation

@pawelpacana
Copy link
Member

pawelpacana commented Apr 23, 2019

Closes #552

@pawelpacana

This comment has been minimized.

Copy link
Member Author

pawelpacana commented Apr 23, 2019

Aside: in matchers for testing rspec-matchers we rely on the fact that NullMapper returns same object instance. Probably something we cannot depend on when taking route presented in this PR.

@pawelpacana pawelpacana force-pushed the null-serializer branch from 753e951 to 783fd0b Apr 23, 2019
@pawelpacana pawelpacana requested a review from mpraglowski Apr 23, 2019
@pawelpacana pawelpacana force-pushed the null-serializer branch 2 times, most recently from 51e484e to efac01e Apr 23, 2019
pawelpacana added 4 commits Apr 23, 2019
Loosen SerializedRecord data/metadata type constraint to allow null
serialization: in-memory repository would not require such constraint
and that resposibility can be moved to serializer (although no need
to do so for upstream JSON and YAML)

This change makes NullMapper do the conversion to and from
SerializedRecord: pro is that we can expect to_h, hash and event_type
to exhibit correct behaviour (as compared to output of a non-null mapper).

The con is that it makes additional allocations when converting from
events to and from records. Probably unavoidable given how
SerializedRecord diverged from an Event.
This simplifies verifying correct matcher messages. Worked with initial
NullMapper, may not with future ones.

In the long run we might drop showing object_id in matcher messages and
eventually not need this quality of mapper here.
Closes #551.
@pawelpacana pawelpacana force-pushed the null-serializer branch from efac01e to 78b6d75 Apr 24, 2019
@pawelpacana pawelpacana merged commit 37d8cf3 into master Apr 24, 2019
55 of 63 checks passed
55 of 63 checks passed
ci/circleci: mutate_bounded_context_ruby_2_6 Your tests are queued behind your running builds
Details
ci/circleci: mutate_rails_event_store_active_record_ruby_2_6 Your tests are queued behind your running builds
Details
ci/circleci: mutate_rails_event_store_rspec_ruby_2_6 CircleCI is running your tests
Details
ci/circleci: mutate_rails_event_store_ruby_2_6 CircleCI is running your tests
Details
ci/circleci: mutate_ruby_event_store_browser_ruby_2_6 Your tests are queued behind your running builds
Details
ci/circleci: mutate_ruby_event_store_rom_ruby_2_6 Your tests are queued behind your running builds
Details
ci/circleci: mutate_ruby_event_store_ruby_2_6 CircleCI is running your tests
Details
ci/circleci: test_rails_event_store_active_record_postgres CircleCI is running your tests
Details
Check configuration Workflow: Check configuration
Details
Current Ruby Workflow: Current Ruby
Details
JSON data type Workflow: JSON data type
Details
JSONB data type Workflow: JSONB data type
Details
MySQL Workflow: MySQL
Details
PostgreSQL Workflow: PostgreSQL
Details
Rails 4.2 Workflow: Rails 4.2
Details
Rails 5.0 Workflow: Rails 5.0
Details
Rails 5.1 Workflow: Rails 5.1
Details
Ruby 2.4 Workflow: Ruby 2.4
Details
Ruby 2.5 Workflow: Ruby 2.5
Details
ci/circleci: check_config Your tests passed on CircleCI!
Details
ci/circleci: mutate_aggregate_root_ruby_2_6 Your tests passed on CircleCI!
Details
ci/circleci: test_aggregate_root_ruby_2_4 Your tests passed on CircleCI!
Details
ci/circleci: test_aggregate_root_ruby_2_5 Your tests passed on CircleCI!
Details
ci/circleci: test_aggregate_root_ruby_2_6 Your tests passed on CircleCI!
Details
ci/circleci: test_bounded_context_rails_4_2 Your tests passed on CircleCI!
Details
ci/circleci: test_bounded_context_rails_5_0 Your tests passed on CircleCI!
Details
ci/circleci: test_bounded_context_rails_5_1 Your tests passed on CircleCI!
Details
ci/circleci: test_bounded_context_ruby_2_4 Your tests passed on CircleCI!
Details
ci/circleci: test_bounded_context_ruby_2_5 Your tests passed on CircleCI!
Details
ci/circleci: test_bounded_context_ruby_2_6 Your tests passed on CircleCI!
Details
ci/circleci: test_rails_event_store_active_record_mysql Your tests passed on CircleCI!
Details
ci/circleci: test_rails_event_store_active_record_rails_4_2 Your tests passed on CircleCI!
Details
ci/circleci: test_rails_event_store_active_record_rails_5_0 Your tests passed on CircleCI!
Details
ci/circleci: test_rails_event_store_active_record_rails_5_1 Your tests passed on CircleCI!
Details
ci/circleci: test_rails_event_store_active_record_ruby_2_4 Your tests passed on CircleCI!
Details
ci/circleci: test_rails_event_store_active_record_ruby_2_5 Your tests passed on CircleCI!
Details
ci/circleci: test_rails_event_store_active_record_ruby_2_6 Your tests passed on CircleCI!
Details
ci/circleci: test_rails_event_store_rails_4_2 Your tests passed on CircleCI!
Details
ci/circleci: test_rails_event_store_rails_5_0 Your tests passed on CircleCI!
Details
ci/circleci: test_rails_event_store_rails_5_1 Your tests passed on CircleCI!
Details
ci/circleci: test_rails_event_store_rspec_rails_4_2 Your tests passed on CircleCI!
Details
ci/circleci: test_rails_event_store_rspec_rails_5_0 Your tests passed on CircleCI!
Details
ci/circleci: test_rails_event_store_rspec_rails_5_1 Your tests passed on CircleCI!
Details
ci/circleci: test_rails_event_store_rspec_ruby_2_4 Your tests passed on CircleCI!
Details
ci/circleci: test_rails_event_store_rspec_ruby_2_5 Your tests passed on CircleCI!
Details
ci/circleci: test_rails_event_store_rspec_ruby_2_6 Your tests passed on CircleCI!
Details
ci/circleci: test_rails_event_store_ruby_2_4 Your tests passed on CircleCI!
Details
ci/circleci: test_rails_event_store_ruby_2_5 Your tests passed on CircleCI!
Details
ci/circleci: test_rails_event_store_ruby_2_6 Your tests passed on CircleCI!
Details
ci/circleci: test_ruby_event_store_browser_ruby_2_4 Your tests passed on CircleCI!
Details
ci/circleci: test_ruby_event_store_browser_ruby_2_5 Your tests passed on CircleCI!
Details
ci/circleci: test_ruby_event_store_browser_ruby_2_6 Your tests passed on CircleCI!
Details
ci/circleci: test_ruby_event_store_rom_data_type_json Your tests passed on CircleCI!
Details
ci/circleci: test_ruby_event_store_rom_data_type_jsonb Your tests passed on CircleCI!
Details
ci/circleci: test_ruby_event_store_rom_mysql Your tests passed on CircleCI!
Details
ci/circleci: test_ruby_event_store_rom_postgres Your tests passed on CircleCI!
Details
ci/circleci: test_ruby_event_store_rom_ruby_2_4 Your tests passed on CircleCI!
Details
ci/circleci: test_ruby_event_store_rom_ruby_2_5 Your tests passed on CircleCI!
Details
ci/circleci: test_ruby_event_store_rom_ruby_2_6 Your tests passed on CircleCI!
Details
ci/circleci: test_ruby_event_store_ruby_2_4 Your tests passed on CircleCI!
Details
ci/circleci: test_ruby_event_store_ruby_2_5 Your tests passed on CircleCI!
Details
ci/circleci: test_ruby_event_store_ruby_2_6 Your tests passed on CircleCI!
Details
deploy/netlify Deploy preview ready!
Details
@pawelpacana pawelpacana deleted the null-serializer branch Apr 24, 2019
@pawelpacana pawelpacana removed the request for review from mpraglowski Apr 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.