Skip to content

Commit

Permalink
Merge branch 'master' into lloeki/remove-magic-nix-cache
Browse files Browse the repository at this point in the history
  • Loading branch information
marcotc authored Feb 3, 2025
2 parents 7ee7beb + c95b457 commit 0745d1e
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 39 deletions.
23 changes: 0 additions & 23 deletions .github/scripts/generate_table_versions.rb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ class GemfileProcessor
EXCLUDED_INTEGRATIONS = ["configuration", "propagation", "utils"].freeze

def initialize(directory: 'gemfiles/', contrib_dir: 'lib/datadog/tracing/contrib/')
unless Dir.exist?(directory)
warn("Directory #{directory} does not exist")
end

unless Dir.exist?(contrib_dir)
warn("Directory #{contrib_dir} does not exist")
end
@directory = directory
@contrib_dir = contrib_dir
@min_gems = { 'ruby' => {}, 'jruby' => {} }
Expand All @@ -25,7 +32,7 @@ def process
parse_gemfiles
process_integrations
include_hardcoded_versions
write_output
write_markdown_output
end

private
Expand Down Expand Up @@ -106,18 +113,18 @@ def process_integrations
def include_hardcoded_versions
# `httpx` is maintained externally
@integration_json_mapping['httpx'] = [
'0.11', # Min version Ruby
'infinity', # Max version Ruby
'0.11', # Min version JRuby
'infinity' # Max version JRuby
'[3rd-party support](https://honeyryderchuck.gitlab.io/httpx/)', # Min version Ruby
'[3rd-party support](https://honeyryderchuck.gitlab.io/httpx/)', # Max version Ruby
'[3rd-party support](https://honeyryderchuck.gitlab.io/httpx/)', # Min version JRuby
'[3rd-party support](https://honeyryderchuck.gitlab.io/httpx/)', # Max version JRuby
]

# `makara` is part of `activerecord`
@integration_json_mapping['makara'] = [
'0.3.5', # Min version Ruby
'infinity', # Max version Ruby
'0.3.5', # Min version JRuby
'infinity' # Max version JRuby
'0.5.1', # Min version Ruby
'0.5.1', # Max version Ruby
'0.5.1', # Min version JRuby
'0.5.1' # Max version JRuby
]
end

Expand All @@ -131,10 +138,60 @@ def resolve_integration_name(integration)
integration
end

def write_output
@integration_json_mapping = @integration_json_mapping.sort.to_h
File.write("gem_output.json", JSON.pretty_generate(@integration_json_mapping))
def write_markdown_output
output_file = 'docs/integration_versions.md'
comment = <<~COMMENT
<!--
# Please do NOT manually edit this file.
# This file is generated by `bundle exec ruby .github/scripts/update_supported_versions.rb`
### Supported Versions Table ###
This markdown file is generated from the minimum and maximum versions of the integrations we support, as tested in our `gemfile.lock` lockfiles.
For a list of available integrations, and their supported version ranges, refer to the following:
-->
COMMENT
column_widths = {
integration: 24,
ruby_min: 19,
ruby_max: 19,
jruby_min: 19,
jruby_max: 19
}
columns = {
integration: "Integration",
ruby_min: "Ruby Min",
ruby_max: "Ruby Max",
jruby_min: "JRuby Min",
jruby_max: "JRuby Max"
}

adjusted_widths = columns.transform_values.with_index do |title, index|
[title.length, column_widths.values[index]].max
end

header = "| " + columns.map { |key, title| title.ljust(adjusted_widths[key]) }.join(" | ") + " |"
separator = "|-" + adjusted_widths.map { |_, width| "-" * width }.join("-|-") + "-|"
rows = @integration_json_mapping
.sort_by { |name, _versions| name.downcase }
.map do |name, versions|
integration_name = name.ljust(column_widths[:integration])
ruby_min = (versions[0] || "None").ljust(column_widths[:ruby_min])
ruby_max = (versions[1] == 'infinity' ? 'latest' : versions[1] || 'None').ljust(column_widths[:ruby_max])
jruby_min = (versions[2] || "None").ljust(column_widths[:jruby_min])
jruby_max = (versions[3] == 'infinity' ? 'latest' : versions[3] || 'None').ljust(column_widths[:jruby_max])

"| #{integration_name} | #{ruby_min} | #{ruby_max} | #{jruby_min} | #{jruby_max} |"
end

File.open(output_file, 'w') do |file|
file.puts comment
file.puts header
file.puts separator
rows.each { |row| file.puts row }
end
end
end


GemfileProcessor.new.process
9 changes: 5 additions & 4 deletions .github/workflows/generate-supported-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ jobs:
ruby-version: "3.3"

- name: Update latest
run: bundle exec ruby .github/scripts/find_gem_version_bounds.rb

- name: Generate versions table
run: ruby .github/scripts/generate_table_versions.rb
run: bundle exec ruby .github/scripts/update_supported_versions.rb

- run: git diff

