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-56188] Replace Scope with Context #4277

Merged
merged 11 commits into from
Jan 13, 2025

Conversation

Strech
Copy link
Member

@Strech Strech commented Jan 10, 2025

What does this PR do?

Replace irresponsible class AppSec::Scope with AppSec::Context and move some functionality into it.

Motivation:

In order to implement RASP/WAF telemetry and metrics we need to adjust the domain of the AppSec. The main point - AppSec::Context represents request context and hides complexity of the security engine calls (and gathering statistics) from the instrumentation.

You will see some obvious issues with existing code because of that change, but that's the plan. We move slowly with a guaranteed compatibility.

Change log entry

No.

Additional Notes:

This is the first PR which establishes the base to develop metrics collection. In this PR introduces as minimum as possible changes to stay compatible, but move forward.

How to test the change?

CI (specifically systems tests) should be enough.

@Strech Strech changed the title APPSEC-56188 Replace Scope with Context [APPSEC-56188] Replace Scope with Context Jan 10, 2025
@github-actions github-actions bot added integrations Involves tracing integrations appsec Application Security monitoring product labels Jan 10, 2025
@Strech Strech added dev/refactor Involves refactoring existing components dev/internal Other internal work that does not need to be included in the changelog labels Jan 10, 2025
spec/datadog/appsec/context_spec.rb Outdated Show resolved Hide resolved
spec/datadog/appsec/context_spec.rb Outdated Show resolved Hide resolved
@datadog-datadog-prod-us1
Copy link
Contributor

datadog-datadog-prod-us1 bot commented Jan 10, 2025

Datadog Report

Branch report: appsec-56188-replace-scope-with-context
Commit report: 92b6443
Test service: dd-trace-rb

✅ 0 Failed, 22187 Passed, 1477 Skipped, 5m 23.48s Total Time

@pr-commenter
Copy link

pr-commenter bot commented Jan 10, 2025

Benchmarks

Benchmark execution time: 2025-01-13 11:20:12

Comparing candidate commit 92b6443 in PR branch appsec-56188-replace-scope-with-context with baseline commit c856145 in branch master.

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

@Strech Strech force-pushed the appsec-56188-replace-scope-with-context branch 4 times, most recently from 4c768f4 to 7d8c852 Compare January 13, 2025 09:28
@Strech Strech force-pushed the appsec-56188-replace-scope-with-context branch from 7d8c852 to 92b6443 Compare January 13, 2025 10:56
@Strech Strech marked this pull request as ready for review January 13, 2025 11:06
@Strech Strech requested review from a team as code owners January 13, 2025 11:06
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 99.71014% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.72%. Comparing base (c856145) to head (92b6443).

Files with missing lines Patch % Lines
.../datadog/appsec/contrib/graphql/gateway/watcher.rb 85.71% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4277   +/-   ##
=======================================
  Coverage   97.72%   97.72%           
=======================================
  Files        1354     1354           
  Lines       82421    82415    -6     
  Branches     4220     4220           
=======================================
- Hits        80543    80539    -4     
+ Misses       1878     1876    -2     

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

@Strech Strech merged commit c5924d7 into master Jan 13, 2025
378 checks passed
@Strech Strech deleted the appsec-56188-replace-scope-with-context branch January 13, 2025 12:43
@github-actions github-actions bot added this to the 2.9.0 milestone Jan 13, 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 dev/internal Other internal work that does not need to be included in the changelog dev/refactor Involves refactoring existing components integrations Involves tracing integrations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants