From 8d0980af9f87b180c3dca92a145671699bd05e67 Mon Sep 17 00:00:00 2001 From: Andrey Marchenko Date: Mon, 21 Aug 2023 17:06:14 +0200 Subject: [PATCH] remove safe navigation operator before migration, add jruby 9.4, remove jruby 9.3 --- .circleci/config.yml | 22 +++++++++--------- .standard_todo.yml | 8 +++++++ docker-compose.yml | 23 ------------------- .../ci/contrib/cucumber/integration.rb | 3 ++- .../ci/contrib/minitest/integration.rb | 2 +- lib/datadog/ci/contrib/rspec/integration.rb | 3 ++- lib/datadog/ci/ext/environment.rb | 2 +- 7 files changed, 25 insertions(+), 38 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index af5cee05..bf8a0552 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -376,10 +376,10 @@ job_configuration: <<: *config-3_2 resource_class_to_use: small # ADD NEW RUBIES HERE - - &config-jruby-9_3 + - &config-jruby-9_4 <<: *filters_all_branches_and_tags - ruby_version: 'jruby-9.3.9.0' - image: ghcr.io/datadog/dd-trace-rb/jruby:9.3.9.0-dd + ruby_version: 'jruby-9.4.0.0' + image: ghcr.io/datadog/dd-trace-rb/jruby:9.4.0.0-dd resource_class_to_use: medium+ workflows: @@ -401,7 +401,7 @@ workflows: # - test-3.2 # - test-3.3 # # ADD NEW RUBIES HERE - # - test-jruby-9.3 + # - test-jruby-9.4 # - orb/changelog: # <<: *config-3_2-small # name: changelog @@ -454,13 +454,13 @@ workflows: - build-3.3 # ADD NEW RUBIES HERE - orb/build: - <<: *config-jruby-9_3 - name: build-jruby-9.3 + <<: *config-jruby-9_4 + name: build-jruby-9.4 - orb/test: - <<: *config-jruby-9_3 - name: test-jruby-9.3 + <<: *config-jruby-9_4 + name: test-jruby-9.4 requires: - - build-jruby-9.3 + - build-jruby-9.4 # Release jobs # - "deploy prerelease Gem": # <<: *filters_all_branches_and_tags @@ -472,7 +472,7 @@ workflows: # - test-3.2 # - test-3.3 # # ADD NEW RUBIES HERE - # - test-jruby-9.3 + # - test-jruby-9.4 # - "deploy release": # <<: *filters_only_release_tags # requires: @@ -483,4 +483,4 @@ workflows: # - test-3.2 # - test-3.3 # # ADD NEW RUBIES HERE - # - test-jruby-9.3 + # - test-jruby-9.4 diff --git a/.standard_todo.yml b/.standard_todo.yml index c7882a3c..6c3441cc 100644 --- a/.standard_todo.yml +++ b/.standard_todo.yml @@ -2,6 +2,14 @@ # Remove from this list as you refactor files. --- ignore: +- lib/datadog/ci/contrib/minitest/integration.rb: + - Style/SafeNavigation +- lib/datadog/ci/contrib/cucumber/integration.rb: + - Style/SafeNavigation +- lib/datadog/ci/contrib/rspec/integration.rb: + - Style/SafeNavigation +- lib/datadog/ci/ext/environment.rb: + - Style/SafeNavigation - spec/support/log_helpers.rb: - Performance/UnfreezeString - Appraisals: diff --git a/docker-compose.yml b/docker-compose.yml index 43ae85e1..6dbfc649 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -84,21 +84,6 @@ services: - bundle-3.3:/usr/local/bundle - "ddagent_var_run:${TEST_DDAGENT_VAR_RUN}" # ADD NEW RUBIES HERE - datadog-ci-jruby-9.3: - image: ghcr.io/datadog/dd-trace-rb/jruby:9.3.9.0-dd - command: /bin/bash - depends_on: - - ddagent - env_file: ./.env - environment: - <<: *common-environment - BUNDLE_GEMFILE: /app/Gemfile-jruby-9.3 - stdin_open: true - tty: true - volumes: - - .:/app - - bundle-jruby-9.3:/usr/local/bundle - - "ddagent_var_run:${TEST_DDAGENT_VAR_RUN}" datadog-ci-jruby-9.4: image: ghcr.io/datadog/dd-trace-rb/jruby:9.4.0.0-dd command: /bin/bash @@ -131,20 +116,12 @@ services: volumes: - ddagent_var_run:/var/run/datadog volumes: - bundle-2.1: - bundle-2.2: - bundle-2.3: - bundle-2.4: - bundle-2.5: - bundle-2.6: bundle-2.7: bundle-3.0: bundle-3.1: bundle-3.2: bundle-3.3: # ADD NEW RUBIES HERE - bundle-jruby-9.2: - bundle-jruby-9.3: bundle-jruby-9.4: ddagent_var_run: # Temporary folder used while compiling the profiling native extension. We place this in a volume to avoid the diff --git a/lib/datadog/ci/contrib/cucumber/integration.rb b/lib/datadog/ci/contrib/cucumber/integration.rb index 153fd030..2e9c4b2d 100644 --- a/lib/datadog/ci/contrib/cucumber/integration.rb +++ b/lib/datadog/ci/contrib/cucumber/integration.rb @@ -14,7 +14,8 @@ class Integration register_as :cucumber, auto_patch: true def self.version - Gem.loaded_specs["cucumber"]&.version + Gem.loaded_specs["cucumber"] \ + && Gem.loaded_specs["cucumber"].version end def self.loaded? diff --git a/lib/datadog/ci/contrib/minitest/integration.rb b/lib/datadog/ci/contrib/minitest/integration.rb index 125425e7..4be1ae1c 100644 --- a/lib/datadog/ci/contrib/minitest/integration.rb +++ b/lib/datadog/ci/contrib/minitest/integration.rb @@ -14,7 +14,7 @@ class Integration register_as :minitest, auto_patch: true def self.version - Gem.loaded_specs["minitest"]&.version + Gem.loaded_specs["minitest"] && Gem.loaded_specs["minitest"].version end def self.loaded? diff --git a/lib/datadog/ci/contrib/rspec/integration.rb b/lib/datadog/ci/contrib/rspec/integration.rb index cc50db04..5ce19878 100644 --- a/lib/datadog/ci/contrib/rspec/integration.rb +++ b/lib/datadog/ci/contrib/rspec/integration.rb @@ -16,7 +16,8 @@ class Integration register_as :rspec, auto_patch: true def self.version - Gem.loaded_specs["rspec-core"]&.version + Gem.loaded_specs["rspec-core"] \ + && Gem.loaded_specs["rspec-core"].version end def self.loaded? diff --git a/lib/datadog/ci/ext/environment.rb b/lib/datadog/ci/ext/environment.rb index 2235221a..e64c5a57 100644 --- a/lib/datadog/ci/ext/environment.rb +++ b/lib/datadog/ci/ext/environment.rb @@ -86,7 +86,7 @@ def normalize_ref(name) end def filter_sensitive_info(url) - url&.gsub(%r{(https?://)[^/]*@}, '\1') + url.gsub(%r{(https?://)[^/]*@}, '\1') unless url.nil? end # CI providers