diff --git a/.github/scripts/find_gem_version_bounds.rb b/.github/scripts/find_gem_version_bounds.rb index da1366d737a..6663c957182 100644 --- a/.github/scripts/find_gem_version_bounds.rb +++ b/.github/scripts/find_gem_version_bounds.rb @@ -9,7 +9,7 @@ class GemfileProcessor SPECIAL_CASES = { - "opensearch" => "OpenSearch" # special case because opensearch = OpenSearch not Opensearch + "opensearch" => "OpenSearch", # special case because opensearch = OpenSearch not Opensearch }.freeze EXCLUDED_INTEGRATIONS = ["configuration", "propagation", "utils"].freeze @@ -37,32 +37,13 @@ def parse_gemfiles(directory = 'gemfiles/') runtime = File.basename(gemfile_name).split('_').first # ruby or jruby next unless %w[ruby jruby].include?(runtime) # parse the gemfile - if gemfile_name.end_with?(".gemfile") - process_gemfile(gemfile_name, runtime) - elsif gemfile_name.end_with?('.gemfile.lock') + if gemfile_name.end_with?('.gemfile.lock') process_lockfile(gemfile_name, runtime) end end end - def process_gemfile(gemfile_name, runtime) - begin - definition = Bundler::Definition.build(gemfile_name, nil, nil) - definition.dependencies.each do |dependency| - gem_name = dependency.name - version = dependency.requirement.to_s - unspecified = version.strip == '' || version == ">= 0" - if unspecified - puts "#{gem_name} uses latest" - end - update_gem_versions(runtime, gem_name, version, unspecified) - end - rescue Bundler::GemfileError => e - puts "Error reading Gemfile: #{e.message}" - end - end - def process_lockfile(gemfile_name, runtime) lockfile_contents = File.read(gemfile_name) parser = Bundler::LockfileParser.new(lockfile_contents) @@ -86,7 +67,6 @@ def update_gem_versions(runtime, gem_name, version, unspecified) # Update maximum gems if unspecified - puts "Setting gem #{gem_name} to infinity" @max_gems[runtime][gem_name] = Float::INFINITY else if @max_gems[runtime][gem_name].nil? || (@max_gems[runtime][gem_name] != Float::INFINITY && gem_version > Gem::Version.new(@max_gems[runtime][gem_name])) @@ -102,6 +82,7 @@ def version_valid?(version, unspecified) Gem::Version.new(version) true rescue ArgumentError + puts "#{version} is invalid format." false end @@ -125,18 +106,18 @@ def process_integrations def include_hardcoded_versions # `httpx` is maintained externally @integration_json_mapping['httpx'] = [ - '0.11', # Min version Ruby - nil, # Max version Ruby - '0.11', # Min version JRuby - nil # Max version JRuby + '0.11', # Min version Ruby + 'infinity', # Max version Ruby + '0.11', # Min version JRuby + 'infinity' # Max version JRuby ] # `makara` is part of `activerecord` @integration_json_mapping['makara'] = [ - '0.3.5', # Min version Ruby - nil, # Max version Ruby - '0.3.5', # Min version JRuby - nil # Max version JRuby + '0.3.5', # Min version Ruby + 'infinity', # Max version Ruby + '0.3.5', # Min version JRuby + 'infinity' # Max version JRuby ] end @@ -152,9 +133,6 @@ def resolve_integration_name(integration) def write_output @integration_json_mapping = @integration_json_mapping.sort.to_h - @integration_json_mapping.each do |integration, versions| - versions.map! { |v| v == Float::INFINITY ? 'infinity' : v } - end File.write("gem_output.json", JSON.pretty_generate(@integration_json_mapping)) end end diff --git a/.github/scripts/generate_table_versions.rb b/.github/scripts/generate_table_versions.rb index 46068adeb0e..958e54a53a8 100644 --- a/.github/scripts/generate_table_versions.rb +++ b/.github/scripts/generate_table_versions.rb @@ -10,11 +10,7 @@ separator = "|-------------|----------|-----------|----------|----------|\n" rows = data.map do |integration_name, versions| ruby_min, ruby_max, jruby_min, jruby_max = versions.map do |v| - if v == "infinity" - "latest" - else v || "None" - end end "| #{integration_name} | #{ruby_min} | #{ruby_max} | #{jruby_min} | #{jruby_max} |" end diff --git a/lib/datadog/tracing/contrib/aws/integration.rb b/lib/datadog/tracing/contrib/aws/integration.rb index 167ea1be49a..233c67d5ab9 100644 --- a/lib/datadog/tracing/contrib/aws/integration.rb +++ b/lib/datadog/tracing/contrib/aws/integration.rb @@ -17,7 +17,7 @@ class Integration # @public_api Changing the integration name or integration options can cause breaking changes register_as :aws, auto_patch: true def self.gem_name - 'aws-sdk-core' + 'aws-sdk' end def self.version diff --git a/lib/datadog/tracing/contrib/http/integration.rb b/lib/datadog/tracing/contrib/http/integration.rb index f2cacaf94b3..b8482a13df5 100644 --- a/lib/datadog/tracing/contrib/http/integration.rb +++ b/lib/datadog/tracing/contrib/http/integration.rb @@ -22,6 +22,9 @@ class Integration # @public_api Changing the integration name or integration options can cause breaking changes register_as :http, auto_patch: true + def self.gem_name + 'net-http' + end def self.version Gem::Version.new(RUBY_VERSION)