Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,26 @@ jobs:
RAILS_ENV: test
PG_EVENTSTORE_URI: postgresql://postgres:postgres@localhost:5532/eventstore_test

# PG_EVENTSTORE_URI is required on every rake invocation, not just the
# eventstore ones: pg_eventstore 3.0's setup.rake resolves the URI via
# ENV.fetch at LOAD time (inside a top-level `configure` block), and the
# Rakefile loads that file unconditionally. Without it, unrelated tasks such
# as db:create abort with `KeyError: key not found: "PG_EVENTSTORE_URI"`.
- name: Set up test database
if: matrix.gem != 'yes-auth'
run: bundle exec rake db:create db:migrate
working-directory: ${{ matrix.gem }}
env:
RAILS_ENV: test
PG_EVENTSTORE_URI: postgresql://postgres:postgres@localhost:5532/eventstore_test

- name: Set up message bus database
if: matrix.gem == 'yes-command-api'
run: bundle exec rake app:db:migrate:message_bus
working-directory: ${{ matrix.gem }}
env:
RAILS_ENV: test
PG_EVENTSTORE_URI: postgresql://postgres:postgres@localhost:5532/eventstore_test

- name: Run specs
run: bundle exec rspec
Expand Down
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,34 @@

All notable changes to this project will be documented in this file.

## [2.0.0] - 2026-07-28

Major bump because `yes-core` now requires `pg_eventstore` v3, whose schema is
incompatible with v1. Released as 2.0.0 rather than 1.5.0 deliberately: consumers
constrain these gems at `~> 1.3`, which 1.5.0 would satisfy, so a minor bump could
be pulled in by an unrelated `bundle update` and put v3 code against a v1 store.
2.0.0 makes that impossible.

⚠️ **Do not adopt until your event store has been migrated to v3.** Migrating is a
one-way, downtime-requiring operation — see the `pg_eventstore` upgrade notes.

### yes-core

#### Changed
- **Breaking change**: `pg_eventstore` dependency `~> 1.0` → `~> 3.0`.
- **Breaking change**: OpenTelemetry span attribute `event.link_id` is now
`event.link_global_position`, in `Commands::Stateless::Handler` and
`CommandHandling::EventPublisher`. `pg_eventstore` v3 drops `events.link_id`
(migration 13) in favour of the bigint `link_global_position`, so `Event#link_id`
raises `NoMethodError`. Mirrors the same change in `yousty-eventsourcing` 16.0.0.
**Update any dashboards or trace queries keyed on `event.link_id`.**

### yes-auth

#### Changed
- **Breaking change**: `yes-core` dependency `~> 1.0` → `~> 2.0`, required to stay
resolvable alongside yes-core 2.0.0.

## [1.4.0] - 2026-06-24

### yes-command-api
Expand Down
28 changes: 14 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
PATH
remote: yes-auth
specs:
yes-auth (1.4.0)
yes-auth (2.0.0)
rails (>= 7.1)
yes-core (~> 1.0)
yes-core (~> 2.0)

PATH
remote: yes-command-api
specs:
yes-command-api (1.4.0)
yes-command-api (2.0.0)
message_bus (~> 4.0)
rails (>= 7.1)
yes-core

PATH
remote: yes-core
specs:
yes-core (1.4.0)
yes-core (2.0.0)
cerbos (~> 0.8)
dry-inflector (~> 1.2)
dry-schema (~> 1.13)
Expand All @@ -25,14 +25,14 @@ PATH
has_scope (~> 0.8)
jsonapi-serializer (~> 2.2)
opentelemetry-sdk (~> 1.0)
pg_eventstore (~> 1.0)
pg_eventstore (~> 3.0)
rails (>= 7.1)
zeitwerk (~> 2.6)

