Skip to content

[v2] Refactor and improve object types#387

Merged
Anilm3 merged 20 commits into
anilm3/v2from
anilm3/refactor-objects
Mar 24, 2025
Merged

[v2] Refactor and improve object types#387
Anilm3 merged 20 commits into
anilm3/v2from
anilm3/refactor-objects

Conversation

@Anilm3

@Anilm3 Anilm3 commented Mar 20, 2025

Copy link
Copy Markdown
Collaborator

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 20, 2025 21:49
@codecov-commenter

codecov-commenter commented Mar 20, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 77.28707% with 72 lines in your changes missing coverage. Please review.

Project coverage is 85.14%. Comparing base (6f1e0d9) to head (59f48b9).

Files with missing lines Patch % Lines
src/object.hpp 80.29% 7 Missing and 33 partials ⚠️
src/interface.cpp 60.86% 14 Missing and 13 partials ⚠️
src/ruleset_info.hpp 0.00% 0 Missing and 3 partials ⚠️
src/event.cpp 95.83% 1 Missing ⚠️
src/processor/base.hpp 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           anilm3/v2     #387      +/-   ##
=============================================
+ Coverage      84.90%   85.14%   +0.24%     
=============================================
  Files            166      164       -2     
  Lines           8425     8408      -17     
  Branches        3595     3575      -20     
=============================================
+ Hits            7153     7159       +6     
+ Misses           495      481      -14     
+ Partials         777      768       -9     
Flag Coverage Δ
waf_test 85.14% <77.28%> (+0.24%) ⬆️

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 20, 2025

Copy link
Copy Markdown

Benchmarks clang

Benchmark execution time: 2025-03-24 14:02:36

Comparing candidate commit 59f48b9 in PR branch anilm3/refactor-objects with baseline commit 6f1e0d9 in branch anilm3/v2.

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

@pr-commenter

pr-commenter Bot commented Mar 20, 2025

Copy link
Copy Markdown

Benchmarks gcc

Benchmark execution time: 2025-03-24 14:05:04

Comparing candidate commit 59f48b9 in PR branch anilm3/refactor-objects with baseline commit 6f1e0d9 in branch anilm3/v2.

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

@pr-commenter

pr-commenter Bot commented Mar 20, 2025

Copy link
Copy Markdown

Benchmarks clang-pgo

Benchmark execution time: 2025-03-24 14:17:16

Comparing candidate commit 59f48b9 in PR branch anilm3/refactor-objects with baseline commit 6f1e0d9 in branch anilm3/v2.

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

@Anilm3

Anilm3 commented Mar 21, 2025

Copy link
Copy Markdown
Collaborator Author

23b22d8 impacted PGO perf by about 3%, reverting.

@Anilm3
Anilm3 marked this pull request as ready for review March 21, 2025 11:59
@Anilm3
Anilm3 requested a review from a team as a code owner March 21, 2025 11:59
@Anilm3 Anilm3 self-assigned this Mar 21, 2025
@Anilm3 Anilm3 changed the title Refactor and improve object types [v2] Refactor and improve object types Mar 21, 2025
Comment thread src/object.hpp Outdated
Comment thread src/object.hpp
Comment thread src/object.hpp Outdated
Comment thread src/object.hpp Outdated
Comment thread src/object.hpp Outdated
@Anilm3
Anilm3 requested a review from cataphract March 24, 2025 13:42
@Anilm3
Anilm3 merged commit 193b42f into anilm3/v2 Mar 24, 2025
@Anilm3
Anilm3 deleted the anilm3/refactor-objects branch March 24, 2025 16:34
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.

3 participants