Skip to content

Commit 8554760

Browse files
authored
Merge pull request #4924 from DataDog/sarahchen6/add-ruby-3.5
Add Ruby 3.5 preview support
2 parents 805912d + 491912a commit 8554760

File tree

142 files changed

+16002
-173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+16002
-173
lines changed

.github/workflows/lock-dependency.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ jobs:
3636
matrix:
3737
engine:
3838
# ADD NEW RUBIES HERE
39+
- name: ruby
40+
version: '3.5'
3941
- name: ruby
4042
version: '3.4'
4143
- name: ruby

.github/workflows/test-macos.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
- '3.2'
2828
- '3.3'
2929
- '3.4'
30+
- '3.5'
3031
# ADD NEW RUBIES HERE
3132
name: Test (${{ matrix.os }}, ${{ matrix.ruby }})
3233
runs-on: ${{ matrix.os }}

.github/workflows/test-yjit.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
- '3.2'
2323
- '3.3'
2424
- '3.4'
25+
- '3.5'
2526
# ADD NEW RUBIES HERE
2627
rubyopt:
2728
- '--yjit'

.github/workflows/test.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ concurrency:
2323
cancel-in-progress: "${{ github.ref != 'refs/heads/master' }}"
2424

2525
jobs:
26+
# ADD NEW RUBIES HERE
27+
ruby-35:
28+
name: "Ruby 3.5"
29+
uses: ./.github/workflows/_unit_test.yml
30+
with:
31+
engine: ruby
32+
version: "3.5"
33+
alias: ruby-35
34+
2635
ruby-34:
2736
name: "Ruby 3.4"
2837
uses: ./.github/workflows/_unit_test.yml
@@ -127,6 +136,8 @@ jobs:
127136
DD_SERVICE: dd-trace-rb
128137
DD_GIT_REPOSITORY_URL: "${{ github.repositoryUrl }}"
129138
needs:
139+
# ADD NEW RUBIES HERE
140+
- ruby-35
130141
- ruby-34
131142
- ruby-33
132143
- ruby-32
@@ -171,6 +182,8 @@ jobs:
171182
name: dd/coverage
172183
runs-on: ubuntu-24.04
173184
needs:
185+
# ADD NEW RUBIES HERE
186+
- ruby-35
174187
- ruby-34
175188
- ruby-33
176189
- ruby-32
@@ -208,6 +221,8 @@ jobs:
208221
name: Unit Tests (complete)
209222
runs-on: ubuntu-24.04
210223
needs:
224+
# ADD NEW RUBIES HERE
225+
- ruby-35
211226
- ruby-34
212227
- ruby-33
213228
- ruby-32

.github/workflows/update-latest-dependency.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
matrix:
2323
engine:
2424
# ADD NEW RUBIES HERE
25+
- name: ruby
26+
version: '3.5'
2527
- name: ruby
2628
version: '3.4'
2729
- name: ruby

.gitlab-ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ default:
3535
parallel:
3636
matrix:
3737
# ADD NEW RUBIES HERE
38-
- RUBY_VERSION: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6"]
38+
- RUBY_VERSION: ["3.5", "3.4", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6"]
3939
script:
4040
- >
4141
docker build
@@ -71,7 +71,7 @@ promote-image:
7171
parallel:
7272
matrix:
7373
# ADD NEW RUBIES HERE
74-
- RUBY_VERSION: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6"]
74+
- RUBY_VERSION: ["3.5", "3.4", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6"]
7575
ARCHITECTURE: ["amd64", "arm64"]
7676
script:
7777
- docker pull $RUBY_CUSTOM_IMAGE_BASE/$RUBY_VERSION-$ARCHITECTURE:$CI_PIPELINE_ID
@@ -109,6 +109,8 @@ install-dependencies:
109109
tags: ["arch:$ARCH"]
110110
parallel:
111111
matrix:
112+
# ADD NEW RUBIES HERE
113+
# TODO: Ruby 3.5 - Not added here yet to avoid increasing SSI OCI image size and adding premature support for 3.5.
112114
- RUBY_VERSION: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6"]
113115
ARCH: ["amd64", "arm64"]
114116
stage: package

.gitlab/Dockerfile-3.5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM ghcr.io/datadog/images-rb/engines/ruby:3.5-centos-gcc

Matrixfile

Lines changed: 175 additions & 166 deletions
Large diffs are not rendered by default.

appraisal/ruby-3.5.rb

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
appraise 'rails7' do
2+
gem 'rails', '~> 7.0.0'
3+
end
4+
5+
appraise 'rails71' do
6+
gem 'rails', '~> 7.1.0'
7+
end
8+
9+
appraise 'rails8-mysql2' do
10+
gem 'rails', '~> 8.0.0'
11+
gem 'mysql2', '~> 0.5', platform: :ruby
12+
gem 'lograge', '~> 0.11'
13+
gem 'net-smtp'
14+
end
15+
16+
appraise 'rails8-postgres' do
17+
gem 'rails', '~> 8.0.0'
18+
gem 'pg', '>= 1.1', platform: :ruby
19+
gem 'lograge', '~> 0.11'
20+
gem 'net-smtp'
21+
end
22+
23+
appraise 'rails8-postgres-redis' do
24+
gem 'rails', '~> 8.0.0'
25+
gem 'pg', '>= 1.1', platform: :ruby
26+
gem 'redis', '~> 4'
27+
gem 'lograge', '~> 0.11'
28+
gem 'net-smtp'
29+
end
30+
31+
appraise 'rails8-postgres-sidekiq' do
32+
gem 'rails', '~> 8.0.0'
33+
gem 'pg', '>= 1.1', platform: :ruby
34+
gem 'sidekiq', '~> 8'
35+
gem 'lograge', '~> 0.11'
36+
gem 'rails_semantic_logger', '~> 4.0'
37+
gem 'net-smtp'
38+
end
39+
40+
appraise 'rails8-semantic-logger' do
41+
gem 'rails', '~> 8.0.0'
42+
gem 'pg', '>= 1.1', platform: :ruby
43+
gem 'rails_semantic_logger', '~> 4.0'
44+
gem 'net-smtp'
45+
end
46+
47+
appraise 'rails8-trilogy' do
48+
gem 'rails', '~> 8.0.0'
49+
gem 'trilogy'
50+
gem 'sprockets', '< 4'
51+
gem 'lograge', '~> 0.11'
52+
gem 'net-smtp'
53+
end
54+
55+
appraise 'rails-old-redis' do
56+
# All dependencies except Redis < 4 are not important, they are just required to run Rails tests.
57+
gem 'redis', '< 4'
58+
gem 'rails', '~> 6.1.0'
59+
gem 'pg', '>= 1.1', platform: :ruby
60+
gem 'sprockets', '< 4'
61+
gem 'lograge', '~> 0.11'
62+
end
63+
64+
appraise 'resque2-redis3' do
65+
gem 'redis', '< 4.0'
66+
gem 'resque', '>= 2.0'
67+
end
68+
69+
appraise 'resque2-redis4' do
70+
gem 'redis', '>= 4.0'
71+
gem 'resque', '>= 2.0'
72+
end
73+
74+
appraise 'aws' do
75+
gem 'aws-sdk'
76+
gem 'shoryuken'
77+
gem 'ostruct'
78+
end
79+
80+
appraise 'http' do
81+
gem 'ethon'
82+
gem 'http'
83+
gem 'httpclient'
84+
gem 'typhoeus'
85+
end
86+
87+
build_coverage_matrix('stripe', 7..12, min: '5.15.0')
88+
build_coverage_matrix('opensearch', [2], gem: 'opensearch-ruby')
89+
build_coverage_matrix('elasticsearch', [7])
90+
build_coverage_matrix('faraday')
91+
build_coverage_matrix('excon')
92+
build_coverage_matrix('rest-client')
93+
build_coverage_matrix('mongo', min: '2.20.0')
94+
build_coverage_matrix('dalli', [2])
95+
build_coverage_matrix('karafka', min: '2.3.0')
96+
build_coverage_matrix('devise', min: '3.2.1')
97+
98+
appraise 'relational_db' do
99+
# ActiveRecord locked because tests are failing with 7.1, which was attempted as a part of Ruby 3.4 testing in CI.
100+
# All existing relational_db configurations use ActiveRecord 7.0. ActiveRecord 7.1 is tested as a part of rails71
101+
# appraisal configurations. The latest version of sqlite3 (i.e. 2+) requires ActiveRecord 7.1, so sqlite3 version
102+
# has been locked as well.
103+
#
104+
# TODO: Repair the failures with ActiveRecord 7.1 in this configuration and remove the locked version.
105+
# TODO: After ActiveRecord is upgraded to 7.1+, sqlite3 can be unlocked as well.
106+
gem 'activerecord', '~> 7.0.0'
107+
gem 'delayed_job'
108+
gem 'delayed_job_active_record'
109+
gem 'makara', '>= 0.6.0.pre' # Ruby 3 requires >= 0.6.0, which is currently in pre-release: https://rubygems.org/gems/makara/versions
110+
gem 'mysql2', '>= 0.5.3', platform: :ruby
111+
gem 'pg', platform: :ruby
112+
gem 'sqlite3', '~> 1.4', platform: :ruby
113+
gem 'sequel'
114+
gem 'trilogy'
115+
end
116+
117+
appraise 'activesupport' do
118+
gem 'activesupport', '~> 7'
119+
gem 'actionpack'
120+
gem 'actionview'
121+
gem 'active_model_serializers', '>= 0.10.0'
122+
gem 'grape'
123+
gem 'lograge'
124+
gem 'racecar', '>= 0.3.5'
125+
gem 'ruby-kafka', '>= 0.7.10'
126+
end
127+
128+
appraise 'contrib' do
129+
gem 'concurrent-ruby'
130+
gem 'rack-test' # Dev dependencies for testing rack-based code
131+
gem 'rake', '>= 12.3'
132+
gem 'resque'
133+
gem 'roda', '>= 2.0.0'
134+
gem 'semantic_logger', '~> 4.0'
135+
# Note: Sidekiq 8 uses different timestamp formatting compared to prior versions. As long as
136+
# versions <8 are supported, make sure there's some CI running both older and newer versions.
137+
gem 'sidekiq', '~> 8'
138+
gem 'sneakers', '>= 2.12.0'
139+
gem 'sucker_punch'
140+
gem 'que', '>= 1.0.0'
141+
142+
# When Rack 3+ is used, we need rackup.
143+
gem 'rackup'
144+
end
145+
146+
[
147+
'2.3',
148+
'2.2',
149+
'2.1',
150+
'2.0',
151+
'1.13',
152+
].each do |v|
153+
appraise "graphql-#{v}" do
154+
gem 'rails', '~> 6.1.0'
155+
gem 'graphql', "~> #{v}.0"
156+
gem 'sprockets', '< 4'
157+
gem 'lograge', '~> 0.11'
158+
gem 'mutex_m', '>= 0.1.0'
159+
end
160+
end
161+
162+
build_coverage_matrix('redis', [3, 4])
163+
build_coverage_matrix('rack', [2], meta: { 'rack-contrib' => nil, 'rack-test' => nil })
164+
165+
[2, 3, 4].each do |n|
166+
appraise "sinatra-#{n}" do
167+
gem 'sinatra', "~> #{n}"
168+
gem 'sinatra-contrib', "~> #{n}"
169+
gem 'rack-contrib'
170+
gem 'rack-test' # Dev dependencies for testing rack-based code
171+
end
172+
end
173+
174+
appraise 'opentelemetry' do
175+
gem 'opentelemetry-sdk', '~> 1.1'
176+
end
177+
178+
appraise 'opentelemetry_otlp' do
179+
gem 'opentelemetry-api', '< 1.5' # Context is kept in `Thread.current#[]`
180+
gem 'opentelemetry-sdk', '~> 1.1'
181+
gem 'opentelemetry-exporter-otlp'
182+
end
183+
184+
appraise 'opentelemetry_otlp_1_5' do
185+
gem 'opentelemetry-api', '>= 1.5' # Context is kept as instance variable in `Fiber.current`
186+
gem 'opentelemetry-sdk', '~> 1.1'
187+
gem 'opentelemetry-exporter-otlp'
188+
end
189+
190+
appraise 'contrib-old' do
191+
gem 'presto-client', '>= 0.5.14' # Renamed to trino-client in >= 1.0
192+
end
193+
194+
appraise 'core-old' do
195+
gem 'dogstatsd-ruby', '~> 4'
196+
end

docker-compose.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,23 @@ services:
159159
- extension-build-tmp:/app/tmp
160160
- bundle-3.4:/usr/local/bundle
161161
- "ddagent_var_run:${TEST_DDAGENT_VAR_RUN}"
162+
tracer-3.5:
163+
image: ghcr.io/datadog/images-rb/engines/ruby:3.5-gnu-gcc
164+
working_dir: /app
165+
command: /bin/bash
166+
depends_on: *common-depends-on
167+
links: *common-links
168+
env_file: ./.env
169+
environment:
170+
<<: *common-environment
171+
BUNDLE_GEMFILE: /app/ruby-3.5.gemfile
172+
stdin_open: true
173+
tty: true
174+
volumes:
175+
- .:/app
176+
- extension-build-tmp:/app/tmp
177+
- bundle-3.5:/usr/local/bundle
178+
- "ddagent_var_run:${TEST_DDAGENT_VAR_RUN}"
162179
# ADD NEW RUBIES HERE
163180
tracer-jruby-9.2:
164181
image: ghcr.io/datadog/images-rb/engines/jruby:9.2-gnu-gcc
@@ -327,6 +344,7 @@ volumes:
327344
bundle-3.2:
328345
bundle-3.3:
329346
bundle-3.4:
347+
bundle-3.5:
330348
# ADD NEW RUBIES HERE
331349
bundle-jruby-9.2:
332350
bundle-jruby-9.3:

0 commit comments

Comments
 (0)