Skip to content

Support parsing partial json in appsec#3680

Merged
cataphract merged 2 commits intomasterfrom
glopes/partial-json
Mar 6, 2026
Merged

Support parsing partial json in appsec#3680
cataphract merged 2 commits intomasterfrom
glopes/partial-json

Conversation

@cataphract
Copy link
Contributor

Description

Backport partial json parsing from API10 branch.

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@cataphract cataphract requested review from a team as code owners February 27, 2026 11:28
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Feb 27, 2026

⚠️ Tests

Fix all issues with BitsAI or with Cursor

⚠️ Warnings

🧪 1028 Tests failed

testSearchPhpBinaries from integration.DDTrace\Tests\Integration\PHPInstallerTest (Datadog) (Fix with Cursor)
DDTrace\Tests\Integration\PHPInstallerTest::testSearchPhpBinaries
Test code or tested code printed unexpected output: Searching for available php binaries, this operation might take a while.
testSimplePushAndProcess from laravel-58-test.DDTrace\Tests\Integrations\Laravel\V5_8\QueueTest (Datadog) (Fix with Cursor)
Risky Test
phpvfscomposer://tests/vendor/phpunit/phpunit/phpunit:97
testSimplePushAndProcess from laravel-8x-test.DDTrace\Tests\Integrations\Laravel\V8_x\QueueTest (Datadog) (Fix with Cursor)
DDTrace\Tests\Integrations\Laravel\V8_x\QueueTest::testSimplePushAndProcess
Test code or tested code printed unexpected output: spanLinksTraceId: 69a1d3410000000083f09d845cebae69
tid: 69a1d34100000000
hexProcessTraceId: 83f09d845cebae69
hexProcessSpanId: 343091081193bd97
processTraceId: 9507272005199310441
processSpanId: 3760665152695025047
View all

ℹ️ Info

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 1622f8d | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@codecov-commenter
Copy link

codecov-commenter commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 74.50980% with 65 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.39%. Comparing base (6733f8f) to head (1622f8d).

Files with missing lines Patch % Lines
appsec/src/extension/json_truncated_parser.cpp 73.72% 47 Missing and 15 partials ⚠️
appsec/src/extension/entity_body.c 88.23% 1 Missing and 1 partial ⚠️
appsec/src/extension/logging.h 50.00% 0 Missing and 1 partial ⚠️

❌ Your patch status has failed because the patch coverage (74.50%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3680      +/-   ##
==========================================
+ Coverage   62.20%   62.39%   +0.19%     
==========================================
  Files         141      142       +1     
  Lines       13352    13586     +234     
  Branches     1746     1775      +29     
==========================================
+ Hits         8305     8477     +172     
- Misses       4256     4304      +48     
- Partials      791      805      +14     
Files with missing lines Coverage Δ
appsec/src/extension/php_compat.h 100.00% <ø> (ø)
appsec/src/extension/logging.h 96.29% <50.00%> (ø)
appsec/src/extension/entity_body.c 80.39% <88.23%> (+1.68%) ⬆️
appsec/src/extension/json_truncated_parser.cpp 73.72% <73.72%> (ø)

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6733f8f...1622f8d. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pr-commenter
Copy link

pr-commenter bot commented Feb 27, 2026

Benchmarks [ appsec ]

Benchmark execution time: 2026-02-27 17:54:23

Comparing candidate commit 1622f8d in PR branch glopes/partial-json with baseline commit 6733f8f in branch master.

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

@cataphract cataphract force-pushed the glopes/partial-json branch 3 times, most recently from d6f2e1b to e4ba0b6 Compare February 27, 2026 17:11
Also try to find homebrew clang tools or clang-tidy/format with -17 as a
suffix.
// This product includes software developed at Datadog
// (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc.

#include "json_truncated_parser.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why have you decided to go for a CPP implementation on the exension?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was dictated by the choice of library (rapidjson). The C libraries with SAX-like, event-driven API have not seen updates in more than a decade.

@@ -1 +0,0 @@
/version.hpp
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

3df4e17f08#diff-d7c6e792306074c39c93c98658584807ea65a8c68bbce5c3d353e3afc0a87e55L1-L19 changed the location where version.hpp was generated (no more on the source tree), so this ignore is not needed anymore

Copy link
Contributor

@estringana estringana left a comment

Choose a reason for hiding this comment

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

Just a few questions but nothing big

@cataphract cataphract merged commit 6bba842 into master Mar 6, 2026
2058 of 2073 checks passed
@cataphract cataphract deleted the glopes/partial-json branch March 6, 2026 14:57
@github-actions github-actions bot added this to the 1.17.0 milestone Mar 6, 2026
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