Skip to content

Commit

Permalink
Merge branch 'master' into base
Browse files Browse the repository at this point in the history
* master:
  DEBUG-2334 Dynamic instrumentation configuration (DataDog#3917)
  Update Gemfiles
  Set both permission for milestone action (DataDog#3920)
  Rename variable
  Lint
  Add tools to excluded test
  Update gemfiles
  Extract yard
  Comment
  Task for updating latest group
  Allow GraphQL integration reconfiguration
  Change the way how login tracking is disabled for Rememberable strategy
  Rename __validate alias to __validate_datadog_authenticatable
  Add sig file for RememberablePatch
  Add test for Devise::Strategies::Rememberable patch
  Add AppSec patcher for Devise Rememberable strategy
  • Loading branch information
p committed Sep 18, 2024
2 parents de9c2d2 + f6ec8b7 commit c60f7c1
Show file tree
Hide file tree
Showing 1,055 changed files with 8,156 additions and 2,121 deletions.
1 change: 1 addition & 0 deletions .github/workflows/add-milestone-to-pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
permissions:
contents: read
issues: write
pull-requests: write
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && github.event.pull_request.milestone == null
steps:
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/yard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,18 @@ jobs:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
container:
image: ghcr.io/datadog/images-rb/engines/ruby:3.2
env:
BUNDLE_GEMFILE: tools/yard.gemfile
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
- run: ls -al
- name: Bundle
run: bundle install
- name: Generate YARD documentation
run: bundle exec rake docs
run: bundle exec rake docs --rakefile=tasks/yard.rake
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
Expand Down
1 change: 1 addition & 0 deletions .standard_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ ignore:
- spec/datadog/tracing/**/**
- spec/support/**/**
- tasks/**/**
- tools/**/**
- yard/**/**
32 changes: 32 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,38 @@ def appraise(group, &block)
end
end

# Builds a matrix of versions to test for a given integration
#
# `range`: the range of versions to test
# `gem` : optional, gem name to test (gem name can be different from the integration name)
# `min` : optional, minimum version to test
# `meta` : optional, additional metadata (development dependencies, etc.) for the group
def build_coverage_matrix(integration, range, gem: nil, min: nil, meta: {})
gem ||= integration

if min
appraise "#{integration}-min" do
gem gem, "= #{n}"
meta.each { |k, v| gem k, v }
end
end

range.each do |n|
appraise "#{integration}-#{n}" do
gem gem, "~> #{n}"
meta.each { |k, v| gem k, v }
end
end

appraise "#{integration}-latest" do
# The latest group declares dependencies without version constraints,
# still requires being updated to pick up the next major version and
# committing the changes to lockfiles.
gem gem
meta.each { |k, v| gem k, v }
end
end

major, minor, = if defined?(RUBY_ENGINE_VERSION)
Gem::Version.new(RUBY_ENGINE_VERSION).segments
else
Expand Down
2 changes: 0 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ elsif RUBY_VERSION >= '3.0.0' # No longer bundled by default since Ruby 3.0
gem 'webrick', '>= 1.7.0'
end

gem 'yard', '~> 0.9' # NOTE: YardDoc is generated with ruby 3.2 in GitHub Actions

if RUBY_VERSION >= '2.6.0'
# 1.50 is the last version to support Ruby 2.6
gem 'rubocop', '~> 1.50.0', require: false
Expand Down
23 changes: 13 additions & 10 deletions Matrixfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@
'relational_db' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby'
},
'elasticsearch' => {
'elasticsearch-7' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'elasticsearch-8' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby'
'elasticsearch-latest' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'elasticsearch-8' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'elasticsearch-7' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
},
'ethon' => {
'http' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ❌ jruby'
Expand Down Expand Up @@ -113,8 +114,9 @@
'relational_db' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ❌ jruby'
},
'opensearch' => {
'opensearch-2' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'opensearch-3' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby'
'opensearch-latest' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'opensearch-3' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'opensearch-2' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
},
'pg' => {
'relational_db' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ❌ jruby'
Expand Down Expand Up @@ -164,12 +166,13 @@
'contrib' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby'
},
'stripe' => {
'stripe-12' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'stripe-11' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'stripe-10' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'stripe-9' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'stripe-8' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'stripe-7' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'stripe-latest' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'stripe-12' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'stripe-11' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'stripe-10' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'stripe-9' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'stripe-8' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
'stripe-7' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
},
'sucker_punch' => {
'contrib' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby'
Expand Down
35 changes: 22 additions & 13 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ require 'rubocop/rake_task' if Gem.loaded_specs.key? 'rubocop'
require 'standard/rake' if Gem.loaded_specs.key? 'standard'
require 'rspec/core/rake_task'
require 'rake/extensiontask'
require 'yard'
require 'os'
if Gem.loaded_specs.key? 'ruby_memcheck'
require 'ruby_memcheck'
Expand Down Expand Up @@ -84,6 +83,7 @@ desc 'Run RSpec'
# rubocop:disable Metrics/BlockLength
namespace :spec do
task all: [:main, :benchmark,
:graphql, :graphql_unified_trace_patcher, :graphql_trace_patcher, :graphql_tracing_patcher,
:rails, :railsredis, :railsredis_activesupport, :railsactivejob,
:elasticsearch, :http, :redis, :sidekiq, :sinatra, :hanami, :hanami_autoinstrument,
:profiling, :crashtracking]
Expand All @@ -101,6 +101,27 @@ namespace :spec do
t.rspec_opts = args.to_a.join(' ')
end

RSpec::Core::RakeTask.new(:graphql) do |t, args|
t.pattern = 'spec/datadog/tracing/contrib/graphql/**/*_spec.rb'
t.exclude_pattern = 'spec/datadog/tracing/contrib/graphql/{unified_trace,trace,tracing}_patcher_spec.rb'
t.rspec_opts = args.to_a.join(' ')
end

RSpec::Core::RakeTask.new(:graphql_unified_trace_patcher) do |t, args|
t.pattern = 'spec/datadog/tracing/contrib/graphql/unified_trace_patcher_spec.rb'
t.rspec_opts = args.to_a.join(' ')
end

RSpec::Core::RakeTask.new(:graphql_trace_patcher) do |t, args|
t.pattern = 'spec/datadog/tracing/contrib/graphql/trace_patcher_spec.rb'
t.rspec_opts = args.to_a.join(' ')
end

RSpec::Core::RakeTask.new(:graphql_tracing_patcher) do |t, args|
t.pattern = 'spec/datadog/tracing/contrib/graphql/tracing_patcher_spec.rb'
t.rspec_opts = args.to_a.join(' ')
end

desc '' # "Explicitly hiding from `rake -T`"
RSpec::Core::RakeTask.new(:opentelemetry) do |t, args|
t.pattern = 'spec/datadog/opentelemetry/**/*_spec.rb,spec/datadog/opentelemetry_spec.rb'
Expand Down Expand Up @@ -223,7 +244,6 @@ namespace :spec do
:excon,
:faraday,
:grape,
:graphql,
:grpc,
:http,
:httpclient,
Expand Down Expand Up @@ -350,17 +370,6 @@ if defined?(RuboCop::RakeTask)
end
end

YARD::Rake::YardocTask.new(:docs) do |t|
# Options defined in `.yardopts` are read first, then merged with
# options defined here.
#
# It's recommended to define options in `.yardopts` instead of here,
# as `.yardopts` can be read by external YARD tools, like the
# hot-reload YARD server `yard server --reload`.

t.options += ['--title', "datadog #{Datadog::VERSION::STRING} documentation"]
end

# Jobs are parallelized if running in CI.
desc 'CI task; it runs all tests for current version of Ruby'
task ci: 'test:all'
Expand Down
20 changes: 3 additions & 17 deletions appraisal/jruby-9.2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,23 +189,9 @@
gem 'typhoeus'
end

(7..12).each do |n|
appraise "stripe-#{n}" do
gem 'stripe', "~> #{n}"
end
end

[2, 3].each do |n|
appraise "opensearch-#{n}" do
gem 'opensearch-ruby', "~> #{n}"
end
end

[7, 8].each do |n|
appraise "elasticsearch-#{n}" do
gem 'elasticsearch', "~> #{n}"
end
end
build_coverage_matrix('stripe', 7..12)
build_coverage_matrix('opensearch', 2..3, gem: 'opensearch-ruby')
build_coverage_matrix('elasticsearch', 7..8)

appraise 'relational_db' do
gem 'activerecord', '~> 5'
Expand Down
20 changes: 3 additions & 17 deletions appraisal/jruby-9.3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,23 +162,9 @@
gem 'typhoeus'
end

(7..12).each do |n|
appraise "stripe-#{n}" do
gem 'stripe', "~> #{n}"
end
end

[2, 3].each do |n|
appraise "opensearch-#{n}" do
gem 'opensearch-ruby', "~> #{n}"
end
end

[7, 8].each do |n|
appraise "elasticsearch-#{n}" do
gem 'elasticsearch', "~> #{n}"
end
end
build_coverage_matrix('stripe', 7..12)
build_coverage_matrix('opensearch', 2..3, gem: 'opensearch-ruby')
build_coverage_matrix('elasticsearch', 7..8)

appraise 'relational_db' do
gem 'activerecord', '~> 6.0.0'
Expand Down
20 changes: 3 additions & 17 deletions appraisal/jruby-9.4.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,9 @@
gem 'typhoeus'
end

(7..12).each do |n|
appraise "stripe-#{n}" do
gem 'stripe', "~> #{n}"
end
end

[2, 3].each do |n|
appraise "opensearch-#{n}" do
gem 'opensearch-ruby', "~> #{n}"
end
end

[7, 8].each do |n|
appraise "elasticsearch-#{n}" do
gem 'elasticsearch', "~> #{n}"
end
end
build_coverage_matrix('stripe', 7..12)
build_coverage_matrix('opensearch', 2..3, gem: 'opensearch-ruby')
build_coverage_matrix('elasticsearch', 7..8)

appraise 'relational_db' do
gem 'activerecord', '~> 6.1.0'
Expand Down
20 changes: 3 additions & 17 deletions appraisal/ruby-2.5.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,23 +209,9 @@
gem 'typhoeus'
end

(7..12).each do |n|
appraise "stripe-#{n}" do
gem 'stripe', "~> #{n}"
end
end

[2, 3].each do |n|
appraise "opensearch-#{n}" do
gem 'opensearch-ruby', "~> #{n}"
end
end

[7, 8].each do |n|
appraise "elasticsearch-#{n}" do
gem 'elasticsearch', "~> #{n}"
end
end
build_coverage_matrix('stripe', 7..12)
build_coverage_matrix('opensearch', 2..3, gem: 'opensearch-ruby')
build_coverage_matrix('elasticsearch', 7..8)

appraise 'relational_db' do
gem 'activerecord', '~> 5'
Expand Down
20 changes: 3 additions & 17 deletions appraisal/ruby-2.6.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,23 +162,9 @@
gem 'typhoeus'
end

(7..12).each do |n|
appraise "stripe-#{n}" do
gem 'stripe', "~> #{n}"
end
end

[2, 3].each do |n|
appraise "opensearch-#{n}" do
gem 'opensearch-ruby', "~> #{n}"
end
end

[7, 8].each do |n|
appraise "elasticsearch-#{n}" do
gem 'elasticsearch', "~> #{n}"
end
end
build_coverage_matrix('stripe', 7..12)
build_coverage_matrix('opensearch', 2..3, gem: 'opensearch-ruby')
build_coverage_matrix('elasticsearch', 7..8)

appraise 'relational_db' do
gem 'activerecord', '~> 6.0.0'
Expand Down
20 changes: 3 additions & 17 deletions appraisal/ruby-2.7.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,23 +162,9 @@
gem 'typhoeus'
end

(7..12).each do |n|
appraise "stripe-#{n}" do
gem 'stripe', "~> #{n}"
end
end

[2, 3].each do |n|
appraise "opensearch-#{n}" do
gem 'opensearch-ruby', "~> #{n}"
end
end

[7, 8].each do |n|
appraise "elasticsearch-#{n}" do
gem 'elasticsearch', "~> #{n}"
end
end
build_coverage_matrix('stripe', 7..12)
build_coverage_matrix('opensearch', 2..3, gem: 'opensearch-ruby')
build_coverage_matrix('elasticsearch', 7..8)

appraise 'relational_db' do
gem 'activerecord', '~> 6.1.0'
Expand Down
20 changes: 3 additions & 17 deletions appraisal/ruby-3.0.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,9 @@
gem 'typhoeus'
end

(7..12).each do |n|
appraise "stripe-#{n}" do
gem 'stripe', "~> #{n}"
end
end

[2, 3].each do |n|
appraise "opensearch-#{n}" do
gem 'opensearch-ruby', "~> #{n}"
end
end

[7, 8].each do |n|
appraise "elasticsearch-#{n}" do
gem 'elasticsearch', "~> #{n}"
end
end
build_coverage_matrix('stripe', 7..12)
build_coverage_matrix('opensearch', 2..3, gem: 'opensearch-ruby')
build_coverage_matrix('elasticsearch', 7..8)

appraise 'relational_db' do
gem 'activerecord', '~> 7'
Expand Down
Loading

0 comments on commit c60f7c1

Please sign in to comment.