PATH
remote: yes-read-api
specs:
yes-read-api (1.4.0)
yes-read-api (2.0.0)
api-pagination (~> 5.0)
pagy (~> 6.0)
rails (>= 7.1)
Expand Down Expand Up @@ -299,9 +299,9 @@ GEM
pg (1.6.3-x86_64-darwin)
pg (1.6.3-x86_64-linux)
pg (1.6.3-x86_64-linux-musl)
pg_eventstore (1.13.4)
connection_pool (~> 2.4)
pg (~> 1.5)
pg_eventstore (3.0.0)
connection_pool (>= 2.5.4, < 4)
pg (~> 1)
sinatra (>= 3, < 5)
pp (0.6.3)
prettyprint
Expand Down Expand Up @@ -531,7 +531,7 @@ CHECKSUMS
pg (1.6.3-x86_64-darwin) sha256=ee2e04a17c0627225054ffeb43e31a95be9d7e93abda2737ea3ce4a62f2729d6
pg (1.6.3-x86_64-linux) sha256=5d9e188c8f7a0295d162b7b88a768d8452a899977d44f3274d1946d67920ae8d
pg (1.6.3-x86_64-linux-musl) sha256=9c9c90d98c72f78eb04c0f55e9618fe55d1512128e411035fe229ff427864009
pg_eventstore (1.13.4) sha256=45ff50db33fc86b1dc72e515e30c33bda0334fc255362a81600c93a6799ee413
pg_eventstore (3.0.0) sha256=7cbed46560952efd36b8f02510d99a55604a3771a4698a697dcdab9930bc08ea
pp (0.6.3) sha256=2951d514450b93ccfeb1df7d021cae0da16e0a7f95ee1e2273719669d0ab9df6
prettyprint (0.2.0) sha256=2bc9e15581a94742064a3cc8b0fb9d45aae3d03a1baa6ef80922627a0766f193
prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
Expand Down Expand Up @@ -571,10 +571,10 @@ CHECKSUMS
useragent (0.16.11) sha256=700e6413ad4bb954bb63547fa098dddf7b0ebe75b40cc6f93b8d54255b173844
websocket-driver (0.8.0) sha256=ed0dba4b943c22f17f9a734817e808bc84cdce6a7e22045f5315aa57676d4962
websocket-extensions (0.1.5) sha256=1c6ba63092cda343eb53fc657110c71c754c56484aad42578495227d717a8241
yes-auth (1.4.0)
yes-command-api (1.4.0)
yes-core (1.4.0)
yes-read-api (1.4.0)
yes-auth (2.0.0)
yes-command-api (2.0.0)
yes-core (2.0.0)
yes-read-api (2.0.0)
zeitwerk (2.7.5) sha256=d8da92128c09ea6ec62c949011b00ed4a20242b255293dd66bf41545398f73dd

RUBY VERSION
Expand Down
2 changes: 1 addition & 1 deletion lib/yes/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Yes
VERSION = '1.4.0'
VERSION = '2.0.0'
end
20 changes: 10 additions & 10 deletions yes-auth/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ../yes-core
specs:
yes-core (1.4.0)
yes-core (2.0.0)
cerbos (~> 0.8)
dry-inflector (~> 1.2)
dry-schema (~> 1.13)
Expand All @@ -10,16 +10,16 @@ PATH
has_scope (~> 0.8)
jsonapi-serializer (~> 2.2)
opentelemetry-sdk (~> 1.0)
pg_eventstore (~> 1.0)
pg_eventstore (~> 3.0)
rails (>= 7.1)
zeitwerk (~> 2.6)

PATH
remote: .
specs:
yes-auth (1.4.0)
yes-auth (2.0.0)
rails (>= 7.1)
yes-core (~> 1.0)
yes-core (~> 2.0)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -273,9 +273,9 @@ GEM
pg (1.6.3-x86_64-darwin)
pg (1.6.3-x86_64-linux)
pg (1.6.3-x86_64-linux-musl)
pg_eventstore (1.13.4)
connection_pool (~> 2.4)
pg (~> 1.5)
pg_eventstore (3.0.0)
connection_pool (>= 2.5.4, < 4)
pg (~> 1)
sinatra (>= 3, < 5)
pp (0.6.3)
prettyprint
Expand Down Expand Up @@ -497,7 +497,7 @@ CHECKSUMS
pg (1.6.3-x86_64-darwin) sha256=ee2e04a17c0627225054ffeb43e31a95be9d7e93abda2737ea3ce4a62f2729d6
pg (1.6.3-x86_64-linux) sha256=5d9e188c8f7a0295d162b7b88a768d8452a899977d44f3274d1946d67920ae8d
pg (1.6.3-x86_64-linux-musl) sha256=9c9c90d98c72f78eb04c0f55e9618fe55d1512128e411035fe229ff427864009
pg_eventstore (1.13.4) sha256=45ff50db33fc86b1dc72e515e30c33bda0334fc255362a81600c93a6799ee413
pg_eventstore (3.0.0) sha256=7cbed46560952efd36b8f02510d99a55604a3771a4698a697dcdab9930bc08ea
pp (0.6.3) sha256=2951d514450b93ccfeb1df7d021cae0da16e0a7f95ee1e2273719669d0ab9df6
prettyprint (0.2.0) sha256=2bc9e15581a94742064a3cc8b0fb9d45aae3d03a1baa6ef80922627a0766f193
prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
Expand Down Expand Up @@ -542,8 +542,8 @@ CHECKSUMS
useragent (0.16.11) sha256=700e6413ad4bb954bb63547fa098dddf7b0ebe75b40cc6f93b8d54255b173844
websocket-driver (0.8.0) sha256=ed0dba4b943c22f17f9a734817e808bc84cdce6a7e22045f5315aa57676d4962
websocket-extensions (0.1.5) sha256=1c6ba63092cda343eb53fc657110c71c754c56484aad42578495227d717a8241
yes-auth (1.4.0)
yes-core (1.4.0)
yes-auth (2.0.0)
yes-core (2.0.0)
zeitwerk (2.7.5) sha256=d8da92128c09ea6ec62c949011b00ed4a20242b255293dd66bf41545398f73dd

RUBY VERSION
Expand Down
2 changes: 1 addition & 1 deletion yes-auth/lib/yes/auth/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module Yes
module Auth
VERSION = '1.4.0'
VERSION = '2.0.0'
end
end
2 changes: 1 addition & 1 deletion yes-auth/yes-auth.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ Gem::Specification.new do |spec|
spec.require_paths = ['lib']

spec.add_dependency 'rails', '>= 7.1'
spec.add_dependency 'yes-core', '~> 1.0'
spec.add_dependency 'yes-core', '~> 2.0'
end
18 changes: 9 additions & 9 deletions yes-command-api/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ GIT
PATH
remote: ../yes-core
specs:
yes-core (1.4.0)
yes-core (2.0.0)
cerbos (~> 0.8)
dry-inflector (~> 1.2)
dry-schema (~> 1.13)
Expand All @@ -17,14 +17,14 @@ PATH
has_scope (~> 0.8)
jsonapi-serializer (~> 2.2)
opentelemetry-sdk (~> 1.0)
pg_eventstore (~> 1.0)
pg_eventstore (~> 3.0)
rails (>= 7.1)
zeitwerk (~> 2.6)

PATH
remote: .
specs:
yes-command-api (1.4.0)
yes-command-api (2.0.0)
message_bus (~> 4.0)
rails (>= 7.1)
yes-core
Expand Down Expand Up @@ -297,9 +297,9 @@ GEM
pg (1.6.3-x86_64-darwin)
pg (1.6.3-x86_64-linux)
pg (1.6.3-x86_64-linux-musl)
pg_eventstore (1.13.4)
connection_pool (~> 2.4)
pg (~> 1.5)
pg_eventstore (3.0.0)
connection_pool (>= 2.5.4, < 4)
pg (~> 1)
sinatra (>= 3, < 5)
pp (0.6.3)
prettyprint
Expand Down Expand Up @@ -548,7 +548,7 @@ CHECKSUMS
pg (1.6.3-x86_64-darwin) sha256=ee2e04a17c0627225054ffeb43e31a95be9d7e93abda2737ea3ce4a62f2729d6
pg (1.6.3-x86_64-linux) sha256=5d9e188c8f7a0295d162b7b88a768d8452a899977d44f3274d1946d67920ae8d
pg (1.6.3-x86_64-linux-musl) sha256=9c9c90d98c72f78eb04c0f55e9618fe55d1512128e411035fe229ff427864009
pg_eventstore (1.13.4) sha256=45ff50db33fc86b1dc72e515e30c33bda0334fc255362a81600c93a6799ee413
pg_eventstore (3.0.0) sha256=7cbed46560952efd36b8f02510d99a55604a3771a4698a697dcdab9930bc08ea
pp (0.6.3) sha256=2951d514450b93ccfeb1df7d021cae0da16e0a7f95ee1e2273719669d0ab9df6
prettyprint (0.2.0) sha256=2bc9e15581a94742064a3cc8b0fb9d45aae3d03a1baa6ef80922627a0766f193
prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
Expand Down Expand Up @@ -588,8 +588,8 @@ CHECKSUMS
useragent (0.16.11) sha256=700e6413ad4bb954bb63547fa098dddf7b0ebe75b40cc6f93b8d54255b173844
websocket-driver (0.8.0) sha256=ed0dba4b943c22f17f9a734817e808bc84cdce6a7e22045f5315aa57676d4962
websocket-extensions (0.1.5) sha256=1c6ba63092cda343eb53fc657110c71c754c56484aad42578495227d717a8241
yes-command-api (1.4.0)
yes-core (1.4.0)
yes-command-api (2.0.0)
yes-core (2.0.0)
zeitwerk (2.7.5) sha256=d8da92128c09ea6ec62c949011b00ed4a20242b255293dd66bf41545398f73dd

BUNDLED WITH
Expand Down
2 changes: 1 addition & 1 deletion yes-command-api/lib/yes/command/api/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Yes
module Command
module Api
VERSION = '1.4.0'
VERSION = '2.0.0'
end
end
end
22 changes: 11 additions & 11 deletions yes-core/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
PATH
remote: ../yes-command-api
specs:
yes-command-api (1.4.0)
yes-command-api (2.0.0)
message_bus (~> 4.0)
rails (>= 7.1)
yes-core

PATH
remote: ../yes-read-api
specs:
yes-read-api (1.4.0)
yes-read-api (2.0.0)
api-pagination (~> 5.0)
pagy (~> 6.0)
rails (>= 7.1)
Expand All @@ -19,7 +19,7 @@ PATH
PATH
remote: .
specs:
yes-core (1.4.0)
yes-core (2.0.0)
cerbos (~> 0.8)
dry-inflector (~> 1.2)
dry-schema (~> 1.13)
Expand All @@ -28,7 +28,7 @@ PATH
has_scope (~> 0.8)
jsonapi-serializer (~> 2.2)
opentelemetry-sdk (~> 1.0)
pg_eventstore (~> 1.0)
pg_eventstore (~> 3.0)
rails (>= 7.1)
zeitwerk (~> 2.6)

Expand Down Expand Up @@ -313,9 +313,9 @@ GEM
pg (1.6.3-x86_64-darwin)
pg (1.6.3-x86_64-linux)
pg (1.6.3-x86_64-linux-musl)
pg_eventstore (1.13.4)
connection_pool (~> 2.4)
pg (~> 1.5)
pg_eventstore (3.0.0)
connection_pool (>= 2.5.4, < 4)
pg (~> 1)
sinatra (>= 3, < 5)
pp (0.6.3)
prettyprint
Expand Down Expand Up @@ -583,7 +583,7 @@ CHECKSUMS
pg (1.6.3-x86_64-darwin) sha256=ee2e04a17c0627225054ffeb43e31a95be9d7e93abda2737ea3ce4a62f2729d6
pg (1.6.3-x86_64-linux) sha256=5d9e188c8f7a0295d162b7b88a768d8452a899977d44f3274d1946d67920ae8d
pg (1.6.3-x86_64-linux-musl) sha256=9c9c90d98c72f78eb04c0f55e9618fe55d1512128e411035fe229ff427864009
pg_eventstore (1.13.4) sha256=45ff50db33fc86b1dc72e515e30c33bda0334fc255362a81600c93a6799ee413
pg_eventstore (3.0.0) sha256=7cbed46560952efd36b8f02510d99a55604a3771a4698a697dcdab9930bc08ea
pp (0.6.3) sha256=2951d514450b93ccfeb1df7d021cae0da16e0a7f95ee1e2273719669d0ab9df6
prettyprint (0.2.0) sha256=2bc9e15581a94742064a3cc8b0fb9d45aae3d03a1baa6ef80922627a0766f193
prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
Expand Down Expand Up @@ -631,9 +631,9 @@ CHECKSUMS
webmock (3.26.2) sha256=774556f2ea6371846cca68c01769b2eac0d134492d21f6d0ab5dd643965a4c90
websocket-driver (0.8.0) sha256=ed0dba4b943c22f17f9a734817e808bc84cdce6a7e22045f5315aa57676d4962
websocket-extensions (0.1.5) sha256=1c6ba63092cda343eb53fc657110c71c754c56484aad42578495227d717a8241
yes-command-api (1.4.0)
yes-core (1.4.0)
yes-read-api (1.4.0)
yes-command-api (2.0.0)
yes-core (2.0.0)
yes-read-api (2.0.0)
zeitwerk (2.7.5) sha256=d8da92128c09ea6ec62c949011b00ed4a20242b255293dd66bf41545398f73dd

RUBY VERSION
Expand Down
8 changes: 6 additions & 2 deletions yes-core/lib/yes/core/command_handling/event_publisher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,14 @@ def verify_external_revisions!

next if normalized_revision == expected_revision

# pg_eventstore 3.0 requires `verdict:`, which selects the error's
# message. This branch is only reached when the revision we hold
# differs from the store's, which is exactly :unmatched_stream_revision.
raise PgEventstore::WrongExpectedRevisionError.new(
revision: aggregate_revision,
expected_revision:,
stream:
stream:,
verdict: :unmatched_stream_revision
)
end
end
Expand Down Expand Up @@ -175,7 +179,7 @@ def otl_record_response(result)
timestamp: result.created_at,
attributes: {
'event.type' => result.type,
'event.link_id' => result.link_id || '',
'event.link_global_position' => result.link_global_position || '',
'global_position' => result.global_position,
'stream' => result.stream.to_json,
'stream.revision' => result.stream_revision,
Expand Down
Loading
Loading