Skip to content

Commit b04975d

Browse files
authored
[PROF-11524] Bump minimum Ruby version for libdatadog ruby gem + fix Ruby testing github action (#1080)
# What does this PR do? This PR fixes the [Ruby gem scaffolding testing](https://github.com/DataDog/libdatadog/actions/workflows/test-ruby.yml) GitHub Action that was broken by #1067. Specifically, #1067 introduced a new required dependency for running our scaffolding (but not the Ruby gem itself -- it's only for development) that only worked on modern Rubies. Thus, older Rubies [started failing in CI with](https://github.com/DataDog/libdatadog/actions/runs/15305108278/job/43055672220): ``` Could not find compatible versions Because rubygems-await >= 0.3.0 depends on RubyGems >= 3.2 and rubygems-await < 0.3.0 depends on RubyGems >= 3.4, RubyGems >= 3.2 is required. So, because current RubyGems version is = 3.1.6, version solving has failed. ``` This PR fixes that issue by making that dependency optional on older Rubies... ...and while I was in the neighbourhood, I then: 1. Dropped support for Ruby < 2.5 from our library. See individual commit messages for more details on why this is OK 2. Dropped testing for Ruby < 2.5 from CI, and added a few more Ruby versions that came out since I first added this testing # Motivation Fix broken CI. # Additional Notes [The GHA action](https://github.com/DataDog/libdatadog/actions/workflows/test-ruby.yml) was previously also broken because of "Startup failure"s, that I fixed by going into the repository settings and making sure the required dependencies for this action are in the allowed list. # How to test the change? [This run of the action shows the new Ruby versions + everything green](https://github.com/DataDog/libdatadog/actions/runs/15305667598).
2 parents ddfec9e + 2f920da commit b04975d

File tree

3 files changed

+5
-26
lines changed

3 files changed

+5
-26
lines changed

.github/workflows/test-ruby.yml

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,11 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
os: [ubuntu-latest]
13-
ruby: [2.1, 2.3, 2.4, 2.5, 2.6, 2.7, '3.0', 3.1, head]
13+
ruby: ['2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3', '3.4', head]
1414
runs-on: ${{ matrix.os }}
1515
steps:
1616
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
17-
- uses: ruby/setup-ruby@922ebc4c5262cd14e07bb0e1db020984b6c064fe # 1.226.0
18-
with:
19-
ruby-version: ${{ matrix.ruby }}
20-
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
21-
working-directory: ruby/
22-
- run: cd ruby && bundle exec rake
23-
# Workaround for broken issue
24-
# ```
25-
# ERROR: While executing gem ... (RuntimeError)
26-
# Marshal.load reentered at marshal_load
27-
# ```
28-
# suggested in https://github.com/ruby/setup-ruby/issues/496 (use ubuntu 20.04 instead of a later version)
29-
test-legacy-workaround:
30-
strategy:
31-
fail-fast: false
32-
matrix:
33-
os: [ubuntu-20.04]
34-
ruby: [2.2]
35-
runs-on: ${{ matrix.os }}
36-
steps:
37-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
38-
- uses: ruby/setup-ruby@922ebc4c5262cd14e07bb0e1db020984b6c064fe # 1.226.0
17+
- uses: ruby/setup-ruby@13e7a03dc3ac6c3798f4570bfead2aed4d96abfb # 1.244.0
3918
with:
4019
ruby-version: ${{ matrix.ruby }}
4120
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

ruby/gems.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
gem "rake", ">= 12.0", "< 14"
88
gem "rspec", "~> 3.10"
99
gem "standard", "~> 1.7", ">= 1.7.2" unless RUBY_VERSION < "2.6"
10-
gem "http", "~> 5.0" unless RUBY_VERSION < "2.5"
10+
gem "http", "~> 5.0"
1111
gem "pry"
1212
gem "pry-byebug" unless RUBY_VERSION > "3.1"
13-
gem "rubygems-await"
13+
gem "rubygems-await" unless RUBY_VERSION < "3.1"

ruby/libdatadog.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
1515
"libdatadog is a Rust-based utility library for Datadog's ddtrace gem."
1616
spec.homepage = "https://docs.datadoghq.com/tracing/"
1717
spec.license = "Apache-2.0"
18-
spec.required_ruby_version = ">= 2.1.0"
18+
spec.required_ruby_version = ">= 2.5.0"
1919

2020
spec.metadata["allowed_push_host"] = "https://rubygems.org"
2121

0 commit comments

Comments
 (0)