Skip to content

Conversation

@Anilm3
Copy link
Collaborator

@Anilm3 Anilm3 commented Sep 22, 2025

This PR adds support for numeric key paths on rules, for the purpose of addressing elements within an array but, more specifically for addressing both starting from the front or the back. For example:

  • Addressing from the front requires a natural (>= 0) numeric index: ["key", 0, "other", 2].
  • While addressing from the back requires a negative numeric index: ["key", -1, "other", -2].

Therefore when addressing from the front, indices start at 0, while addressing from the back indices start at -1.

As a result of this new feature, key paths with negative indices will be provided as such in the rule match specification, i.e. the negative values will be maintained to ensure that the key path accurately represents what the user requested.

@Anilm3 Anilm3 requested a review from a team as a code owner September 22, 2025 21:23
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

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, or 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 fix this CI failure" or "@codex address that feedback".

@Anilm3 Anilm3 force-pushed the anilm3/support-numeric-key-path branch from 1a923cd to c960cea Compare September 22, 2025 21:32
@pr-commenter
Copy link

pr-commenter bot commented Sep 22, 2025

Benchmarks clang-pgo

Benchmark execution time: 2025-10-28 17:08:29

Comparing candidate commit 941b2d9 in PR branch anilm3/support-numeric-key-path with baseline commit f6d1998 in branch master.

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

@Anilm3 Anilm3 force-pushed the anilm3/support-numeric-key-path branch 2 times, most recently from 6895df2 to df3aad8 Compare September 23, 2025 20:21
@codecov-commenter
Copy link

codecov-commenter commented Sep 23, 2025

Codecov Report

❌ Patch coverage is 81.21212% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.05%. Comparing base (9a789f8) to head (9e47df3).

Files with missing lines Patch % Lines
src/iterator.cpp 81.66% 0 Missing and 11 partials ⚠️
src/object.hpp 66.66% 0 Missing and 9 partials ⚠️
src/condition/exists.cpp 85.00% 0 Missing and 3 partials ⚠️
src/condition/shi_detector.cpp 83.33% 0 Missing and 2 partials ⚠️
src/utils.hpp 66.66% 0 Missing and 2 partials ⚠️
src/configuration/common/expression_parser.cpp 66.66% 0 Missing and 1 partial ⚠️
src/configuration/common/raw_configuration.cpp 93.33% 0 Missing and 1 partial ⚠️
src/configuration/processor_parser.cpp 66.66% 0 Missing and 1 partial ⚠️
src/obfuscator.cpp 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #458      +/-   ##
==========================================
- Coverage   85.21%   85.05%   -0.17%     
==========================================
  Files         189      189              
  Lines        9226     9279      +53     
  Branches     4179     4225      +46     
==========================================
+ Hits         7862     7892      +30     
- Misses        528      529       +1     
- Partials      836      858      +22     
Flag Coverage Δ
waf_test 85.05% <81.21%> (-0.17%) ⬇️

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.

@github-actions
Copy link

github-actions bot commented Sep 23, 2025

Artifact Size Comparison 📦

Artifact Previous Release This PR Difference
darwin-arm64::libddwaf.a 90006808 96224016 0.06%
darwin-arm64::libddwaf.a.stripped 4579664 4973160 0.08%
darwin-arm64::libddwaf.dylib 1963024 2059120 0.04%
darwin-universal::libddwaf.a 181421048 193946552 0.06%
darwin-universal::libddwaf.a.stripped 9765560 10603800 0.08%
darwin-universal::libddwaf.dylib 4142096 4336496 0.04%
darwin-x86_64::libddwaf.a 91414192 97722488 0.06%
darwin-x86_64::libddwaf.a.stripped 5185848 5630592 0.08%
darwin-x86_64::libddwaf.dylib 2150896 2248136 0.04%
linux-aarch64::libddwaf.a 73159398 78323148 0.07%
linux-aarch64::libddwaf.a.stripped 11852314 12513000 0.05%
linux-aarch64::libddwaf.so 2463264 2520768 0.02%
linux-armv7::libddwaf.a 64719602 69316132 0.07%
linux-armv7::libddwaf.a.stripped 10852830 11479548 0.05%
linux-armv7::libddwaf.so 2148796 2185128 0.01%
linux-i386::libddwaf.a 62843294 67377466 0.07%
linux-i386::libddwaf.a.stripped 9380114 9929602 0.05%
linux-i386::libddwaf.so 2392820 2448700 0.02%
linux-x86_64::libddwaf.a 73646022 78812370 0.07%
linux-x86_64::libddwaf.a.stripped 11671354 12311390 0.05%
linux-x86_64::libddwaf.so 2660096 2723328 0.02%
windows-arm64::ddwaf.dll 4788736 4944896 0.03%
windows-arm64::ddwaf.lib 11698 16410 0.40%
windows-arm64::ddwaf_static.lib 57913956 61081072 0.05%
windows-win32::ddwaf.dll 3368448 3484672 0.03%
windows-win32::ddwaf.lib 11922 16726 0.40%
windows-win32::ddwaf_static.lib 49534552 52553630 0.06%
windows-x64::ddwaf.dll 4101632 4212224 0.02%
windows-x64::ddwaf.lib 11698 16410 0.40%
windows-x64::ddwaf_static.lib 57410292 60800734 0.05%

@Anilm3 Anilm3 force-pushed the anilm3/support-numeric-key-path branch from df3aad8 to 6ae5265 Compare September 23, 2025 21:00
@Anilm3
Copy link
Collaborator Author

Anilm3 commented Sep 30, 2025

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ 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

@Anilm3 Anilm3 changed the base branch from anilm3/v2 to master October 3, 2025 08:13
@Anilm3 Anilm3 force-pushed the anilm3/support-numeric-key-path branch from 6dd0a94 to b7da11a Compare October 3, 2025 08:24
@Anilm3 Anilm3 changed the title [v2] Array indexing on key paths Array indexing on key paths Oct 3, 2025
@Anilm3 Anilm3 force-pushed the anilm3/support-numeric-key-path branch from 9ef0a2e to 1c7c434 Compare October 22, 2025 11:02
@DataDog DataDog deleted a comment from pr-commenter bot Oct 22, 2025
@DataDog DataDog deleted a comment from pr-commenter bot Oct 22, 2025
@Anilm3
Copy link
Collaborator Author

Anilm3 commented Oct 24, 2025

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ 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".

@Anilm3 Anilm3 temporarily deployed to dd-protected-coverage October 24, 2025 14:03 — with GitHub Actions Inactive
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Oct 24, 2025

🎯 Code Coverage
Patch Coverage: 99.40%
Total Coverage: 94.00% (+0.02%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 9e47df3 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

Co-authored-by: datadog-official[bot] <214633350+datadog-official[bot]@users.noreply.github.com>
@Anilm3 Anilm3 temporarily deployed to dd-protected-coverage October 25, 2025 11:16 — with GitHub Actions Inactive
@Anilm3 Anilm3 force-pushed the anilm3/support-numeric-key-path branch from 56be6a8 to 856e971 Compare October 26, 2025 16:48
@Anilm3 Anilm3 temporarily deployed to dd-protected-coverage October 26, 2025 16:58 — with GitHub Actions Inactive
@Anilm3 Anilm3 temporarily deployed to dd-protected-coverage October 26, 2025 17:52 — with GitHub Actions Inactive
@Anilm3 Anilm3 force-pushed the anilm3/support-numeric-key-path branch from ea1e40b to 5a729ba Compare October 26, 2025 18:59
@Anilm3 Anilm3 temporarily deployed to dd-protected-coverage October 26, 2025 19:08 — with GitHub Actions Inactive
@Anilm3 Anilm3 force-pushed the anilm3/support-numeric-key-path branch from 5a729ba to c68a7ee Compare October 26, 2025 19:36
@Anilm3 Anilm3 temporarily deployed to dd-protected-coverage October 26, 2025 19:45 — with GitHub Actions Inactive
@Anilm3 Anilm3 force-pushed the anilm3/support-numeric-key-path branch from c68a7ee to 0ed3509 Compare October 26, 2025 20:54
@Anilm3 Anilm3 temporarily deployed to dd-protected-coverage October 26, 2025 21:04 — with GitHub Actions Inactive
@Anilm3 Anilm3 force-pushed the anilm3/support-numeric-key-path branch from 0ed3509 to 8e91130 Compare October 27, 2025 08:53
@Anilm3 Anilm3 temporarily deployed to dd-protected-coverage October 27, 2025 09:03 — with GitHub Actions Inactive
@Anilm3 Anilm3 force-pushed the anilm3/support-numeric-key-path branch from 8e91130 to 0c1b4fc Compare October 27, 2025 21:34
@Anilm3 Anilm3 temporarily deployed to dd-protected-coverage October 27, 2025 21:42 — with GitHub Actions Inactive
@Anilm3 Anilm3 force-pushed the anilm3/support-numeric-key-path branch from 0c1b4fc to bb2b407 Compare October 27, 2025 21:48
@Anilm3 Anilm3 temporarily deployed to dd-protected-coverage October 27, 2025 22:01 — with GitHub Actions Inactive
@Anilm3 Anilm3 temporarily deployed to dd-protected-coverage October 28, 2025 16:41 — with GitHub Actions Inactive
@Anilm3 Anilm3 temporarily deployed to dd-protected-coverage November 4, 2025 15:16 — with GitHub Actions Inactive
@Anilm3 Anilm3 temporarily deployed to dd-protected-coverage November 4, 2025 15:51 — with GitHub Actions Inactive
@Anilm3 Anilm3 force-pushed the anilm3/support-numeric-key-path branch from 845e604 to 9e47df3 Compare November 4, 2025 17:34
@Anilm3 Anilm3 temporarily deployed to dd-protected-coverage November 4, 2025 17:43 — with GitHub Actions Inactive
@Anilm3 Anilm3 enabled auto-merge (squash) November 4, 2025 17:54
@Anilm3 Anilm3 merged commit 68e4725 into master Nov 5, 2025
102 of 106 checks passed
@Anilm3 Anilm3 deleted the anilm3/support-numeric-key-path branch November 5, 2025 07:46
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.

4 participants