Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
55 changes: 53 additions & 2 deletions .github/scripts/update_supported_versions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,17 @@ def initialize(directory: GEMFILES_DIR, contrib_dir: CONTRIB_DIR)
warn("Directory #{contrib_dir} does not exist")
end
@directory = directory
<<<<<<< HEAD
@min_gems = { 'ruby' => {} }
@max_gems = { 'ruby' => {} }
@gem_sources = { 'ruby' => {} }
@supported_versions = []
=======
@contrib_dir = contrib_dir
@min_gems = { 'ruby' => {}, 'jruby' => {} }
@max_gems = { 'ruby' => {}, 'jruby' => {} }
@integration_json_mapping = {}
>>>>>>> parent of d8cd6b8f4c (Merge pull request #5594 from DataDog/apmlp-1090-remove-jruby-from-ci-matrix)
end

def process
Expand All @@ -48,8 +55,8 @@ def process
def parse_gemfiles
gemfiles = Dir.glob(File.join(@directory, '*'))
gemfiles.each do |gemfile_name|
runtime = File.basename(gemfile_name).split('_').first
next unless runtime == 'ruby'
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.lock')
process_lockfile(gemfile_name, runtime)
Expand Down Expand Up @@ -117,17 +124,27 @@ def process_integrations

package = resolve_integration_name(integration)

<<<<<<< HEAD
@supported_versions << {
integration: integration,
package: package,
source: @gem_sources['ruby'][package],
min_tested: @min_gems['ruby'][package],
max_tested: @max_gems['ruby'][package],
}
=======
@integration_json_mapping[integration] = [
@min_gems['ruby'][integration_name],
@max_gems['ruby'][integration_name],
@min_gems['jruby'][integration_name],
@max_gems['jruby'][integration_name]
]
>>>>>>> parent of d8cd6b8f4c (Merge pull request #5594 from DataDog/apmlp-1090-remove-jruby-from-ci-matrix)
end
end

def include_hardcoded_versions
<<<<<<< HEAD
# `httpx` is maintained externally
@supported_versions << {
integration: 'httpx',
Expand All @@ -146,6 +163,23 @@ def include_hardcoded_versions
min_tested: '0.5.1',
max_tested: '0.5.1',
}
=======
# `httpx` is maintained externally
@integration_json_mapping['httpx'] = [
'[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.5.1', # Min version Ruby
'0.5.1', # Max version Ruby
'0.5.1', # Min version JRuby
'0.5.1' # Max version JRuby
]
>>>>>>> parent of d8cd6b8f4c (Merge pull request #5594 from DataDog/apmlp-1090-remove-jruby-from-ci-matrix)
end

def resolve_integration_name(integration)
Expand Down Expand Up @@ -174,11 +208,15 @@ def write_markdown_output
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|
Expand All @@ -187,12 +225,25 @@ def write_markdown_output

header = "| " + columns.map { |key, title| title.ljust(adjusted_widths[key]) }.join(" | ") + " |"
separator = "|-" + adjusted_widths.map { |_, width| "-" * width }.join("-|-") + "-|"
<<<<<<< HEAD
rows = @supported_versions.sort_by { |support| support[:integration].downcase }.map do |support|
integration_name = support[:integration].ljust(column_widths[:integration])
ruby_min = doc_version(support, :min_tested).ljust(column_widths[:ruby_min])
ruby_max = doc_version(support, :max_tested).ljust(column_widths[:ruby_max])

"| #{integration_name} | #{ruby_min} | #{ruby_max} |"
=======
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} |"
>>>>>>> parent of d8cd6b8f4c (Merge pull request #5594 from DataDog/apmlp-1090-remove-jruby-from-ci-matrix)
end

File.open(OUTPUT_DOC, 'w') do |file|
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/_unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ on: # yamllint disable-line rule:truthy
workflow_dispatch:
inputs:
engine:
description: "`ruby`"
description: "`ruby` or `jruby`"
required: true
type: string
version:
description: "The version of the engine (e.g. 2.x, 3.x, 4.x)"
description: "The version of the engine (2.x or 3.x for Ruby, 9.x or 10.x for JRuby)"
required: true
type: string
alias:
Expand Down Expand Up @@ -127,6 +127,7 @@ jobs:
OTLP_HTTP_PORT: "4318"
DATADOG_GEM_CI: "true"
TEST_DATADOG_INTEGRATION: "1"
JRUBY_OPTS: "--dev" # Faster JVM startup: https://github.com/jruby/jruby/wiki/Improving-startup-time#use-the---dev-flag
services:
agent:
image: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.37.0
Expand Down Expand Up @@ -198,6 +199,7 @@ jobs:
DD_TRACE_AGENT_PORT: "9126"
DATADOG_GEM_CI: "true"
TEST_DATADOG_INTEGRATION: "1"
JRUBY_OPTS: "--dev" # Faster JVM startup: https://github.com/jruby/jruby/wiki/Improving-startup-time#use-the---dev-flag
options: --link mongodb:mongodb_secondary
services:
agent:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/lock-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ jobs:
version: "2.6"
- name: ruby
version: "2.5"
- name: jruby
version: "9.4"
- name: jruby
version: "9.3"
- name: jruby
version: "9.2"
container:
image: ghcr.io/datadog/images-rb/engines/${{ matrix.engine.name }}:${{ matrix.engine.version }}-gnu-gcc-g47f47df86aeb379fb8b31dc6ad91a91bb3c97516
env:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,30 @@ jobs:
version: "2.5"
alias: ruby-25

jruby-94:
name: "JRuby 9.4"
uses: ./.github/workflows/_unit_test.yml
with:
engine: jruby
version: "9.4"
alias: jruby-94

jruby-93:
name: "JRuby 9.3"
uses: ./.github/workflows/_unit_test.yml
with:
engine: jruby
version: "9.3"
alias: jruby-93

jruby-92:
name: "JRuby 9.2"
uses: ./.github/workflows/_unit_test.yml
with:
engine: jruby
version: "9.2"
alias: jruby-92

junit:
name: dd/junit
if: ${{ !cancelled() }}
Expand Down Expand Up @@ -212,5 +236,8 @@ jobs:
- ruby-27
- ruby-26
- ruby-25
- jruby-94
- jruby-93
- jruby-92
steps:
- run: echo "DONE!"
6 changes: 6 additions & 0 deletions .github/workflows/update-latest-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ jobs:
version: '2.6'
- name: ruby
version: '2.5'
- name: jruby
version: '9.4'
- name: jruby
version: '9.3'
- name: jruby
version: '9.2'
container:
image: ghcr.io/datadog/images-rb/engines/${{ matrix.engine.name }}:${{ matrix.engine.version }}-gnu-gcc-g47f47df86aeb379fb8b31dc6ad91a91bb3c97516
env:
Expand Down
Loading
Loading