From ec51b2093065c76cf3465f26efd10e58edc07f91 Mon Sep 17 00:00:00 2001 From: Dustin Byrne Date: Wed, 7 Oct 2026 16:19:06 -0400 Subject: [PATCH] ci: test latest Rails on stable Ruby --- .github/workflows/unit-tests.yml | 23 +++++++++++++++++++++++ CONTRIBUTING.md | 2 ++ Gemfile | 6 ++++-- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index f4f2a32..9867d99 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -39,6 +39,29 @@ jobs: - name: Run RSpec tests run: bundle exec rspec + latest-rails: + name: RSpec (latest Rails / stable Ruby) + runs-on: ubuntu-latest + env: + BUNDLE_GEMFILE: gemfiles/otel.gemfile + RAILS_VERSION: '>= 5.2' + RAILS_ENV: test + GH_ACTIONS_UNIT_TESTS: 1 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Use stable Ruby + uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0 + with: + ruby-version: ruby + bundler: 4.0.13 + - name: Resolve latest Rails and dependencies + run: bundle update --all + - name: Report resolved versions and require logs dependencies + run: | + bundle exec ruby -rrails -rjson -ropentelemetry-sdk -ropentelemetry-logs-sdk -ropentelemetry/exporter/otlp_logs -e 'puts "Ruby #{RUBY_VERSION}, Rails #{Rails.version}, JSON #{JSON::VERSION}"' + - name: Run RSpec tests + run: bundle exec rspec + logs-integration: name: Logs integration (Ruby ${{ matrix.ruby-version }}) runs-on: ubuntu-latest diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 527eb61..1d7956c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -49,6 +49,8 @@ BUNDLE_GEMFILE=gemfiles/otel.gemfile bundle exec rspec Without that bundle, those two integration tests are reported as pending. CI runs both bundles. +CI also runs the full suite with real OpenTelemetry dependencies on stable Ruby and the latest stable Rails eligible under the repository's 7-day RubyGems cooldown. This job sets `RAILS_VERSION='>= 5.2'` and runs `bundle update --all` so the committed lockfile does not keep Rails on an older version. The existing Ruby matrix continues to use the committed lockfiles. + The public API snapshot covers both `posthog-ruby` and `posthog-rails`. If you intentionally change either API, update the snapshot and review the diff: ```bash diff --git a/Gemfile b/Gemfile index 03d8ba4..30ec8d4 100644 --- a/Gemfile +++ b/Gemfile @@ -11,13 +11,15 @@ gemspec gem 'concurrent-ruby', require: 'concurrent' gem 'irb' +rails_version = ENV.fetch('RAILS_VERSION', '~> 7.1') + group :development, :test do - gem 'activesupport', '~> 7.1' + gem 'activesupport', rails_version gem 'commander', '~> 5.0' gem 'mcp', '>= 1.4' gem 'oj', '~> 3.17.7' gem 'prettier' - gem 'railties', '~> 7.1' + gem 'railties', rails_version gem 'rake', '~> 13.4.2' gem 'rspec', '~> 3.13' gem 'rubocop', '~> 1.91.0'