Skip to content

[v2] Remove remaining uses of ddwaf_object in src and tests/unit#391

Merged
Anilm3 merged 9 commits into
anilm3/v2from
anilm3/remove-remaining-ddwaf-object
Mar 26, 2025
Merged

[v2] Remove remaining uses of ddwaf_object in src and tests/unit#391
Anilm3 merged 9 commits into
anilm3/v2from
anilm3/remove-remaining-ddwaf-object

Conversation

@Anilm3

@Anilm3 Anilm3 commented Mar 26, 2025

Copy link
Copy Markdown
Collaborator
  • Replace ddwaf_object on context methods.
  • Replace ddwaf_object on all remaining unit tests.

Remaining work (future PRs):

  • Completely refactor object_view and object_converter.
  • Replace all uses of ddwaf_object within tests with owned_object, borrowed_object and object_view.
  • Remove raw_configuration in favour of object_view or use object_view behind the scenes.
  • Update ddwaf_object_* interface to use new types.
  • Improve context methods to avoid ddwaf_object arguments or optional_ref.
  • Add allocator support and check for allocator compatibility on emplace and emplace_back.
  • Remove all uses of malloc / free

@Anilm3
Anilm3 changed the base branch from master to anilm3/v2 March 26, 2025 16:37
@pr-commenter

pr-commenter Bot commented Mar 26, 2025

Copy link
Copy Markdown

Benchmarks gcc

Benchmark execution time: 2025-03-26 22:13:15

Comparing candidate commit c571eeb in PR branch anilm3/remove-remaining-ddwaf-object with baseline commit c2d1a88 in branch anilm3/v2.

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

@codecov-commenter

codecov-commenter commented Mar 26, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.24%. Comparing base (c2d1a88) to head (c571eeb).

Additional details and impacted files
@@              Coverage Diff              @@
##           anilm3/v2     #391      +/-   ##
=============================================
- Coverage      85.26%   85.24%   -0.02%     
=============================================
  Files            164      164              
  Lines           8407     8406       -1     
  Branches        3573     3572       -1     
=============================================
- Hits            7168     7166       -2     
- Misses           477      481       +4     
+ Partials         762      759       -3     
Flag Coverage Δ
waf_test 85.24% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pr-commenter

pr-commenter Bot commented Mar 26, 2025

Copy link
Copy Markdown

Benchmarks clang

Benchmark execution time: 2025-03-26 22:10:43

Comparing candidate commit c571eeb in PR branch anilm3/remove-remaining-ddwaf-object with baseline commit c2d1a88 in branch anilm3/v2.

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

scenario:global-benchmark.random.clang

  • 🟥 execution_time [+14.808ms; +14.897ms] or [+6.133%; +6.170%]

@pr-commenter

pr-commenter Bot commented Mar 26, 2025

Copy link
Copy Markdown

Benchmarks clang-pgo

Benchmark execution time: 2025-03-26 22:23:59

Comparing candidate commit c571eeb in PR branch anilm3/remove-remaining-ddwaf-object with baseline commit c2d1a88 in branch anilm3/v2.

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

@Anilm3
Anilm3 marked this pull request as ready for review March 26, 2025 22:09
@Anilm3
Anilm3 requested a review from a team as a code owner March 26, 2025 22:09
@Anilm3

Anilm3 commented Mar 26, 2025

Copy link
Copy Markdown
Collaborator Author

Changes are primarily to tests, merging...

@Anilm3
Anilm3 merged commit e9e02de into anilm3/v2 Mar 26, 2025
@Anilm3
Anilm3 deleted the anilm3/remove-remaining-ddwaf-object branch March 26, 2025 22:24
Anilm3 added a commit that referenced this pull request Oct 1, 2025
* Object view: read only abstraction to ddwaf_object (#341)
* [v2] Remove mingw builds (#381)
* Writable objects: owned and borrowed object and object limits removal (#378, #382)
* [v2] Refactor and improve object types (#387)
* [v2] Update unit tests to use new abstractions (#389)
* [v2] Update `raw_configuration` type to use `object_view` (#390)
* [v2] Remove remaining uses of ddwaf_object in `src` and `tests/unit` (#391)
* [v2] JWT Decoding Processor (#401)
* [v2] First iteration of object layout changes (#394)
* Split context data insertion from evaluation (#407)
* [v2] Second iteration of object layout changes (#408)
* [v2] Add new fingerprint and object view tests (#414)
* Reenable attribute collector unit test (#415)
* [v2] Container view types (#413)
* Exclude assertions from coverage (#416)
* [v2] Use allocators internally instead of malloc/free and stop generating zero-terminated strings (#418)
* Add memory resource to owned and borrowed objects (#428)
* [v2] Propagate allocators from context (#420)
* [v2] Update interface and expose allocators (#427)
* Refactor evaluation stages out of the context (#442)
* Subcontext: replace ephemerals with a new scope with user-defined lifetime derived from the context (#443)
* Validator: Add support for testing subcontexts and attributes (#451)
* [v2] Pass allocator to context and subcontext eval and add new allocators (#452)
* Update logger to avoid dependencies on ddwaf.h (#453)
* [v2] Return DDWAF_MATCH when there are events, attributes or actions (#455)
* [v2] Cleanup: remove exclusion namespace and some redundant references (#456)
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.

2 participants