From 218dcb36c14f967224ce3f07c7eefba5155ee20f Mon Sep 17 00:00:00 2001 From: Arek Swidrak Date: Tue, 28 Jul 2026 11:05:36 +0200 Subject: [PATCH] feat!: require pg_eventstore v3 (2.0.0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit yes-core moves to pg_eventstore ~> 3.0, whose schema is incompatible with v1, so this is a major bump for all four gems. 2.0.0 rather than 1.5.0 is deliberate. Consumers (company_manager, application_management_system) declare these gems at `~> 1.3` from the git source, and main is already at 1.4.0 -- so 1.5.0 would satisfy the existing constraint and could be pulled in by an unrelated `bundle update`, putting v3 code against the still-v1 shared eventstore. 2.0.0 makes that structurally impossible; adoption now requires an explicit Gemfile edit, which is what we want it to require. The v3 code change itself is two OTel span attributes. pg_eventstore migration 13 drops events.link_id in favour of the bigint link_global_position, so Event#link_id raises NoMethodError: * Commands::Stateless::Handler * CommandHandling::EventPublisher This mirrors yousty-eventsourcing 16.0.0, which made the identical change in its projections builder and command handler. Dashboards or trace queries keyed on `event.link_id` need updating to `event.link_global_position`. yes-auth pinned `yes-core ~> 1.0`, which would have made the monorepo unresolvable the moment yes-core went to 2.0.0 -- bumped to ~> 2.0. Verified by resolving the full set: pg_eventstore 3.0.0, all four gems at 2.0.0, no conflicts. NOT verified locally: rubocop and rspec both need Ruby 3.4.5 per the Gemfile and this machine has 3.4.1. CI runs both on 3.4.5 with Postgres 16 + Redis, and its "Set up EventStore DB" step will exercise pg_eventstore 3.0's migrations for the first time -- watch that step in particular. ⚠️ Do NOT merge/adopt until the shared eventstore is migrated to v3. Refs B2BY-4684 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01XsyuaXrAmXd8cnSVoWVvsN --- CHANGELOG.md | 27 ++++++++++++++++++ Gemfile.lock | 28 +++++++++---------- lib/yes/version.rb | 2 +- yes-auth/lib/yes/auth/version.rb | 2 +- yes-auth/yes-auth.gemspec | 2 +- .../lib/yes/command/api/version.rb | 2 +- .../core/command_handling/event_publisher.rb | 2 +- .../yes/core/commands/stateless/handler.rb | 2 +- yes-core/lib/yes/core/version.rb | 2 +- .../core/commands/stateless/handler_spec.rb | 2 +- yes-core/yes-core.gemspec | 2 +- yes-read-api/lib/yes/read/api/version.rb | 2 +- 12 files changed, 51 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84d4387e..8c6c367c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,33 @@ 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 the shared eventstore is migrated to v3.** See B2BY-4684. + +### 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 diff --git a/Gemfile.lock b/Gemfile.lock index 18c85dab..7d416d9e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,14 +1,14 @@ 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 @@ -16,7 +16,7 @@ PATH 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) @@ -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) @@ -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 @@ -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 @@ -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 diff --git a/lib/yes/version.rb b/lib/yes/version.rb index c6d63678..694ce29a 100644 --- a/lib/yes/version.rb +++ b/lib/yes/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Yes - VERSION = '1.4.0' + VERSION = '2.0.0' end diff --git a/yes-auth/lib/yes/auth/version.rb b/yes-auth/lib/yes/auth/version.rb index ab886de8..2ac1b9f9 100644 --- a/yes-auth/lib/yes/auth/version.rb +++ b/yes-auth/lib/yes/auth/version.rb @@ -2,6 +2,6 @@ module Yes module Auth - VERSION = '1.4.0' + VERSION = '2.0.0' end end diff --git a/yes-auth/yes-auth.gemspec b/yes-auth/yes-auth.gemspec index 87f0aea1..26bc10cf 100644 --- a/yes-auth/yes-auth.gemspec +++ b/yes-auth/yes-auth.gemspec @@ -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 diff --git a/yes-command-api/lib/yes/command/api/version.rb b/yes-command-api/lib/yes/command/api/version.rb index 79a88f2c..5c219da0 100644 --- a/yes-command-api/lib/yes/command/api/version.rb +++ b/yes-command-api/lib/yes/command/api/version.rb @@ -3,7 +3,7 @@ module Yes module Command module Api - VERSION = '1.4.0' + VERSION = '2.0.0' end end end diff --git a/yes-core/lib/yes/core/command_handling/event_publisher.rb b/yes-core/lib/yes/core/command_handling/event_publisher.rb index 11db9b4d..eaa55af3 100644 --- a/yes-core/lib/yes/core/command_handling/event_publisher.rb +++ b/yes-core/lib/yes/core/command_handling/event_publisher.rb @@ -175,7 +175,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, diff --git a/yes-core/lib/yes/core/commands/stateless/handler.rb b/yes-core/lib/yes/core/commands/stateless/handler.rb index e5ea8812..4c522180 100644 --- a/yes-core/lib/yes/core/commands/stateless/handler.rb +++ b/yes-core/lib/yes/core/commands/stateless/handler.rb @@ -277,7 +277,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, diff --git a/yes-core/lib/yes/core/version.rb b/yes-core/lib/yes/core/version.rb index 9f443af0..238d5349 100644 --- a/yes-core/lib/yes/core/version.rb +++ b/yes-core/lib/yes/core/version.rb @@ -2,6 +2,6 @@ module Yes module Core - VERSION = '1.4.0' + VERSION = '2.0.0' end end diff --git a/yes-core/spec/lib/yes/core/commands/stateless/handler_spec.rb b/yes-core/spec/lib/yes/core/commands/stateless/handler_spec.rb index a45d5dcf..8d5c6e3e 100644 --- a/yes-core/spec/lib/yes/core/commands/stateless/handler_spec.rb +++ b/yes-core/spec/lib/yes/core/commands/stateless/handler_spec.rb @@ -214,7 +214,7 @@ expect(published_event.attributes).to eq( 'event.type' => event.type, - 'event.link_id' => '', + 'event.link_global_position' => '', 'global_position' => event.global_position, 'stream' => event.stream.to_json, 'stream.revision' => event.stream_revision, diff --git a/yes-core/yes-core.gemspec b/yes-core/yes-core.gemspec index 824a3504..c62c7fc6 100644 --- a/yes-core/yes-core.gemspec +++ b/yes-core/yes-core.gemspec @@ -30,7 +30,7 @@ Gem::Specification.new do |spec| spec.add_dependency 'has_scope', '~> 0.8' spec.add_dependency 'jsonapi-serializer', '~> 2.2' spec.add_dependency 'opentelemetry-sdk', '~> 1.0' - spec.add_dependency 'pg_eventstore', '~> 1.0' + spec.add_dependency 'pg_eventstore', '~> 3.0' spec.add_dependency 'rails', '>= 7.1' spec.add_dependency 'zeitwerk', '~> 2.6' end diff --git a/yes-read-api/lib/yes/read/api/version.rb b/yes-read-api/lib/yes/read/api/version.rb index fa3b126e..258ab49c 100644 --- a/yes-read-api/lib/yes/read/api/version.rb +++ b/yes-read-api/lib/yes/read/api/version.rb @@ -3,7 +3,7 @@ module Yes module Read module Api - VERSION = '1.4.0' + VERSION = '2.0.0' end end end