Expand All @@ -44,6 +41,10 @@ jobs:
delete-branch: true
body: |
This is a PR to update the table for supported integration versions.
The supported versions markdown is generated from the minimum and maximum tested versions of each integration,
as defined from the `gemfile.lock` gem declarations.
Workflow run: [Generate Supported Versions](https://github.com/DataDog/dd-trace-rb/actions/workflows/generate-supported-versions.yml)
This should be tied to tracer releases, or triggered manually.
61 changes: 61 additions & 0 deletions docs/integration_versions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<!--
# Please do NOT manually edit this file.
# This file is generated by `bundle exec ruby .github/scripts/update_supported_versions.rb`
### Supported Versions Table ###
This markdown file is generated from the minimum and maximum versions of the integrations we support, as tested in our `gemfile.lock` lockfiles.
For a list of available integrations, and their supported version ranges, refer to the following:
-->
| Integration | Ruby Min | Ruby Max | JRuby Min | JRuby Max |
|--------------------------|---------------------|---------------------|---------------------|---------------------|
| action_cable | 5.2.8.1 | 7.1.3.4 | 5.2.8.1 | 6.1.7.10 |
| action_mailer | 4.2.11.3 | 7.1.3.4 | 5.2.8.1 | 6.1.7.10 |
| action_pack | 4.2.11.3 | 7.1.3.4 | 5.2.8.1 | 7.0.8 |
| action_view | 4.2.11.3 | 7.1.3.4 | 5.2.8.1 | 7.0.8 |
| active_job | 4.2.11.3 | 7.1.3.4 | 5.2.8.1 | 6.1.7.10 |
| active_model_serializers | 0.10.13 | 0.10.14 | 0.10.13 | 0.10.13 |
| active_record | 4.2.11.3 | 7.2.2.1 | 5.2.8.1 | 6.1.7.10 |
| active_support | 4.2.11.3 | 7.2.2.1 | 5.2.8.1 | 7.0.8 |
| aws | 3.1.0 | 3.2.0 | 3.1.0 | 3.1.0 |
| concurrent_ruby | 1.2.2 | 1.3.5 | 1.1.10 | 1.3.5 |
| dalli | 2.7.11 | 3.2.8 | 2.7.11 | 3.2.3 |
| delayed_job | 4.1.11 | 4.1.13 | 4.1.11 | 4.1.11 |
| elasticsearch | 7.17.11 | 8.17.1 | 7.17.11 | 8.17.1 |
| ethon | 0.16.0 | 0.16.0 | 0.14.0 | 0.16.0 |
| excon | 0.102.0 | 0.110.0 | 0.102.0 | 0.102.0 |
| faraday | 0.17.0 | 2.12.2 | 0.17.0 | 2.12.2 |
| grape | 1.7.0 | 2.1.2 | 1.7.0 | 1.8.0 |
| graphql | 1.13.21 | 2.3.7 | 1.13.21 | 2.3.6 |
| grpc | 1.48.0 | 1.67.0 | None | None |
| hanami | 1.3.5 | 1.3.5 | None | None |
| http | 5.0.1 | 5.2.0 | 4.4.1 | 4.4.1 |
| httpclient | 2.8.3 | 2.8.3 | 2.8.3 | 2.8.3 |
| httprb | 5.0.1 | 5.2.0 | 4.4.1 | 4.4.1 |
| httpx | [3rd-party support](https://honeyryderchuck.gitlab.io/httpx/) | [3rd-party support](https://honeyryderchuck.gitlab.io/httpx/) | [3rd-party support](https://honeyryderchuck.gitlab.io/httpx/) | [3rd-party support](https://honeyryderchuck.gitlab.io/httpx/) |
| kafka | 1.5.0 | 1.5.0 | 1.5.0 | 1.5.0 |
| lograge | 0.12.0 | 0.14.0 | 0.12.0 | 0.14.0 |
| makara | 0.5.1 | 0.5.1 | 0.5.1 | 0.5.1 |
| mongo | 2.14.1 | 2.14.1 | 2.14.1 | 2.14.1 |
| mysql2 | 0.5.5 | 0.5.6 | None | None |
| opensearch | 2.1.0 | 3.4.0 | 2.1.0 | 3.4.0 |
| pg | 0.21.0 | 1.5.9 | None | None |
| presto | 0.6.6 | 0.6.6 | 0.6.6 | 0.6.6 |
| que | 1.4.1 | 2.3.0 | 1.4.1 | 2.2.0 |
| racecar | 2.6.0 | 2.11.0 | 2.6.0 | 2.8.2 |
| rack | 1.6.13 | 3.1.8 | 1.6.13 | 3.1.8 |
| rails | 4.2.11.3 | 7.1.3.4 | 5.2.8.1 | 6.1.7.10 |
| rake | 12.3.3 | 13.2.1 | 12.3.3 | 13.2.1 |
| redis | 3.3.5 | 5.2.0 | 3.3.5 | 5.0.6 |
| resque | 2.4.0 | 2.6.0 | 2.4.0 | 2.5.0 |
| rest_client | 2.1.0 | 2.1.0 | 2.1.0 | 2.1.0 |
| roda | 3.65.0 | 3.81.0 | 3.64.0 | 3.72.0 |
| semantic_logger | 4.12.0 | 4.15.0 | 4.12.0 | 4.14.0 |
| sequel | 5.83.1 | 5.86.0 | 5.83.1 | 5.83.1 |
| shoryuken | 6.0.0 | 6.2.1 | 6.0.0 | 6.0.0 |
| sidekiq | 5.2.8 | 7.2.4 | 6.5.8 | 7.1.0 |
| sinatra | 2.0.8.1 | 4.0.0 | 2.2.4 | 4.0.0 |
| sneakers | 2.12.0 | 2.12.0 | 2.12.0 | 2.12.0 |
| stripe | 5.15.0 | 13.3.1 | 5.15.0 | 13.3.1 |
| sucker_punch | 3.1.0 | 3.2.0 | 3.1.0 | 3.1.0 |
| trilogy | 2.6.0 | 2.9.0 | None | None |

0 comments on commit 0745d1e

Please sign in to comment.