Skip to content

Fix GraphQL patchers 'require' issue#3813

Merged
vpellan merged 10 commits into
masterfrom
vpellan/graphql-unified-tracer-require
Aug 6, 2024
Merged

Fix GraphQL patchers 'require' issue#3813
vpellan merged 10 commits into
masterfrom
vpellan/graphql-unified-tracer-require

Conversation

@vpellan

@vpellan vpellan commented Jul 29, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member

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

pr-commenter Bot commented Jul 30, 2024

Copy link
Copy Markdown

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

vpellan commented Aug 1, 2024

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Member

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
Copy Markdown
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

codecov-commenter commented Aug 5, 2024

Copy link
Copy Markdown

Codecov Report

❌ 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 5062 commits behind head on master.

Files with missing lines 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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vpellan
vpellan merged commit 8dfe622 into master Aug 6, 2024
@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