Skip to content

fix(ffe): report rejected flags as parse errors - #2339

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 4 commits into
mainfrom
agent/ffe-rejected-flag-errors
Aug 13, 2026
Merged

fix(ffe): report rejected flags as parse errors#2339
gh-worker-dd-mergequeue-cf854d[bot] merged 4 commits into
mainfrom
agent/ffe-rejected-flag-errors

Conversation

@leoromanovsky

@leoromanovsky leoromanovsky commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Motivation

Malformed per-flag UFC configuration is already isolated during ingestion: libdatadog stores a rejection error for that key while compiling valid neighboring flags normally. The FFI translation incorrectly exposed that rejection as a normal DEFAULT result with no error code, hiding a configuration bug from callers.

This implements the contract merged in DataDog/ffe-system-test-data#26: evaluating a rejected key returns the caller default with ERROR / PARSE_ERROR, while valid neighboring flags remain usable.

Changes

  • Map FlagConfigurationInvalid to the FFI ERROR reason and PARSE_ERROR error code.
  • Add regression coverage proving an invalid regex flag does not poison a valid neighboring flag.
  • Bump the canonical fixture submodule to the revision merged in DataDog/ffe-system-test-data#26.
  • Update the canonical adapter to expect PARSE_ERROR for rejected keys.
  • Compare semantic versions by precedence so build metadata does not change equality or ordering.
  • Correct the regex-ingestion documentation to match the parser behavior.

Decisions

  • Keep validation in libdatadog so the same Rust regex and UFC parsers used for evaluation own rejection decisions.
  • Retain only the per-key rejection error in the compiled configuration, not the malformed flag object.
  • Preserve FLAG_NOT_FOUND for keys absent from the configuration.
  • Use SemVer precedence comparisons, which ignore build metadata as required by the specification.

Validation

  • cargo test -p libdd-ffe
  • cargo test -p libdd-ffe-ffi rejected_flag_is_exposed_as_parse_error
  • cargo test -p libdd-ffe-test-suite --test canonical_fixtures
  • git diff --check

@datadog-official

datadog-official Bot commented Aug 11, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 76.29% (+0.30%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: e735a87 | Docs | Datadog PR Page | Give us feedback!

@pr-commenter

pr-commenter Bot commented Aug 11, 2026

Copy link
Copy Markdown

Benchmarks

Comparison

Benchmark execution time: 2026-08-13 04:56:35

Comparing candidate commit e735a87 in PR branch agent/ffe-rejected-flag-errors with baseline commit 3da894a in branch main.

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

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:flagevaluation_evp/payloads/stress/10flags_1000users_250fields

  • 🟩 execution_time [-4.883ms; -4.684ms] or [-4.766%; -4.572%]
  • 🟩 throughput [+468.319op/s; +487.669op/s] or [+4.798%; +4.996%]

scenario:sdk_test_data/rules-based

  • 🟥 execution_time [+14.228µs; +16.374µs] or [+11.046%; +12.713%]

Candidate

Candidate benchmark details

Group 1

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz e735a87 1786596267 agent/ffe-rejected-flag-errors
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
single_flag_killswitch/rules-based execution_time 155.685ns 159.185ns ± 2.457ns 158.931ns ± 1.789ns 160.645ns 163.973ns 166.051ns 170.661ns 7.38% 1.045 1.758 1.54% 0.174ns 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
single_flag_killswitch/rules-based execution_time [158.845ns; 159.526ns] or [-0.214%; +0.214%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz e735a87 1786596267 agent/ffe-rejected-flag-errors
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
flagevaluation_evp/payloads/scale/2500flags_500users_20fields execution_time 21.371ms 21.436ms ± 0.029ms 21.432ms ± 0.015ms 21.451ms 21.481ms 21.532ms 21.563ms 0.61% 1.119 3.315 0.13% 0.002ms 1 200
flagevaluation_evp/payloads/scale/2500flags_500users_20fields throughput 115941.421op/s 116627.940op/s ± 155.172op/s 116649.587op/s ± 81.250op/s 116712.373op/s 116852.967op/s 116961.294op/s 116979.037op/s 0.28% -1.103 3.257 0.13% 10.972op/s 1 200
flagevaluation_evp/payloads/stress/10flags_1000users_250fields execution_time 96.826ms 97.666ms ± 0.467ms 97.681ms ± 0.171ms 97.829ms 98.227ms 98.867ms 102.163ms 4.59% 4.570 41.629 0.48% 0.033ms 1 200
flagevaluation_evp/payloads/stress/10flags_1000users_250fields throughput 9788.271op/s 10239.180op/s ± 47.953op/s 10237.431op/s ± 17.884op/s 10260.803op/s 10300.916op/s 10311.751op/s 10327.837op/s 0.88% -4.256 37.783 0.47% 3.391op/s 1 200
flagevaluation_evp/payloads/typical/100flags_50users_10fields execution_time 590.546µs 592.398µs ± 0.608µs 592.450µs ± 0.391µs 592.798µs 593.336µs 593.653µs 594.628µs 0.37% -0.005 0.415 0.10% 0.043µs 1 200
flagevaluation_evp/payloads/typical/100flags_50users_10fields throughput 168172.478op/s 168805.471op/s ± 173.310op/s 168790.608op/s ± 111.328op/s 168922.333op/s 169093.619op/s 169195.365op/s 169334.696op/s 0.32% 0.013 0.410 0.10% 12.255op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
flagevaluation_evp/payloads/scale/2500flags_500users_20fields execution_time [21.432ms; 21.440ms] or [-0.018%; +0.018%] None None None
flagevaluation_evp/payloads/scale/2500flags_500users_20fields throughput [116606.434op/s; 116649.445op/s] or [-0.018%; +0.018%] None None None
flagevaluation_evp/payloads/stress/10flags_1000users_250fields execution_time [97.602ms; 97.731ms] or [-0.066%; +0.066%] None None None
flagevaluation_evp/payloads/stress/10flags_1000users_250fields throughput [10232.534op/s; 10245.826op/s] or [-0.065%; +0.065%] None None None
flagevaluation_evp/payloads/typical/100flags_50users_10fields execution_time [592.314µs; 592.483µs] or [-0.014%; +0.014%] None None None
flagevaluation_evp/payloads/typical/100flags_50users_10fields throughput [168781.452op/s; 168829.490op/s] or [-0.014%; +0.014%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz e735a87 1786596267 agent/ffe-rejected-flag-errors
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
flagevaluation_evp/coalescer/scale/2500flags_500users_20fields execution_time 5.350ms 5.370ms ± 0.023ms 5.369ms ± 0.005ms 5.373ms 5.381ms 5.390ms 5.682ms 5.84% 11.933 156.536 0.43% 0.002ms 1 200
flagevaluation_evp/coalescer/scale/2500flags_500users_20fields throughput 439981.274op/s 465540.308op/s ± 1928.887op/s 465669.223op/s ± 407.120op/s 466123.904op/s 466576.105op/s 466984.114op/s 467265.636op/s 0.34% -11.720 152.748 0.41% 136.393op/s 1 200
flagevaluation_evp/coalescer/stress/10flags_1000users_250fields execution_time 7.972ms 7.988ms ± 0.010ms 7.986ms ± 0.004ms 7.990ms 8.005ms 8.032ms 8.038ms 0.66% 2.554 8.965 0.12% 0.001ms 1 200
flagevaluation_evp/coalescer/stress/10flags_1000users_250fields throughput 124403.408op/s 125193.863op/s ± 155.118op/s 125218.404op/s ± 60.392op/s 125273.625op/s 125358.449op/s 125420.460op/s 125434.086op/s 0.17% -2.538 8.871 0.12% 10.969op/s 1 200
flagevaluation_evp/coalescer/typical/100flags_50users_10fields execution_time 180.505µs 182.352µs ± 0.437µs 182.304µs ± 0.175µs 182.500µs 183.032µs 183.580µs 184.928µs 1.44% 1.253 8.806 0.24% 0.031µs 1 200
flagevaluation_evp/coalescer/typical/100flags_50users_10fields throughput 540752.457op/s 548392.977op/s ± 1309.074op/s 548534.362op/s ± 528.286op/s 549035.232op/s 549752.944op/s 551777.032op/s 554002.425op/s 1.00% -1.187 8.600 0.24% 92.566op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
flagevaluation_evp/coalescer/scale/2500flags_500users_20fields execution_time [5.367ms; 5.373ms] or [-0.060%; +0.060%] None None None
flagevaluation_evp/coalescer/scale/2500flags_500users_20fields throughput [465272.983op/s; 465807.633op/s] or [-0.057%; +0.057%] None None None
flagevaluation_evp/coalescer/stress/10flags_1000users_250fields execution_time [7.986ms; 7.989ms] or [-0.017%; +0.017%] None None None
flagevaluation_evp/coalescer/stress/10flags_1000users_250fields throughput [125172.365op/s; 125215.361op/s] or [-0.017%; +0.017%] None None None
flagevaluation_evp/coalescer/typical/100flags_50users_10fields execution_time [182.292µs; 182.413µs] or [-0.033%; +0.033%] None None None
flagevaluation_evp/coalescer/typical/100flags_50users_10fields throughput [548211.552op/s; 548574.402op/s] or [-0.033%; +0.033%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz e735a87 1786596267 agent/ffe-rejected-flag-errors
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
sdk_test_data/rules-based execution_time 140.655µs 144.103µs ± 5.621µs 142.961µs ± 0.672µs 143.774µs 148.678µs 165.613µs 203.120µs 42.08% 7.406 66.242 3.89% 0.397µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
sdk_test_data/rules-based execution_time [143.324µs; 144.882µs] or [-0.541%; +0.541%] None None None

Baseline

Baseline benchmark details

Group 1

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz 3da894a 1786558862 main
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
single_flag_killswitch/rules-based execution_time 158.337ns 161.973ns ± 2.739ns 161.678ns ± 1.805ns 163.434ns 166.870ns 171.205ns 172.402ns 6.63% 1.188 1.613 1.69% 0.194ns 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
single_flag_killswitch/rules-based execution_time [161.593ns; 162.353ns] or [-0.234%; +0.234%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz 3da894a 1786558862 main
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
flagevaluation_evp/payloads/scale/2500flags_500users_20fields execution_time 22.184ms 22.250ms ± 0.028ms 22.255ms ± 0.018ms 22.269ms 22.289ms 22.311ms 22.330ms 0.34% -0.307 -0.170 0.13% 0.002ms 1 200
flagevaluation_evp/payloads/scale/2500flags_500users_20fields throughput 111954.592op/s 112359.613op/s ± 141.727op/s 112336.057op/s ± 88.909op/s 112449.939op/s 112611.837op/s 112688.016op/s 112695.970op/s 0.32% 0.313 -0.171 0.13% 10.022op/s 1 200
flagevaluation_evp/payloads/stress/10flags_1000users_250fields execution_time 101.694ms 102.449ms ± 0.545ms 102.354ms ± 0.278ms 102.763ms 103.069ms 103.416ms 107.769ms 5.29% 4.761 43.259 0.53% 0.039ms 1 200
flagevaluation_evp/payloads/stress/10flags_1000users_250fields throughput 9279.106op/s 9761.186op/s ± 50.733op/s 9769.976op/s ± 26.568op/s 9794.980op/s 9812.673op/s 9827.011op/s 9833.439op/s 0.65% -4.416 38.793 0.52% 3.587op/s 1 200
flagevaluation_evp/payloads/typical/100flags_50users_10fields execution_time 600.628µs 602.025µs ± 0.639µs 601.990µs ± 0.445µs 602.434µs 603.152µs 603.431µs 604.179µs 0.36% 0.301 -0.009 0.11% 0.045µs 1 200
flagevaluation_evp/payloads/typical/100flags_50users_10fields throughput 165513.729op/s 166106.348op/s ± 176.282op/s 166115.750op/s ± 122.799op/s 166238.478op/s 166376.225op/s 166465.465op/s 166492.520op/s 0.23% -0.295 -0.016 0.11% 12.465op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
flagevaluation_evp/payloads/scale/2500flags_500users_20fields execution_time [22.246ms; 22.254ms] or [-0.017%; +0.017%] None None None
flagevaluation_evp/payloads/scale/2500flags_500users_20fields throughput [112339.971op/s; 112379.255op/s] or [-0.017%; +0.017%] None None None
flagevaluation_evp/payloads/stress/10flags_1000users_250fields execution_time [102.374ms; 102.525ms] or [-0.074%; +0.074%] None None None
flagevaluation_evp/payloads/stress/10flags_1000users_250fields throughput [9754.154op/s; 9768.217op/s] or [-0.072%; +0.072%] None None None
flagevaluation_evp/payloads/typical/100flags_50users_10fields execution_time [601.936µs; 602.113µs] or [-0.015%; +0.015%] None None None
flagevaluation_evp/payloads/typical/100flags_50users_10fields throughput [166081.917op/s; 166130.779op/s] or [-0.015%; +0.015%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz 3da894a 1786558862 main
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
flagevaluation_evp/coalescer/scale/2500flags_500users_20fields execution_time 5.417ms 5.436ms ± 0.028ms 5.434ms ± 0.004ms 5.438ms 5.446ms 5.466ms 5.809ms 6.90% 12.303 162.642 0.51% 0.002ms 1 200
flagevaluation_evp/coalescer/scale/2500flags_500users_20fields throughput 430341.559op/s 459876.975op/s ± 2207.817op/s 460024.408op/s ± 355.101op/s 460406.354op/s 461001.226op/s 461382.395op/s 461529.146op/s 0.33% -12.098 158.873 0.48% 156.116op/s 1 200
flagevaluation_evp/coalescer/stress/10flags_1000users_250fields execution_time 7.925ms 7.957ms ± 0.010ms 7.956ms ± 0.005ms 7.962ms 7.971ms 7.983ms 7.997ms 0.52% -0.089 2.127 0.13% 0.001ms 1 200
flagevaluation_evp/coalescer/stress/10flags_1000users_250fields throughput 125042.264op/s 125680.560op/s ± 161.323op/s 125691.479op/s ± 72.625op/s 125757.544op/s 125930.294op/s 126133.488op/s 126176.469op/s 0.39% 0.104 2.119 0.13% 11.407op/s 1 200
flagevaluation_evp/coalescer/typical/100flags_50users_10fields execution_time 181.480µs 187.364µs ± 51.443µs 183.653µs ± 0.151µs 183.884µs 184.507µs 185.267µs 911.212µs 396.16% 14.034 194.974 27.39% 3.638µs 1 200
flagevaluation_evp/coalescer/typical/100flags_50users_10fields throughput 109744.006op/s 542116.911op/s ± 30756.674op/s 544503.825op/s ± 448.666op/s 544853.511op/s 545446.379op/s 550048.311op/s 551026.424op/s 1.20% -13.995 194.243 5.66% 2174.825op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
flagevaluation_evp/coalescer/scale/2500flags_500users_20fields execution_time [5.433ms; 5.440ms] or [-0.071%; +0.071%] None None None
flagevaluation_evp/coalescer/scale/2500flags_500users_20fields throughput [459570.993op/s; 460182.957op/s] or [-0.067%; +0.067%] None None None
flagevaluation_evp/coalescer/stress/10flags_1000users_250fields execution_time [7.955ms; 7.958ms] or [-0.018%; +0.018%] None None None
flagevaluation_evp/coalescer/stress/10flags_1000users_250fields throughput [125658.202op/s; 125702.918op/s] or [-0.018%; +0.018%] None None None
flagevaluation_evp/coalescer/typical/100flags_50users_10fields execution_time [180.235µs; 194.494µs] or [-3.805%; +3.805%] None None None
flagevaluation_evp/coalescer/typical/100flags_50users_10fields throughput [537854.331op/s; 546379.490op/s] or [-0.786%; +0.786%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz 3da894a 1786558862 main
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
sdk_test_data/rules-based execution_time 125.519µs 128.802µs ± 5.327µs 127.757µs ± 0.719µs 128.703µs 132.930µs 149.882µs 186.722µs 46.15% 7.788 73.729 4.13% 0.377µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
sdk_test_data/rules-based execution_time [128.064µs; 129.540µs] or [-0.573%; +0.573%] None None None

@leoromanovsky
leoromanovsky marked this pull request as ready for review August 11, 2026 01:52
@leoromanovsky
leoromanovsky requested a review from a team as a code owner August 11, 2026 01:52
@leoromanovsky
leoromanovsky requested review from btthomas and sameerank and removed request for a team August 11, 2026 01:52
@dd-octo-sts

dd-octo-sts Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 8.20 MB 8.20 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 89.19 MB 89.18 MB -0% (-7.32 KB) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 100.36 MB 100.35 MB -0% (-7.37 KB) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.06 MB 11.06 MB -0% (-152 B) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 26.63 MB 26.62 MB --.01% (-4.00 KB) 💪
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 94.56 KB 94.56 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 191.42 MB 191.39 MB --.01% (-32.00 KB) 💪
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 1001.43 MB 1001.42 MB -0% (-8.96 KB) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 8.71 MB 8.71 MB --.01% (-1.00 KB) 💪
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 94.56 KB 94.56 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 25.62 MB 25.62 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 51.01 MB 51.01 MB -0% (-3.59 KB) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 23.22 MB 23.21 MB --.01% (-3.50 KB) 💪
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 96.04 KB 96.04 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 196.33 MB 196.32 MB -0% (-8.00 KB) 👌
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 990.81 MB 990.80 MB -0% (-8.92 KB) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 6.73 MB 6.73 MB --.01% (-1.00 KB) 💪
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 96.04 KB 96.04 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 27.55 MB 27.55 MB --.02% (-8.00 KB) 💪
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 48.55 MB 48.55 MB -0% (-3.65 KB) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 79.46 MB 79.45 MB --.01% (-9.23 KB) 💪
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 9.12 MB 9.12 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 95.12 MB 95.11 MB -0% (-9.20 KB) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.14 MB 11.14 MB -0% (-96 B) 👌

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates libdd-ffe’s Rust and FFI error semantics so that per-flag ingestion rejections (e.g., invalid regex) are surfaced to callers as parse errors, while leaving neighboring valid flags evaluatable. It also aligns SemVer comparisons with SemVer precedence rules (ignoring build metadata) and updates tests and canonical fixtures to match the revised contract.

Changes:

  • Map FlagConfigurationInvalid to FFI Reason::Error with ErrorCode::ParseError (and update canonical fixtures accordingly).
  • Add regression tests ensuring a rejected/invalid flag does not invalidate evaluation of a valid neighboring flag.
  • Compare semantic versions by precedence (cmp_precedence) so build metadata does not affect comparisons; add coverage for +build variants.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
libdd-ffe/src/rules_based/ufc/models.rs Updates ingestion/evaluation comment to reflect regex compilation during ingestion (reject flag on compile failure).
libdd-ffe/src/rules_based/eval/eval_rules.rs Switches SemVer equality/ordering to precedence comparison and adds tests for build metadata behavior.
libdd-ffe/src/rules_based/eval/eval_assignment.rs Adds regression test proving an invalid flag does not poison a valid neighboring flag.
libdd-ffe/src/rules_based/error.rs Clarifies FlagConfigurationInvalid contract: treat as per-flag parse error without invalidating the rest of the config.
libdd-ffe-test-suite/tests/canonical_fixtures.rs Updates canonical adapter mappings so FlagConfigurationInvalid is treated as ERROR with PARSE_ERROR.
libdd-ffe-ffi/src/assignment.rs Fixes FFI mapping: FlagConfigurationInvalid now yields ParseError, and adds a regression unit test.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

TargetingKeyMissing,

/// Failed to parse configuration. This should normally never happen and is likely a signal
/// that you should update SDK.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I feel like this comment could also be updated with something like "Failures encountered while compiling an individual flag are converted to FlagConfigurationInvalid at the per-flag ingestion boundary."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yea good call

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants