From a17c309cd831345011bcf0c05f60d2c56ff5ef91 Mon Sep 17 00:00:00 2001 From: Joseph Sak Date: Thu, 22 Jan 2026 18:45:50 -0700 Subject: [PATCH 1/6] Pin Ruby 4.0.1 and align CI with .ruby-version Use .ruby-version as the single source of truth for typecheck and release jobs, and add a CI job that runs the suite on the pinned patch version. --- .github/workflows/cd.yml | 4 ++-- .github/workflows/ci.yml | 18 +++++++++++++++++- .ruby-version | 2 +- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 07a80fb..87285c1 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -43,7 +43,7 @@ - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.4" + ruby-version-file: .ruby-version - uses: oxidize-rb/actions/cross-gem@v1 id: cross-gem @@ -88,7 +88,7 @@ - uses: oxidize-rb/actions/setup-ruby-and-rust@v1 with: - ruby-version: "3.4" + ruby-version-file: .ruby-version bundler-cache: true cargo-cache: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad553f9..376d949 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,6 +40,22 @@ jobs: run: bundle exec rake - name: Compile rust ext run: bundle exec rake compile:release + + rspec_ruby_version_file: + name: "RSpec (ruby-version-file)" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: oxidize-rb/actions/setup-ruby-and-rust@v1 + with: + ruby-version-file: .ruby-version + rustup-toolchain: stable + bundler-cache: true + cargo-cache: false + - name: Run ruby tests + run: bundle exec rake + - name: Compile rust ext + run: bundle exec rake compile:release static_type_check: name: "Type Check" runs-on: ubuntu-latest @@ -49,7 +65,7 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: true - ruby-version: 3.3 + ruby-version-file: .ruby-version - name: Run static type checks run: bundle exec srb tc notify_on_failure: diff --git a/.ruby-version b/.ruby-version index 4f5e697..1454f6e 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.4.5 +4.0.1 From b2070b856d66943dce988ba780c2e39a68679a75 Mon Sep 17 00:00:00 2001 From: Joseph Sak Date: Thu, 22 Jan 2026 18:46:01 -0700 Subject: [PATCH 2/6] Build versioned native extension paths for Ruby 3.2-4.0 Install the compiled extension into lib/code_ownership// so cross-gem can package multiple Ruby minors into a single platform gem without overwriting. --- .gitignore | 3 +++ code_ownership.gemspec | 2 +- ext/code_ownership/extconf.rb | 3 ++- rakelib/compile.rake | 3 ++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 93bf3b3..642de3d 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,9 @@ /target/ /vendor +# Locally-built native extensions (installed into versioned directories) +/lib/code_ownership/*/ + Gemfile.lock # rspec failure tracking diff --git a/code_ownership.gemspec b/code_ownership.gemspec index 282940c..b78e30d 100644 --- a/code_ownership.gemspec +++ b/code_ownership.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |spec| 'public gem pushes.' end - spec.required_ruby_version = '>= 3.2' + spec.required_ruby_version = Gem::Requirement.new('>= 3.2', '< 5') # https://guides.rubygems.org/make-your-own-gem/#adding-an-executable # and diff --git a/ext/code_ownership/extconf.rb b/ext/code_ownership/extconf.rb index 60ca23a..d15d818 100644 --- a/ext/code_ownership/extconf.rb +++ b/ext/code_ownership/extconf.rb @@ -3,7 +3,8 @@ require 'mkmf' require 'rb_sys/mkmf' -create_rust_makefile('code_ownership/code_ownership') do |ext| +ruby_minor = RUBY_VERSION[/\d+\.\d+/] +create_rust_makefile("code_ownership/#{ruby_minor}/code_ownership") do |ext| ext.extra_cargo_args += ['--crate-type', 'cdylib'] ext.extra_cargo_args += ['--package', 'code_ownership'] end diff --git a/rakelib/compile.rake b/rakelib/compile.rake index e8a3e11..ee9efa9 100644 --- a/rakelib/compile.rake +++ b/rakelib/compile.rake @@ -1,5 +1,6 @@ require 'rb_sys/extensiontask' RbSys::ExtensionTask.new('code_ownership', GEMSPEC) do |ext| - ext.lib_dir = 'lib/code_ownership' + ruby_minor = RUBY_VERSION[/\d+\.\d+/] + ext.lib_dir = "lib/code_ownership/#{ruby_minor}" end From 3c5f0884180f01e4657c6de2861296004428221e Mon Sep 17 00:00:00 2001 From: Joseph Sak Date: Thu, 22 Jan 2026 18:46:07 -0700 Subject: [PATCH 3/6] Ignore build artifacts in RuboCop and Sorbet Exclude tmp/ and target/ from static analysis to avoid scanning vendored/compiled build outputs. --- .rubocop.yml | 2 ++ sorbet/config | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.rubocop.yml b/.rubocop.yml index 6f345ad..4a24fc7 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -12,6 +12,8 @@ AllCops: NewCops: enable Exclude: - vendor/bundle/**/** + - tmp/**/** + - target/**/** TargetRubyVersion: 3.2 Metrics/ParameterLists: diff --git a/sorbet/config b/sorbet/config index 26caf17..f5e49d9 100644 --- a/sorbet/config +++ b/sorbet/config @@ -1,3 +1,5 @@ --dir=. --ignore=/spec +--ignore=/tmp +--ignore=/target --ignore=/vendor/bundle From 9b59170cc1c88f1056ebba7c0aa5a8ffbea4625c Mon Sep 17 00:00:00 2001 From: Joseph Sak Date: Thu, 22 Jan 2026 18:52:12 -0700 Subject: [PATCH 4/6] Narrow gitignore for versioned native extension dirs Only ignore lib/code_ownership// so new Ruby source files under lib/code_ownership/* aren't accidentally hidden. --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 642de3d..8cafb89 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,9 @@ /vendor # Locally-built native extensions (installed into versioned directories) -/lib/code_ownership/*/ +# Keep this narrowly scoped so we don't accidentally ignore real Ruby source dirs +# like lib/code_ownership/private/. +/lib/code_ownership/[0-9]*.[0-9]*/ Gemfile.lock From 6905dfde64606a1b8cf99dab70e67572eca0fc11 Mon Sep 17 00:00:00 2001 From: Joseph Sak Date: Thu, 22 Jan 2026 18:57:58 -0700 Subject: [PATCH 5/6] Cap required_ruby_version at Ruby 4.0 This gem ships native binaries through Ruby 4.0, so restrict installs to < 4.1.dev until we add 4.1 builds and CI coverage. --- code_ownership.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code_ownership.gemspec b/code_ownership.gemspec index b78e30d..8b27e9d 100644 --- a/code_ownership.gemspec +++ b/code_ownership.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |spec| 'public gem pushes.' end - spec.required_ruby_version = Gem::Requirement.new('>= 3.2', '< 5') + spec.required_ruby_version = Gem::Requirement.new('>= 3.2', '< 4.1.dev') # https://guides.rubygems.org/make-your-own-gem/#adding-an-executable # and From 6860d8e6b8e3c12e0cf57ad543fe8ca1dfd0ca7c Mon Sep 17 00:00:00 2001 From: Joseph Sak Date: Thu, 22 Jan 2026 19:01:57 -0700 Subject: [PATCH 6/6] Bump 2.1.1 --- lib/code_ownership/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/code_ownership/version.rb b/lib/code_ownership/version.rb index 1b99d6e..4b66e08 100644 --- a/lib/code_ownership/version.rb +++ b/lib/code_ownership/version.rb @@ -2,5 +2,5 @@ # frozen_string_literal: true module CodeOwnership - VERSION = '2.1.0' + VERSION = '2.1.1' end