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

[APPSEC-55378] Extract processor context into separate file #4023

Merged
merged 2 commits into from
Oct 24, 2024

Conversation

Strech
Copy link
Member

@Strech Strech commented Oct 24, 2024

Change log entry

Not needed.

What does this PR do?

This is a preparation PR which extracts Datadog::AppSec::Processor::Context into a separate file. No changes (yet 😏) to the logic or implementation were done.

Motivation:

We are going to work on those items soon and it makes sense to separate files.

Additional Notes:

None.

How to test the change?

Just CI.

@pr-commenter
Copy link

pr-commenter bot commented Oct 24, 2024

Benchmarks

Benchmark execution time: 2024-10-24 16:24:16

Comparing candidate commit a5e63c2 in PR branch appsec-55378-extract-waf-context with baseline commit 06e050b in branch master.

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

@Strech Strech force-pushed the appsec-55378-extract-waf-context branch from b407e0d to 5672c36 Compare October 24, 2024 14:21
@Strech Strech marked this pull request as ready for review October 24, 2024 14:24
@Strech Strech requested a review from a team as a code owner October 24, 2024 14:24
@Strech Strech force-pushed the appsec-55378-extract-waf-context branch 2 times, most recently from b98e1f6 to 8b44e52 Compare October 24, 2024 14:28
@codecov-commenter
Copy link

codecov-commenter commented Oct 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.84%. Comparing base (06e050b) to head (a5e63c2).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4023      +/-   ##
==========================================
- Coverage   97.86%   97.84%   -0.02%     
==========================================
  Files        1319     1321       +2     
  Lines       79322    79325       +3     
  Branches     3934     3934              
==========================================
- Hits        77628    77616      -12     
- Misses       1694     1709      +15     

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

Copy link
Contributor

@vpellan vpellan left a comment

Choose a reason for hiding this comment

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

LGTM!

module AppSec
class Processor
class Context
type event = untyped
Copy link
Contributor

Choose a reason for hiding this comment

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

I think event is a ::Hash[Symbol, untyped] according to where it's used (e.g.: https://github.com/DataDog/dd-trace-rb/blob/master/lib/datadog/appsec/contrib/rack/gateway/watcher.rb#L47), I'm not sure it is more useful than declaring it as untyped though

Suggested change
type event = untyped
type event = ::Hash[Symbol, untyped]

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe, I'm not sure that I fully understand the code to change it now, we have events from the WAF module too and so far they are always empty.

I think we can definitely change it as soon as we 100% sure.

@Strech Strech force-pushed the appsec-55378-extract-waf-context branch from 8b44e52 to a5e63c2 Compare October 24, 2024 15:45
@Strech Strech merged commit 91d883f into master Oct 24, 2024
269 of 270 checks passed
@Strech Strech deleted the appsec-55378-extract-waf-context branch October 24, 2024 17:07
@github-actions github-actions bot added this to the 2.5.0 milestone Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants