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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Matrixfile
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,10 @@
'redis-4' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ 3.5 / ✅ jruby',
'redis-3' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ 3.5 / ✅ jruby',
},
'view_component' => {
'view_component-3.23.2' => '❌ 2.5 / ❌ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ 3.5 / ✅ jruby',
'view_component-4' => '❌ 2.5 / ❌ 2.6 / ❌ 2.7 / ❌ 3.0 / ❌ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ 3.5 / ✅ jruby',
},
'appsec:active_record' => {
'relational_db' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ 3.5 / ✅ jruby',
},
Expand Down
3 changes: 2 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ namespace :spec do
:stripe,
:sucker_punch,
:suite,
:trilogy
:trilogy,
:view_component
].each do |contrib|
desc '' # "Explicitly hiding from `rake -T`"
RSpec::Core::RakeTask.new(contrib) do |t, args|
Expand Down
10 changes: 10 additions & 0 deletions appraisal/jruby-9.2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,16 @@
end
end

['3.23.2', '4'].each do |v|
appraise "view_component-#{v}" do
gem 'view_component', "~> #{v}"
gem "actionview"
gem "rails"
gem 'sprockets', '< 4'
gem 'pg'
end
end

appraise 'contrib-old' do
gem 'presto-client', '>= 0.5.14' # Renamed to trino-client in >= 1.0
end
Expand Down
9 changes: 9 additions & 0 deletions appraisal/jruby-9.3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,15 @@
end
end

['3.23.2', '4'].each do |v|
appraise "view_component-#{v}" do
gem 'view_component', "~> #{v}"
gem "actionview"
gem "rails"
gem 'pg'
end
end

appraise 'contrib-old' do
gem 'presto-client', '>= 0.5.14' # Renamed to trino-client in >= 1.0
end
Expand Down
9 changes: 9 additions & 0 deletions appraisal/jruby-9.4.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,15 @@
end
end

['3.23.2', '4'].each do |v|
appraise "view_component-#{v}" do
gem 'view_component', "~> #{v}"
gem "actionview"
gem "rails"
gem 'pg'
end
end

appraise 'contrib-old' do
gem 'presto-client', '>= 0.5.14' # Renamed to trino-client in >= 1.0
end
Expand Down
9 changes: 9 additions & 0 deletions appraisal/ruby-2.7.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,15 @@
end
end

['3.23.2'].each do |v|
appraise "view_component-#{v}" do
gem 'view_component', "~> #{v}"
gem "actionview"
gem "rails"
gem 'pg'
end
end

appraise 'opentelemetry' do
gem 'opentelemetry-sdk', '~> 1.1'
end
Expand Down
9 changes: 9 additions & 0 deletions appraisal/ruby-3.0.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,15 @@
end
end

['3.23.2'].each do |v|
appraise "view_component-#{v}" do
gem 'view_component', "~> #{v}"
gem "actionview"
gem "rails"
gem 'pg'
end
end

appraise 'opentelemetry' do
gem 'opentelemetry-sdk', '~> 1.1'
end
Expand Down
9 changes: 9 additions & 0 deletions appraisal/ruby-3.1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,15 @@
end
end

['3.23.2'].each do |v|
appraise "view_component-#{v}" do
gem 'view_component', "~> #{v}"
gem "actionview"
gem "rails"
gem 'pg'
end
end

appraise 'opentelemetry' do
gem 'opentelemetry-sdk', '~> 1.1'
end
Expand Down
9 changes: 9 additions & 0 deletions appraisal/ruby-3.2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,15 @@
end
end

['3.23.2', '4'].each do |v|
appraise "view_component-#{v}" do
gem 'view_component', "~> #{v}"
gem "actionview"
gem "rails"
gem 'pg'
end
end

appraise 'opentelemetry' do
gem 'opentelemetry-sdk', '~> 1.1'
end
Expand Down
10 changes: 10 additions & 0 deletions appraisal/ruby-3.3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,16 @@
end
end


['3.23.2', '4'].each do |v|
appraise "view_component-#{v}" do
gem 'view_component', "~> #{v}"
gem "actionview"
gem "rails"
gem 'pg'
end
end

appraise 'opentelemetry' do
gem 'opentelemetry-sdk', '~> 1.1'
end
Expand Down
9 changes: 9 additions & 0 deletions appraisal/ruby-3.4.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,15 @@
end
end

['3.23.2', '4'].each do |v|
appraise "view_component-#{v}" do
gem 'view_component', "~> #{v}"
gem "actionview"
gem "rails"
gem 'pg'
end
end

appraise 'opentelemetry' do
gem 'opentelemetry-sdk', '~> 1.1'
end
Expand Down
9 changes: 9 additions & 0 deletions appraisal/ruby-3.5.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,15 @@
end
end

['3.23.2', '4'].each do |v|
appraise "view_component-#{v}" do
gem 'view_component', "~> #{v}"
gem "actionview"
gem "rails"
gem 'pg'
end
end

appraise 'opentelemetry' do
gem 'opentelemetry-sdk', '~> 1.1'
end
Expand Down
49 changes: 49 additions & 0 deletions gemfiles/ruby_3.4_view_component_2.34.0.gemfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions gemfiles/ruby_3.4_view_component_3.23.2.gemfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions gemfiles/ruby_3.4_view_component_4.gemfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ module Configuration
"DD_TRACE_TRILOGY_ENABLED" => {version: ["A"]},
"DD_TRACE_TRILOGY_PEER_SERVICE" => {version: ["A"]},
"DD_TRACE_TRILOGY_SERVICE_NAME" => {version: ["A"]},
"DD_TRACE_VIEW_COMPONENT_ENABLED" => {version: ["A"]},
"DD_TRACE_X_DATADOG_TAGS_MAX_LENGTH" => {version: ["A"]},
"DD_VERSION" => {version: ["A"]},
"OTEL_TRACES_SAMPLER_ARG" => {version: ["A"]}}.freeze
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# frozen_string_literal: true

require_relative '../../../configuration/settings'
require_relative '../ext'

module Datadog
module Tracing
module Contrib
module ViewComponent
module Configuration
# Custom settings for the ViewComponent integration
# @public_api
class Settings < Contrib::Configuration::Settings
option :enabled do |o|
o.type :bool
o.env Ext::ENV_ENABLED
o.default true
end

# @!visibility private
option :analytics_enabled do |o|
o.type :bool
o.env Ext::ENV_ANALYTICS_ENABLED
o.default false
end

# TODO: Rename to components_base_path when revisiting the ActionView refactor
# The ViewComponent and ActionView configurations should mirror each other, since they're generally
# run together. We may also need to revisit that the format is correct.
# see: https://github.com/DataDog/dd-trace-rb/pull/4977#discussion_r2440187824
option :service_name
option :component_base_path do |o|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would components_base_path be better? Since it's a path containing multiple components.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also think we would need to ensure the correct format here - when calculating the component identifier, we are relying that this path will end with /, otherwise component identifiers will start with a /

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both this (and the comment below) are essentially straight ports from the action_view integration; which felt like the right approach to take here because these components are run together (you often render ViewComponents inside ActionView), so it feels right that they are configured and behave similarly.

But! Y’all have the final say here; so just lemme know what makes sense for the repo. :) I just wanted to explain my reasoning for these decisions.

References: https://github.com/DataDog/dd-trace-rb/blob/master/lib/datadog/tracing/contrib/action_view/configuration/settings.rb#L34-L37

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@y9v I wanted to followup on about my explanations for this and https://github.com/DataDog/dd-trace-rb/pull/4977/files#diff-0afa0dfa1931ce2e54bb4846366587860be0b2ca1a205abdcb4b69483c7cdc41.

Let me know if you want me to make these changes, or stick with what's currently in place with ActionView. 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep it aligned with ActionView, despite the concerns pointed by @y9v.

But @tcannonfodder, can you please add a comment, in code, with the concerns. We can revisit them at a later time, when we review the ActionView situation as well.

o.type :string
o.default 'components/'
end

option :use_deprecated_instrumentation_name do |o|
o.type :bool
o.default false
end
end
end
end
end
end
end
Loading