Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GraphQL patchers 'require' issue #3813

Merged
merged 10 commits into from
Aug 6, 2024

Conversation

vpellan
Copy link
Contributor

@vpellan vpellan commented Jul 29, 2024

What does this PR do?

Making a custom tracer based on unified_tracer should now not need to require explicitly the unified_tracer.rb file anymore. This also fixes the problem with currently unreleased appsec_tracer.

Motivation:

Fixes issue #3804

Additional Notes:

How to test the change?

Create a Rails + GraphQL app with a custom tracer that includes unified_tracer. GraphQL AppSec test app is using this so if system-tests passes, it works.

Unsure? Have a question? Request a review!

@vpellan vpellan requested review from a team as code owners July 29, 2024 11:25
@github-actions github-actions bot added appsec Application Security monitoring product integrations Involves tracing integrations tracing labels Jul 29, 2024
@p-datadog
Copy link
Contributor

Is it supported to load datadog first and graphql second, as well as the other way around?

We already have tests like https://github.com/DataDog/dd-trace-rb/blob/master/spec/loading_spec.rb that start with a clean environment, given that this was a customer-reported issue I would consider adding a test that verifies that the reported case works correctly going forward.

@marcotc marcotc requested a review from a team as a code owner July 30, 2024 20:34
@pr-commenter
Copy link

pr-commenter bot commented Jul 30, 2024

Benchmarks

Benchmark execution time: 2024-08-05 18:32:43

Comparing candidate commit 6f6ce3e in PR branch vpellan/graphql-unified-tracer-require with baseline commit 4fbe269 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 2 unstable metrics.

@vpellan vpellan force-pushed the vpellan/graphql-unified-tracer-require branch 2 times, most recently from 497b58d to 7891bba Compare August 1, 2024 07:19
@vpellan
Copy link
Contributor Author

vpellan commented Aug 1, 2024

Is it supported to load datadog first and graphql second, as well as the other way around?

We already have tests like master/spec/loading_spec.rb that start with a clean environment, given that this was a customer-reported issue I would consider adding a test that verifies that the reported case works correctly going forward.

Hello! Thanks for the suggestions.
I've added a test that will require datadog first, then graphql, and the other way too.
I've also added a test for trace_with.

@@ -0,0 +1,31 @@
RSpec.describe 'loading graphql' do
Copy link
Contributor

Choose a reason for hiding this comment

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

I would think that adding require 'shellwords' in this file is necessary so that it can be executed by itself? The only other place that requires this library is the top-level loading test that I can see.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion, I've added it !

@vpellan vpellan force-pushed the vpellan/graphql-unified-tracer-require branch from 6229289 to 6f6ce3e Compare August 5, 2024 17:59
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 88.59060% with 17 lines in your changes missing coverage. Please review.

Project coverage is 97.86%. Comparing base (4fbe269) to head (6f6ce3e).
Report is 1 commits behind head on master.

Files Patch % Lines
...cing/contrib/graphql/support/application_schema.rb 72.58% 17 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3813      +/-   ##
==========================================
- Coverage   97.87%   97.86%   -0.01%     
==========================================
  Files        1262     1263       +1     
  Lines       75653    75738      +85     
  Branches     3710     3719       +9     
==========================================
+ Hits        74044    74124      +80     
- Misses       1609     1614       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vpellan vpellan merged commit 8dfe622 into master Aug 6, 2024
186 checks passed
@vpellan vpellan deleted the vpellan/graphql-unified-tracer-require branch August 6, 2024 07:39
@github-actions github-actions bot added this to the 2.3.0 milestone Aug 6, 2024
@TonyCTHsu TonyCTHsu mentioned this pull request Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
appsec Application Security monitoring product integrations Involves tracing integrations tracing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants