Skip to content

Commit

Permalink
drop support for Ruby older than 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Aug 18, 2023
1 parent e20826b commit ccdd0c4
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 237 deletions.
96 changes: 0 additions & 96 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -347,36 +347,6 @@ orbs:

job_configuration:
# MRI
- &config-2_1
<<: *filters_all_branches_and_tags
ruby_version: 'ruby-2.1.10'
image: ghcr.io/datadog/dd-trace-rb/ruby:2.1.10-dd
resource_class_to_use: medium+
- &config-2_2
<<: *filters_all_branches_and_tags
ruby_version: 'ruby-2.2.10'
image: ghcr.io/datadog/dd-trace-rb/ruby:2.2.10-dd
resource_class_to_use: medium+
- &config-2_3
<<: *filters_all_branches_and_tags
ruby_version: 'ruby-2.3.8'
image: ghcr.io/datadog/dd-trace-rb/ruby:2.3.8-dd
resource_class_to_use: medium+
- &config-2_4
<<: *filters_all_branches_and_tags
ruby_version: 'ruby-2.4.10'
image: ghcr.io/datadog/dd-trace-rb/ruby:2.4.10-dd
resource_class_to_use: medium+
- &config-2_5
<<: *filters_all_branches_and_tags
ruby_version: 'ruby-2.5.9'
image: ghcr.io/datadog/dd-trace-rb/ruby:2.5.9-dd
resource_class_to_use: medium+
- &config-2_6
<<: *filters_all_branches_and_tags
ruby_version: 'ruby-2.6.10'
image: ghcr.io/datadog/dd-trace-rb/ruby:2.6.10-dd
resource_class_to_use: medium+
- &config-2_7
<<: *filters_all_branches_and_tags
ruby_version: 'ruby-2.7.6'
Expand Down Expand Up @@ -425,12 +395,6 @@ workflows:
# <<: *config-3_2-small
# name: coverage
# requires:
# - test-2.1
# - test-2.2
# - test-2.3
# - test-2.4
# - test-2.5
# - test-2.6
# - test-2.7
# - test-3.0
# - test-3.1
Expand All @@ -448,54 +412,6 @@ workflows:
# only: /bump_to_version_.*/
#
# ADD NEW RUBIES HERE
- orb/build:
<<: *config-2_1
name: build-2.1
- orb/test:
<<: *config-2_1
name: test-2.1
requires:
- build-2.1
- orb/build:
<<: *config-2_2
name: build-2.2
- orb/test:
<<: *config-2_2
name: test-2.2
requires:
- build-2.2
- orb/build:
<<: *config-2_3
name: build-2.3
- orb/test:
<<: *config-2_3
name: test-2.3
requires:
- build-2.3
- orb/build:
<<: *config-2_4
name: build-2.4
- orb/test:
<<: *config-2_4
name: test-2.4
requires:
- build-2.4
- orb/build:
<<: *config-2_5
name: build-2.5
- orb/test:
<<: *config-2_5
name: test-2.5
requires:
- build-2.5
- orb/build:
<<: *config-2_6
name: build-2.6
- orb/test:
<<: *config-2_6
name: test-2.6
requires:
- build-2.6
- orb/build:
<<: *config-2_7
name: build-2.7
Expand Down Expand Up @@ -550,12 +466,6 @@ workflows:
# <<: *filters_all_branches_and_tags
# requires:
# - lint
# - test-2.1
# - test-2.2
# - test-2.3
# - test-2.4
# - test-2.5
# - test-2.6
# - test-2.7
# - test-3.0
# - test-3.1
Expand All @@ -567,12 +477,6 @@ workflows:
# <<: *filters_only_release_tags
# requires:
# - lint
# - test-2.1
# - test-2.2
# - test-2.3
# - test-2.4
# - test-2.5
# - test-2.6
# - test-2.7
# - test-3.0
# - test-3.1
Expand Down
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ task :ci do
declare "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ jruby" => "bundle exec appraisal cucumber-5 rake spec:cucumber"
declare "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ jruby" => "bundle exec appraisal cucumber-6 rake spec:cucumber"
declare "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ jruby" => "bundle exec appraisal cucumber-7 rake spec:cucumber"
# declare "❌ 2.1 / ❌ 2.2 / ❌ 2.3 / ❌ 2.4 / ❌ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ jruby" => "bundle exec appraisal cucumber-8 rake spec:cucumber"
# declare "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ jruby" => "bundle exec appraisal cucumber-8 rake spec:cucumber"

# Minitest
declare "❌ 2.1 / ❌ 2.2 / ❌ 2.3 / ❌ 2.4 / ❌ 2.5 / ❌ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ jruby" => "bundle exec appraisal minitest-5 rake spec:minitest"
declare "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ jruby" => "bundle exec appraisal minitest-5 rake spec:minitest"
end
102 changes: 3 additions & 99 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,115 +1,19 @@
version: '3.2'
services:
# MRI
datadog-ci-2.1:
image: ghcr.io/datadog/dd-trace-rb/ruby:2.1.10-dd
datadog-ci-2.7:
image: ghcr.io/datadog/dd-trace-rb/ruby:2.7.6-dd
command: /bin/bash
depends_on:
- ddagent
env_file: ./.env
environment: &common-environment
BUNDLE_GEMFILE: /app/Gemfile-2.1
BUNDLE_GEMFILE: /app/Gemfile-2.7
DD_AGENT_HOST: ddagent
TEST_DATADOG_INTEGRATION: 1
DDTRACE_CI: true
stdin_open: true
tty: true
volumes:
- .:/app
- extension-build-tmp:/app/tmp
- bundle-2.1:/usr/local/bundle
- "ddagent_var_run:${TEST_DDAGENT_VAR_RUN}"
datadog-ci-2.2:
image: ghcr.io/datadog/dd-trace-rb/ruby:2.2.10-dd
command: /bin/bash
depends_on:
- ddagent
env_file: ./.env
environment:
<<: *common-environment
BUNDLE_GEMFILE: /app/Gemfile-2.2
stdin_open: true
tty: true
volumes:
- .:/app
- extension-build-tmp:/app/tmp
- bundle-2.2:/usr/local/bundle
- "ddagent_var_run:${TEST_DDAGENT_VAR_RUN}"
datadog-ci-2.3:
image: ghcr.io/datadog/dd-trace-rb/ruby:2.3.8-dd
command: /bin/bash
depends_on:
- ddagent
env_file: ./.env
environment:
<<: *common-environment
BUNDLE_GEMFILE: /app/Gemfile-2.3
stdin_open: true
tty: true
volumes:
- .:/app
- extension-build-tmp:/app/tmp
- bundle-2.3:/usr/local/bundle
- "ddagent_var_run:${TEST_DDAGENT_VAR_RUN}"
datadog-ci-2.4:
image: ghcr.io/datadog/dd-trace-rb/ruby:2.4.10-dd
command: /bin/bash
depends_on:
- ddagent
env_file: ./.env
environment:
<<: *common-environment
BUNDLE_GEMFILE: /app/Gemfile-2.4
stdin_open: true
tty: true
volumes:
- .:/app
- extension-build-tmp:/app/tmp
- bundle-2.4:/usr/local/bundle
- "ddagent_var_run:${TEST_DDAGENT_VAR_RUN}"
datadog-ci-2.5:
image: ghcr.io/datadog/dd-trace-rb/ruby:2.5.9-dd
command: /bin/bash
depends_on:
- ddagent
env_file: ./.env
environment:
<<: *common-environment
BUNDLE_GEMFILE: /app/Gemfile-2.5
stdin_open: true
tty: true
volumes:
- .:/app
- extension-build-tmp:/app/tmp
- bundle-2.5:/usr/local/bundle
- "ddagent_var_run:${TEST_DDAGENT_VAR_RUN}"
datadog-ci-2.6:
image: ghcr.io/datadog/dd-trace-rb/ruby:2.6.10-dd
command: /bin/bash
depends_on:
- ddagent
env_file: ./.env
environment:
<<: *common-environment
BUNDLE_GEMFILE: /app/Gemfile-2.6
stdin_open: true
tty: true
volumes:
- .:/app
- extension-build-tmp:/app/tmp
- bundle-2.6:/usr/local/bundle
- "ddagent_var_run:${TEST_DDAGENT_VAR_RUN}"
datadog-ci-2.7:
image: ghcr.io/datadog/dd-trace-rb/ruby:2.7.6-dd
command: /bin/bash
depends_on:
- ddagent
env_file: ./.env
environment:
<<: *common-environment
BUNDLE_GEMFILE: /app/Gemfile-2.7
stdin_open: true
tty: true
volumes:
- .:/app
- extension-build-tmp:/app/tmp
Expand Down
3 changes: 1 addition & 2 deletions lib/datadog/ci/contrib/cucumber/integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ class Integration
register_as :cucumber, auto_patch: true

def self.version
Gem.loaded_specs["cucumber"] \
&& Gem.loaded_specs["cucumber"].version
Gem.loaded_specs["cucumber"]&.version
end

def self.loaded?
Expand Down
2 changes: 1 addition & 1 deletion lib/datadog/ci/contrib/minitest/integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Integration
register_as :minitest, auto_patch: true

def self.version
Gem.loaded_specs["minitest"] && Gem.loaded_specs["minitest"].version
Gem.loaded_specs["minitest"]&.version
end

def self.loaded?
Expand Down
3 changes: 1 addition & 2 deletions lib/datadog/ci/contrib/rspec/integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ class Integration
register_as :rspec, auto_patch: true

def self.version
Gem.loaded_specs["rspec-core"] \
&& Gem.loaded_specs["rspec-core"].version
Gem.loaded_specs["rspec-core"]&.version
end

def self.loaded?
Expand Down
6 changes: 3 additions & 3 deletions lib/datadog/ci/ext/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def normalize_ref(name)
end

def filter_sensitive_info(url)
url.gsub(%r{(https?://)[^/]*@}, '\1') unless url.nil?
url&.gsub(%r{(https?://)[^/]*@}, '\1')
end

# CI providers
Expand Down Expand Up @@ -175,7 +175,7 @@ def extract_bitbucket(env)
Core::Git::Ext::TAG_REPOSITORY_URL => env["BITBUCKET_GIT_SSH_ORIGIN"],
Core::Git::Ext::TAG_TAG => env["BITBUCKET_TAG"],
TAG_JOB_URL => url,
TAG_PIPELINE_ID => env["BITBUCKET_PIPELINE_UUID"] && env["BITBUCKET_PIPELINE_UUID"].tr("{}", ""),
TAG_PIPELINE_ID => env["BITBUCKET_PIPELINE_UUID"]&.tr("{}", ""),
TAG_PIPELINE_NAME => env["BITBUCKET_REPO_FULL_NAME"],
TAG_PIPELINE_NUMBER => env["BITBUCKET_BUILD_NUMBER"],
TAG_PIPELINE_URL => url,
Expand Down Expand Up @@ -554,7 +554,7 @@ def extract_local_git

def branch_or_tag(branch_or_tag)
branch = tag = nil
if branch_or_tag && branch_or_tag.include?("tags/")
if branch_or_tag&.include?("tags/")
tag = branch_or_tag
else
branch = branch_or_tag
Expand Down
35 changes: 3 additions & 32 deletions tasks/appraisal.rake
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace :appraisal do # rubocop:disable Metrics/BlockLength
def ruby_versions(versions)
return TRACER_VERSIONS if versions.empty?
return RUBY_VERSIONS if versions.empty?

TRACER_VERSIONS & versions
RUBY_VERSIONS & versions
end

def bundler_version(ruby_version)
Expand Down Expand Up @@ -43,12 +43,6 @@ namespace :appraisal do # rubocop:disable Metrics/BlockLength

def lockfile_prefix(ruby_version)
ruby_version = {
"2.1" => "2.1.10",
"2.2" => "2.2.10",
"2.3" => "2.3.8",
"2.4" => "2.4.10",
"2.5" => "2.5.9",
"2.6" => "2.6.10",
"2.7" => "2.7.6",
"3.0" => "3.0.4",
"3.1" => "3.1.2",
Expand Down Expand Up @@ -150,13 +144,7 @@ namespace :appraisal do # rubocop:disable Metrics/BlockLength
end
end

TRACER_VERSIONS = [
"2.1",
"2.2",
"2.3",
"2.4",
"2.5",
"2.6",
RUBY_VERSIONS = [
"2.7",
"3.0",
"3.1",
Expand All @@ -167,25 +155,8 @@ TRACER_VERSIONS = [
].freeze

FORCE_BUNDLER_VERSION = {
# Some groups require bundler 1.x https://github.com/DataDog/dd-trace-rb/issues/2444
"2.3" => "1.17.3",

# 2.4.x seems to cause problems with appraisal
"2.6" => "2.3.26",
"2.7" => "2.3.26",
"3.0" => "2.3.26",
"3.1" => "2.3.26",
"3.2" => "2.3.26"
}.freeze

# TODO: remove with 2.0
task :install_appraisal_gemfiles do
warn "This task has been removed, please use rake appraisal:install instead"
exit 1
end

# TODO: remove with 2.0
task :update_appraisal_gemfiles do
warn "This task has been removed, please use rake appraisal:update instead"
exit 1
end

0 comments on commit ccdd0c4

Please sign in to comment.