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 AppSec ActiveRecord instrumentation for Rails 4 and ruby < 2.7 #4437

Merged
merged 2 commits into from
Feb 27, 2025

Conversation

y9v
Copy link
Member

@y9v y9v commented Feb 26, 2025

What does this PR do?
This PR fixes AppSec ActiveRecord instrumentation for Rails version 4.

Motivation:
AppSec ActiveRecord instrumentation raised ArgumentError with Rails 4 and Ruby < 2.7.

The reason for this was the fact that Ruby versions older than 2.7 passed empty hash as a positional argument for empty hash splat.
https://rubyreferences.github.io/rubychanges/2.7.html#keyword-argument-related-changes

Change log entry
Yes. AppSec: Fix ActiveRecord instrumentation for Rails 4 and ruby < 2.7

Additional Notes:
None

How to test the change?
CI and manual testing.

@y9v y9v self-assigned this Feb 26, 2025
@y9v y9v requested review from a team as code owners February 26, 2025 16:47
@github-actions github-actions bot added integrations Involves tracing integrations appsec Application Security monitoring product labels Feb 26, 2025
@datadog-datadog-prod-us1
Copy link
Contributor

datadog-datadog-prod-us1 bot commented Feb 26, 2025

Datadog Report

Branch report: appsec-fix-active-record-instrumentation-for-rails4
Commit report: 82cb155
Test service: dd-trace-rb

✅ 0 Failed, 20781 Passed, 1379 Skipped, 3m 14.63s Total Time

@pr-commenter
Copy link

pr-commenter bot commented Feb 26, 2025

Benchmarks

Benchmark execution time: 2025-02-27 09:56:15

Comparing candidate commit 82cb155 in PR branch appsec-fix-active-record-instrumentation-for-rails4 with baseline commit fa88415 in branch master.

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

scenario:tracing - Propagation - Datadog

  • 🟥 throughput [-2951.248op/s; -2871.201op/s] or [-8.972%; -8.728%]

scenario:tracing - Tracing.log_correlation

  • 🟥 throughput [-7608.068op/s; -7285.051op/s] or [-6.451%; -6.177%]

@codecov-commenter
Copy link

codecov-commenter commented Feb 27, 2025

Codecov Report

Attention: Patch coverage is 72.72727% with 12 lines in your changes missing coverage. Please review.

Project coverage is 97.68%. Comparing base (fa88415) to head (82cb155).

Files with missing lines Patch % Lines
...ib/datadog/appsec/contrib/active_record/patcher.rb 70.58% 10 Missing ⚠️
...og/appsec/contrib/active_record/instrumentation.rb 80.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4437      +/-   ##
==========================================
- Coverage   97.71%   97.68%   -0.03%     
==========================================
  Files        1374     1374              
  Lines       83755    83806      +51     
  Branches     4236     4249      +13     
==========================================
+ Hits        81841    81870      +29     
- Misses       1914     1936      +22     

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

@y9v y9v force-pushed the appsec-fix-active-record-instrumentation-for-rails4 branch from aa39abc to 82cb155 Compare February 27, 2025 09:32
Copy link
Member

@Strech Strech left a comment

Choose a reason for hiding this comment

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

👏🏼 Well done

@y9v y9v merged commit a02f64a into master Feb 27, 2025
510 checks passed
@y9v y9v deleted the appsec-fix-active-record-instrumentation-for-rails4 branch February 27, 2025 16:23
@github-actions github-actions bot added this to the 2.13.0 milestone Feb 27, 2025
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants