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 handling of non integer response status code in AppSec #4175

Merged
merged 7 commits into from
Nov 29, 2024

Conversation

y9v
Copy link
Member

@y9v y9v commented Nov 28, 2024

Custom actions for AppSec can have status codes that are strings and not integers. We need to handle them properly.

What does this PR do?
This PR adds conversion of response status code for AppSec actions.

Motivation:
Failing system tests:
DataDog/system-tests#3586

Change log entry
None

Additional Notes:
None

How to test the change?
CI is enough

@y9v y9v self-assigned this Nov 28, 2024
@y9v y9v requested a review from a team as a code owner November 28, 2024 18:48
@github-actions github-actions bot added the appsec Application Security monitoring product label Nov 28, 2024
@y9v y9v requested a review from a team as a code owner November 28, 2024 18:49
@datadog-datadog-prod-us1
Copy link
Contributor

datadog-datadog-prod-us1 bot commented Nov 28, 2024

Datadog Report

Branch report: appsec-handle-non-int-status-code
Commit report: b95a011
Test service: dd-trace-rb

✅ 0 Failed, 22054 Passed, 1459 Skipped, 5m 54.09s Total Time

@codecov-commenter
Copy link

codecov-commenter commented Nov 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.76%. Comparing base (e91980e) to head (b95a011).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4175   +/-   ##
=======================================
  Coverage   97.75%   97.76%           
=======================================
  Files        1351     1351           
  Lines       81732    81733    +1     
  Branches     4146     4147    +1     
=======================================
+ Hits        79899    79908    +9     
+ Misses       1833     1825    -8     

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

@pr-commenter
Copy link

pr-commenter bot commented Nov 28, 2024

Benchmarks

Benchmark execution time: 2024-11-29 10:08:09

Comparing candidate commit 2c7b524 in PR branch appsec-handle-non-int-status-code with baseline commit 33ca49d in branch master.

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

scenario:profiler - sample timeline=false

  • 🟥 throughput [-0.585op/s; -0.578op/s] or [-8.875%; -8.759%]

scenario:profiler - stack collector

  • 🟩 throughput [+150.913op/s; +152.865op/s] or [+5.389%; +5.458%]

Copy link
Contributor

@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.

Looks good. Would like to suggest few changes

lib/datadog/appsec/response.rb Outdated Show resolved Hide resolved
Copy link
Contributor

@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.

Sweeet 🍬

@y9v y9v force-pushed the appsec-handle-non-int-status-code branch from 01b06ef to b95a011 Compare November 29, 2024 09:58
@y9v y9v merged commit 8200cf3 into master Nov 29, 2024
307 of 308 checks passed
@y9v y9v deleted the appsec-handle-non-int-status-code branch November 29, 2024 10:27
@github-actions github-actions bot added this to the 2.8.0 milestone Nov 29, 2024
y9v added a commit that referenced this pull request Nov 29, 2024
Fix handling of non integer response status code in AppSec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
appsec Application Security monitoring product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants