Skip to content

Commit 0745d1e

Browse files
authored
Merge branch 'master' into lloeki/remove-magic-nix-cache
2 parents 7ee7beb + c95b457 commit 0745d1e

File tree

4 files changed

+135
-39
lines changed

4 files changed

+135
-39
lines changed

.github/scripts/generate_table_versions.rb

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/scripts/find_gem_version_bounds.rb renamed to .github/scripts/update_supported_versions.rb

Lines changed: 69 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ class GemfileProcessor
1414
EXCLUDED_INTEGRATIONS = ["configuration", "propagation", "utils"].freeze
1515

1616
def initialize(directory: 'gemfiles/', contrib_dir: 'lib/datadog/tracing/contrib/')
17+
unless Dir.exist?(directory)
18+
warn("Directory #{directory} does not exist")
19+
end
20+
21+
unless Dir.exist?(contrib_dir)
22+
warn("Directory #{contrib_dir} does not exist")
23+
end
1724
@directory = directory
1825
@contrib_dir = contrib_dir
1926
@min_gems = { 'ruby' => {}, 'jruby' => {} }
@@ -25,7 +32,7 @@ def process
2532
parse_gemfiles
2633
process_integrations
2734
include_hardcoded_versions
28-
write_output
35+
write_markdown_output
2936
end
3037

3138
private
@@ -106,18 +113,18 @@ def process_integrations
106113
def include_hardcoded_versions
107114
# `httpx` is maintained externally
108115
@integration_json_mapping['httpx'] = [
109-
'0.11', # Min version Ruby
110-
'infinity', # Max version Ruby
111-
'0.11', # Min version JRuby
112-
'infinity' # Max version JRuby
116+
'[3rd-party support](https://honeyryderchuck.gitlab.io/httpx/)', # Min version Ruby
117+
'[3rd-party support](https://honeyryderchuck.gitlab.io/httpx/)', # Max version Ruby
118+
'[3rd-party support](https://honeyryderchuck.gitlab.io/httpx/)', # Min version JRuby
119+
'[3rd-party support](https://honeyryderchuck.gitlab.io/httpx/)', # Max version JRuby
113120
]
114121

115122
# `makara` is part of `activerecord`
116123
@integration_json_mapping['makara'] = [
117-
'0.3.5', # Min version Ruby
118-
'infinity', # Max version Ruby
119-
'0.3.5', # Min version JRuby
120-
'infinity' # Max version JRuby
124+
'0.5.1', # Min version Ruby
125+
'0.5.1', # Max version Ruby
126+
'0.5.1', # Min version JRuby
127+
'0.5.1' # Max version JRuby
121128
]
122129
end
123130

@@ -131,10 +138,60 @@ def resolve_integration_name(integration)
131138
integration
132139
end
133140

134-
def write_output
135-
@integration_json_mapping = @integration_json_mapping.sort.to_h
136-
File.write("gem_output.json", JSON.pretty_generate(@integration_json_mapping))
141+
def write_markdown_output
142+
output_file = 'docs/integration_versions.md'
143+
comment = <<~COMMENT
144+
<!--
145+
# Please do NOT manually edit this file.
146+
# This file is generated by `bundle exec ruby .github/scripts/update_supported_versions.rb`
147+
148+
### Supported Versions Table ###
149+
150+
This markdown file is generated from the minimum and maximum versions of the integrations we support, as tested in our `gemfile.lock` lockfiles.
151+
For a list of available integrations, and their supported version ranges, refer to the following:
152+
-->
153+
COMMENT
154+
column_widths = {
155+
integration: 24,
156+
ruby_min: 19,
157+
ruby_max: 19,
158+
jruby_min: 19,
159+
jruby_max: 19
160+
}
161+
columns = {
162+
integration: "Integration",
163+
ruby_min: "Ruby Min",
164+
ruby_max: "Ruby Max",
165+
jruby_min: "JRuby Min",
166+
jruby_max: "JRuby Max"
167+
}
168+
169+
adjusted_widths = columns.transform_values.with_index do |title, index|
170+
[title.length, column_widths.values[index]].max
171+
end
172+
173+
header = "| " + columns.map { |key, title| title.ljust(adjusted_widths[key]) }.join(" | ") + " |"
174+
separator = "|-" + adjusted_widths.map { |_, width| "-" * width }.join("-|-") + "-|"
175+
rows = @integration_json_mapping
176+
.sort_by { |name, _versions| name.downcase }
177+
.map do |name, versions|
178+
integration_name = name.ljust(column_widths[:integration])
179+
ruby_min = (versions[0] || "None").ljust(column_widths[:ruby_min])
180+
ruby_max = (versions[1] == 'infinity' ? 'latest' : versions[1] || 'None').ljust(column_widths[:ruby_max])
181+
jruby_min = (versions[2] || "None").ljust(column_widths[:jruby_min])
182+
jruby_max = (versions[3] == 'infinity' ? 'latest' : versions[3] || 'None').ljust(column_widths[:jruby_max])
183+
184+
"| #{integration_name} | #{ruby_min} | #{ruby_max} | #{jruby_min} | #{jruby_max} |"
185+
end
186+
187+
File.open(output_file, 'w') do |file|
188+
file.puts comment
189+
file.puts header
190+
file.puts separator
191+
rows.each { |row| file.puts row }
192+
end
137193
end
138194
end
139195

196+
140197
GemfileProcessor.new.process

.github/workflows/generate-supported-versions.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ jobs:
2424
ruby-version: "3.3"
2525

2626
- name: Update latest
27-
run: bundle exec ruby .github/scripts/find_gem_version_bounds.rb
28-
29-
- name: Generate versions table
30-
run: ruby .github/scripts/generate_table_versions.rb
27+
run: bundle exec ruby .github/scripts/update_supported_versions.rb
3128

3229
- run: git diff
3330

@@ -44,6 +41,10 @@ jobs:
4441
delete-branch: true
4542
body: |
4643
This is a PR to update the table for supported integration versions.
44+
The supported versions markdown is generated from the minimum and maximum tested versions of each integration,
45+
as defined from the `gemfile.lock` gem declarations.
46+
4747
Workflow run: [Generate Supported Versions](https://github.com/DataDog/dd-trace-rb/actions/workflows/generate-supported-versions.yml)
48+
4849
This should be tied to tracer releases, or triggered manually.
4950

docs/integration_versions.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<!--
2+
# Please do NOT manually edit this file.
3+
# This file is generated by `bundle exec ruby .github/scripts/update_supported_versions.rb`
4+
5+
### Supported Versions Table ###
6+
7+
This markdown file is generated from the minimum and maximum versions of the integrations we support, as tested in our `gemfile.lock` lockfiles.
8+
For a list of available integrations, and their supported version ranges, refer to the following:
9+
-->
10+
| Integration | Ruby Min | Ruby Max | JRuby Min | JRuby Max |
11+
|--------------------------|---------------------|---------------------|---------------------|---------------------|
12+
| action_cable | 5.2.8.1 | 7.1.3.4 | 5.2.8.1 | 6.1.7.10 |
13+
| action_mailer | 4.2.11.3 | 7.1.3.4 | 5.2.8.1 | 6.1.7.10 |
14+
| action_pack | 4.2.11.3 | 7.1.3.4 | 5.2.8.1 | 7.0.8 |
15+
| action_view | 4.2.11.3 | 7.1.3.4 | 5.2.8.1 | 7.0.8 |
16+
| active_job | 4.2.11.3 | 7.1.3.4 | 5.2.8.1 | 6.1.7.10 |
17+
| active_model_serializers | 0.10.13 | 0.10.14 | 0.10.13 | 0.10.13 |
18+
| active_record | 4.2.11.3 | 7.2.2.1 | 5.2.8.1 | 6.1.7.10 |
19+
| active_support | 4.2.11.3 | 7.2.2.1 | 5.2.8.1 | 7.0.8 |
20+
| aws | 3.1.0 | 3.2.0 | 3.1.0 | 3.1.0 |
21+
| concurrent_ruby | 1.2.2 | 1.3.5 | 1.1.10 | 1.3.5 |
22+
| dalli | 2.7.11 | 3.2.8 | 2.7.11 | 3.2.3 |
23+
| delayed_job | 4.1.11 | 4.1.13 | 4.1.11 | 4.1.11 |
24+
| elasticsearch | 7.17.11 | 8.17.1 | 7.17.11 | 8.17.1 |
25+
| ethon | 0.16.0 | 0.16.0 | 0.14.0 | 0.16.0 |
26+
| excon | 0.102.0 | 0.110.0 | 0.102.0 | 0.102.0 |
27+
| faraday | 0.17.0 | 2.12.2 | 0.17.0 | 2.12.2 |
28+
| grape | 1.7.0 | 2.1.2 | 1.7.0 | 1.8.0 |
29+
| graphql | 1.13.21 | 2.3.7 | 1.13.21 | 2.3.6 |
30+
| grpc | 1.48.0 | 1.67.0 | None | None |
31+
| hanami | 1.3.5 | 1.3.5 | None | None |
32+
| http | 5.0.1 | 5.2.0 | 4.4.1 | 4.4.1 |
33+
| httpclient | 2.8.3 | 2.8.3 | 2.8.3 | 2.8.3 |
34+
| httprb | 5.0.1 | 5.2.0 | 4.4.1 | 4.4.1 |
35+
| 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/) |
36+
| kafka | 1.5.0 | 1.5.0 | 1.5.0 | 1.5.0 |
37+
| lograge | 0.12.0 | 0.14.0 | 0.12.0 | 0.14.0 |
38+
| makara | 0.5.1 | 0.5.1 | 0.5.1 | 0.5.1 |
39+
| mongo | 2.14.1 | 2.14.1 | 2.14.1 | 2.14.1 |
40+
| mysql2 | 0.5.5 | 0.5.6 | None | None |
41+
| opensearch | 2.1.0 | 3.4.0 | 2.1.0 | 3.4.0 |
42+
| pg | 0.21.0 | 1.5.9 | None | None |
43+
| presto | 0.6.6 | 0.6.6 | 0.6.6 | 0.6.6 |
44+
| que | 1.4.1 | 2.3.0 | 1.4.1 | 2.2.0 |
45+
| racecar | 2.6.0 | 2.11.0 | 2.6.0 | 2.8.2 |
46+
| rack | 1.6.13 | 3.1.8 | 1.6.13 | 3.1.8 |
47+
| rails | 4.2.11.3 | 7.1.3.4 | 5.2.8.1 | 6.1.7.10 |
48+
| rake | 12.3.3 | 13.2.1 | 12.3.3 | 13.2.1 |
49+
| redis | 3.3.5 | 5.2.0 | 3.3.5 | 5.0.6 |
50+
| resque | 2.4.0 | 2.6.0 | 2.4.0 | 2.5.0 |
51+
| rest_client | 2.1.0 | 2.1.0 | 2.1.0 | 2.1.0 |
52+
| roda | 3.65.0 | 3.81.0 | 3.64.0 | 3.72.0 |
53+
| semantic_logger | 4.12.0 | 4.15.0 | 4.12.0 | 4.14.0 |
54+
| sequel | 5.83.1 | 5.86.0 | 5.83.1 | 5.83.1 |
55+
| shoryuken | 6.0.0 | 6.2.1 | 6.0.0 | 6.0.0 |
56+
| sidekiq | 5.2.8 | 7.2.4 | 6.5.8 | 7.1.0 |
57+
| sinatra | 2.0.8.1 | 4.0.0 | 2.2.4 | 4.0.0 |
58+
| sneakers | 2.12.0 | 2.12.0 | 2.12.0 | 2.12.0 |
59+
| stripe | 5.15.0 | 13.3.1 | 5.15.0 | 13.3.1 |
60+
| sucker_punch | 3.1.0 | 3.2.0 | 3.1.0 | 3.1.0 |
61+
| trilogy | 2.6.0 | 2.9.0 | None | None |

0 commit comments

Comments
 (0)