From 01c1df05d7d9c61e05335dfd9a36c9fd38514325 Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Fri, 17 Nov 2023 15:56:08 +0800 Subject: [PATCH 1/3] Adding test to demonstrate that Event.persisted? is potentially misleading --- spec/event_sourcery/event_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/event_sourcery/event_spec.rb b/spec/event_sourcery/event_spec.rb index f339f5f..97b094d 100644 --- a/spec/event_sourcery/event_spec.rb +++ b/spec/event_sourcery/event_spec.rb @@ -205,6 +205,17 @@ end end + describe '#persisted?' do + subject(:persisted?) { event.persisted? } + + context 'given an Event with ID' do + let(:event_id) { SecureRandom.uuid } + let(:event) { EventSourcery::Event.new(id: event_id) } + + it { should be true } # This seems debatable + end + end + describe '#hash' do subject(:hash) { event.hash } From 0f30a4efbf4961f957f589aec25df15d0b70db13 Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Tue, 28 Nov 2023 21:59:36 +0800 Subject: [PATCH 2/3] Remove Event.persisted? --- CHANGELOG.md | 9 +++++++++ README.md | 6 ------ lib/event_sourcery/event.rb | 5 ----- lib/event_sourcery/version.rb | 2 +- spec/event_sourcery/event_spec.rb | 11 ----------- 5 files changed, 10 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce5f9fe..7ca970f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] + +## [1.0.0] - 2023-11-29 + +### Removed +- Removed Event.persisted? as it was potentially misleading ([#235]) + +[#235]: https://github.com/envato/event_sourcery/pull/235 + ## [0.24.0] - 2021-11-18 ### Added @@ -254,6 +262,7 @@ moving all Postgres related code into a separate gem. - `Command` and `CommandHandler` have been removed. [Unreleased]: https://github.com/envato/event_sourcery/compare/v0.24.0...HEAD +[1.0.0]: https://github.com/envato/event_sourcery/compare/v0.24.0...v1.0.0 [0.24.0]: https://github.com/envato/event_sourcery/compare/v0.23.1...v0.24.0 [0.23.1]: https://github.com/envato/event_sourcery/compare/v0.23.0...v0.23.1 [0.23.0]: https://github.com/envato/event_sourcery/compare/v0.22.0...v0.23.0 diff --git a/README.md b/README.md index 00e0613..c24c140 100644 --- a/README.md +++ b/README.md @@ -32,12 +32,6 @@ A framework for building event sourced, CQRS applications. - [2. Updating a Projection](#2-updating-a-projection) - [3. Handling a Query](#3-handling-a-query) -## Development Status - -EventSourcery is currently being used in production by multiple apps but we -haven't finalized the API yet and things are still moving rapidly. Until we -release a 1.0 things may change without first being deprecated. - ## Goals The goal of EventSourcery is to make it easier to build event sourced, CQRS applications. diff --git a/lib/event_sourcery/event.rb b/lib/event_sourcery/event.rb index 58d777f..e0dd7e2 100644 --- a/lib/event_sourcery/event.rb +++ b/lib/event_sourcery/event.rb @@ -95,11 +95,6 @@ def initialize(id: nil, @causation_id = causation_id end - # Is this event persisted? - def persisted? - !id.nil? - end - def hash [self.class, uuid].hash end diff --git a/lib/event_sourcery/version.rb b/lib/event_sourcery/version.rb index 70f033e..78bd7a8 100644 --- a/lib/event_sourcery/version.rb +++ b/lib/event_sourcery/version.rb @@ -1,4 +1,4 @@ module EventSourcery # Defines the version - VERSION = '0.24.0'.freeze + VERSION = '1.0.0'.freeze end diff --git a/spec/event_sourcery/event_spec.rb b/spec/event_sourcery/event_spec.rb index 97b094d..f339f5f 100644 --- a/spec/event_sourcery/event_spec.rb +++ b/spec/event_sourcery/event_spec.rb @@ -205,17 +205,6 @@ end end - describe '#persisted?' do - subject(:persisted?) { event.persisted? } - - context 'given an Event with ID' do - let(:event_id) { SecureRandom.uuid } - let(:event) { EventSourcery::Event.new(id: event_id) } - - it { should be true } # This seems debatable - end - end - describe '#hash' do subject(:hash) { event.hash } From 6121a8da9fd21f58f7610645824120cfd05e692f Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Tue, 28 Nov 2023 22:21:19 +0800 Subject: [PATCH 3/3] Adding a post 1.0.0 development status to readme.me --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index c24c140..bc46d23 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,12 @@ A framework for building event sourced, CQRS applications. - [2. Updating a Projection](#2-updating-a-projection) - [3. Handling a Query](#3-handling-a-query) +## Development Status + +[![Build Status](https://github.com/envato/event_sourcery/workflows/tests/badge.svg?branch=main)](https://github.com/envato/event_sourcery/actions?query=branch%3Amain) + +Event Sourcery is in production use at [Envato](http://envato.com). + ## Goals The goal of EventSourcery is to make it easier to build event sourced, CQRS applications.