Conversation
|
✨ Fix all issues with BitsAI or with Cursor
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3664 +/- ##
==========================================
- Coverage 62.22% 62.10% -0.12%
==========================================
Files 141 141
Lines 13352 13352
Branches 1746 1746
==========================================
- Hits 8308 8292 -16
- Misses 4253 4266 +13
- Partials 791 794 +3 see 3 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Benchmarks [ tracer ]Benchmark execution time: 2026-02-27 18:12:24 Comparing candidate commit e618728 in PR branch Found 4 performance improvements and 27 performance regressions! Performance is the same for 162 metrics, 1 unstable metrics. scenario:BM_TeaSapiSpindown
scenario:ComposerTelemetryBench/benchTelemetryParsing
scenario:ContextPropagationBench/benchExtractHeaders128Bit
scenario:ContextPropagationBench/benchExtractHeaders64Bit
scenario:ContextPropagationBench/benchExtractTraceContext128Bit
scenario:ContextPropagationBench/benchExtractTraceContext64Bit
scenario:ContextPropagationBench/benchInject128Bit
scenario:ContextPropagationBench/benchInject64Bit
scenario:HookBench/benchHookOverheadInstallHookOnFunction
scenario:HookBench/benchHookOverheadInstallHookOnMethod
scenario:HookBench/benchHookOverheadTraceFunction
scenario:HookBench/benchHookOverheadTraceMethod
scenario:HookBench/benchWithoutHook
scenario:MessagePackSerializationBench/benchMessagePackSerialization
scenario:MessagePackSerializationBench/benchMessagePackSerialization-opcache
scenario:PDOBench/benchPDOBaseline
scenario:PHPRedisBench/benchRedisBaseline
scenario:SamplingRuleMatchingBench/benchGlobMatching1
scenario:SamplingRuleMatchingBench/benchGlobMatching2
scenario:SamplingRuleMatchingBench/benchGlobMatching3
scenario:SamplingRuleMatchingBench/benchGlobMatching4
scenario:SamplingRuleMatchingBench/benchRegexMatching1
scenario:SamplingRuleMatchingBench/benchRegexMatching2
scenario:SamplingRuleMatchingBench/benchRegexMatching3
scenario:SamplingRuleMatchingBench/benchRegexMatching4
scenario:SpanBench/benchDatadogAPI
scenario:TraceAnnotationsBench/benchTraceAnnotationOverhead
scenario:TraceFlushBench/benchFlushTrace
scenario:TraceSerializationBench/benchSerializeTrace
|
cff1eed to
1ae39aa
Compare
f363215 to
3fadba0
Compare
3fadba0 to
6028af2
Compare
cataphract
left a comment
There was a problem hiding this comment.
I'd wait for a production rule to be ready (if it ain't already), update the recommended.json files and then also write an integration test. This would validate the correctness of the address and its parameters.
I have the rule https://github.com/DataDog/appsec-event-rules/pull/265 but it's not merged yet. Also we would need to mock the openai library http call. Do we have a system for that already on integration? |
.../tests/integration/src/main/groovy/com/datadog/appsec/php/mock_agent/MockOpenAIServer.groovy
Outdated
Show resolved
Hide resolved
| int getPort() { | ||
| PORT | ||
| } |
There was a problem hiding this comment.
same effect could be gotten in groovy by not making PORT private (with no access modifiers, it generates setters/getters)
appsec/tests/integration/src/main/groovy/com/datadog/appsec/php/docker/AppSecContainer.groovy
Outdated
Show resolved
Hide resolved
appsec/tests/integration/src/main/groovy/com/datadog/appsec/php/docker/AppSecContainer.groovy
Outdated
Show resolved
Hide resolved
...c/tests/integration/src/test/groovy/com/datadog/appsec/php/integration/LlmEventsTests.groovy
Outdated
Show resolved
Hide resolved
...c/tests/integration/src/test/groovy/com/datadog/appsec/php/integration/LlmEventsTests.groovy
Show resolved
Hide resolved
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3c92b6746e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
e713572 to
277957f
Compare
cataphract
left a comment
There was a problem hiding this comment.
Seems better now, pending test success, but see some new comments
| }; | ||
| }; | ||
|
|
||
| $handleRequestPrehook = fn ($streamed, $operationID, $reportApm, $reportAppsec) => function (\DDTrace\SpanData $span, $args) use ($operationID, $streamed, $reportApm, $reportAppsec, $pushAppsecEvent) { |
| ); | ||
|
|
||
| $handleRequestPrehook = fn ($streamed, $operationID, $reportApm, $reportAppsec) => function (\DDTrace\SpanData $span, $args) use ($operationID, $streamed, $reportApm, $reportAppsec) { | ||
| $pushAppsecEvent = static function (bool $reportAppsec, array $args): void { |
There was a problem hiding this comment.
could just be separate function since it doesn't capture any variable
| } | ||
|
|
||
| @Container | ||
| public static final MockOpenAIServer mockOpenAIServer = new MockOpenAIServer() |
There was a problem hiding this comment.
don't think this should be annotated with @Container
Description
This PR enables appsec capabilities when using
openai-phpclient. The implementation push appsec addresses to the waf and then eventually they are reported to the backend.More info on RFC:
API Endpoints: AI usageReviewer checklist