Skip to content

ci: clippy annotation reporter to comment on PRs with changes in usage of panic allow annotations#1049

Open
ekump wants to merge 6 commits intomainfrom
ekump/clippy-annotation-action
Open

ci: clippy annotation reporter to comment on PRs with changes in usage of panic allow annotations#1049
ekump wants to merge 6 commits intomainfrom
ekump/clippy-annotation-action

Conversation

@ekump
Copy link
Contributor

@ekump ekump commented May 2, 2025

What does this PR do?

Adds a github action that scans the repo for usages of clippy allow annotations and reports changes across all crates in the repo.

If the action fails, it should not fail CI and block PRs being merged. If for any reason this action causes issues, feel free to disable it. This report shouldn't impede anyone's work in libdatadog.

Motivation

We want to reduce the chance of libdatadog panicking as much as possible. #915 enabled clippy warnings for panic macros in all crates. This PR will start reporting the number of annotations to bring attention to new additions of allow annotations or PRs that reduce the use of the annotations.

Additional Notes

This code is not part of the libdatadog workspace. It's an independent crate. It's included in this repo as it is expected we will need to make tweaks and fix bugs. Once we feel it is stable it should be moved to a separate repo and treated like any other github action we use.

allow annotations from unit tests for the reporter are currently showing up in the report. The option to filter certain file paths or crates will be added in a follow up PR.

Apologies for the size of the PR. I didn't anticipate it being this large.

Here is what the report looks like when crates have been changed:

Screenshot 2025-05-31 at 10 39 37 PM

How to test the change?

Unit tests were added where possible. I verified the report by adding extra allows and observing changes in the report.

@pr-commenter
Copy link

pr-commenter bot commented May 2, 2025

Benchmarks

Comparison

Benchmark execution time: 2026-02-06 21:43:20

Comparing candidate commit efdaa7e in PR branch ekump/clippy-annotation-action with baseline commit 00c1cd7 in branch main.

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

Candidate

Candidate benchmark details

Group 1

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz efdaa7e 1770413220 ekump/clippy-annotation-action
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
two way interface execution_time 17.951µs 26.167µs ± 10.161µs 18.240µs ± 0.206µs 35.484µs 45.514µs 46.127µs 71.958µs 294.52% 0.934 0.502 38.74% 0.719µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
two way interface execution_time [24.759µs; 27.575µs] or [-5.382%; +5.382%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz efdaa7e 1770413220 ekump/clippy-annotation-action
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
benching serializing traces from their internal representation to msgpack execution_time 13.998ms 14.056ms ± 0.030ms 14.052ms ± 0.012ms 14.066ms 14.105ms 14.172ms 14.236ms 1.31% 2.348 9.042 0.21% 0.002ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
benching serializing traces from their internal representation to msgpack execution_time [14.052ms; 14.060ms] or [-0.030%; +0.030%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz efdaa7e 1770413220 ekump/clippy-annotation-action
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
concentrator/add_spans_to_concentrator execution_time 10.625ms 10.658ms ± 0.016ms 10.657ms ± 0.010ms 10.666ms 10.683ms 10.695ms 10.729ms 0.68% 0.595 1.309 0.15% 0.001ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
concentrator/add_spans_to_concentrator execution_time [10.655ms; 10.660ms] or [-0.020%; +0.020%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz efdaa7e 1770413220 ekump/clippy-annotation-action
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
profile_add_sample_frames_x1000 execution_time 3.909ms 3.914ms ± 0.007ms 3.913ms ± 0.001ms 3.915ms 3.918ms 3.922ms 4.001ms 2.25% 11.365 145.703 0.17% 0.000ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
profile_add_sample_frames_x1000 execution_time [3.913ms; 3.915ms] or [-0.024%; +0.024%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz efdaa7e 1770413220 ekump/clippy-annotation-action
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
profile_add_sample2_frames_x1000 execution_time 540.576µs 541.079µs ± 0.436µs 541.019µs ± 0.209µs 541.229µs 541.718µs 542.060µs 545.381µs 0.81% 5.070 45.621 0.08% 0.031µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
profile_add_sample2_frames_x1000 execution_time [541.018µs; 541.139µs] or [-0.011%; +0.011%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz efdaa7e 1770413220 ekump/clippy-annotation-action
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
receiver_entry_point/report/2597 execution_time 9.475ms 9.888ms ± 0.082ms 9.886ms ± 0.042ms 9.937ms 10.017ms 10.090ms 10.133ms 2.50% -1.062 5.353 0.83% 0.006ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
receiver_entry_point/report/2597 execution_time [9.877ms; 9.900ms] or [-0.115%; +0.115%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz efdaa7e 1770413220 ekump/clippy-annotation-action
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
benching string interning on wordpress profile execution_time 161.449µs 162.442µs ± 0.683µs 162.341µs ± 0.129µs 162.494µs 162.925µs 163.852µs 170.918µs 5.28% 9.946 118.166 0.42% 0.048µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
benching string interning on wordpress profile execution_time [162.347µs; 162.536µs] or [-0.058%; +0.058%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz efdaa7e 1770413220 ekump/clippy-annotation-action
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
sql/obfuscate_sql_string execution_time 84.915µs 85.522µs ± 0.166µs 85.513µs ± 0.068µs 85.579µs 85.736µs 85.832µs 87.188µs 1.96% 5.048 50.180 0.19% 0.012µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
sql/obfuscate_sql_string execution_time [85.499µs; 85.545µs] or [-0.027%; +0.027%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz efdaa7e 1770413220 ekump/clippy-annotation-action
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
ip_address/quantize_peer_ip_address_benchmark execution_time 5.000µs 5.063µs ± 0.036µs 5.055µs ± 0.019µs 5.068µs 5.130µs 5.132µs 5.137µs 1.60% 0.864 -0.611 0.71% 0.003µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
ip_address/quantize_peer_ip_address_benchmark execution_time [5.058µs; 5.068µs] or [-0.099%; +0.099%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz efdaa7e 1770413220 ekump/clippy-annotation-action
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
write only interface execution_time 1.226µs 3.119µs ± 1.401µs 2.949µs ± 0.028µs 2.977µs 3.295µs 13.495µs 14.933µs 406.42% 7.564 57.644 44.81% 0.099µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
write only interface execution_time [2.925µs; 3.313µs] or [-6.226%; +6.226%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz efdaa7e 1770413220 ekump/clippy-annotation-action
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 143.832µs 145.925µs ± 1.953µs 145.668µs ± 0.572µs 146.216µs 147.576µs 152.735µs 166.610µs 14.38% 7.060 65.942 1.34% 0.138µ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 [145.655µs; 146.196µs] or [-0.185%; +0.185%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz efdaa7e 1770413220 ekump/clippy-annotation-action
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
redis/obfuscate_redis_string execution_time 33.351µs 34.013µs ± 1.158µs 33.489µs ± 0.048µs 33.552µs 36.522µs 36.577µs 37.053µs 10.64% 1.700 0.927 3.40% 0.082µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
redis/obfuscate_redis_string execution_time [33.852µs; 34.173µs] or [-0.472%; +0.472%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz efdaa7e 1770413220 ekump/clippy-annotation-action
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 188.835ns 191.398ns ± 2.207ns 190.997ns ± 1.497ns 192.489ns 195.680ns 198.098ns 201.123ns 5.30% 1.253 1.916 1.15% 0.156ns 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 [191.092ns; 191.704ns] or [-0.160%; +0.160%] None None None

Group 14

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz efdaa7e 1770413220 ekump/clippy-annotation-action
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... execution_time 535.302µs 536.824µs ± 1.203µs 536.419µs ± 0.474µs 537.495µs 538.816µs 539.946µs 543.415µs 1.30% 2.056 7.060 0.22% 0.085µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 1840213.803op/s 1862817.364op/s ± 4156.701op/s 1864213.742op/s ± 1647.385op/s 1865546.037op/s 1867074.653op/s 1868008.787op/s 1868106.002op/s 0.21% -2.024 6.829 0.22% 293.923op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 381.519µs 381.993µs ± 0.253µs 381.958µs ± 0.166µs 382.145µs 382.448µs 382.722µs 383.146µs 0.31% 0.912 1.793 0.07% 0.018µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2609969.357op/s 2617851.176op/s ± 1732.461op/s 2618088.304op/s ± 1137.130op/s 2619034.998op/s 2620298.995op/s 2620802.893op/s 2621103.231op/s 0.12% -0.906 1.771 0.07% 122.504op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 189.630µs 190.015µs ± 0.156µs 190.019µs ± 0.103µs 190.105µs 190.273µs 190.398µs 190.511µs 0.26% 0.268 0.052 0.08% 0.011µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5249044.270op/s 5262733.747op/s ± 4324.333op/s 5262617.784op/s ± 2865.786op/s 5265642.375op/s 5269285.775op/s 5271322.925op/s 5273416.505op/s 0.21% -0.263 0.047 0.08% 305.777op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 36.489µs 36.577µs ± 0.048µs 36.576µs ± 0.035µs 36.606µs 36.656µs 36.696µs 36.770µs 0.53% 0.691 0.800 0.13% 0.003µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 27196256.492op/s 27339269.147op/s ± 35579.262op/s 27340665.926op/s ± 25999.624op/s 27368366.454op/s 27386804.046op/s 27400393.912op/s 27405811.804op/s 0.24% -0.682 0.772 0.13% 2515.834op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 45.938µs 46.076µs ± 0.056µs 46.071µs ± 0.036µs 46.109µs 46.179µs 46.224µs 46.258µs 0.41% 0.540 0.510 0.12% 0.004µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 21618011.575op/s 21703484.486op/s ± 26302.410op/s 21705590.687op/s ± 16832.442op/s 21720922.084op/s 21741366.166op/s 21758000.972op/s 21768677.236op/s 0.29% -0.532 0.499 0.12% 1859.861op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... execution_time [536.657µs; 536.991µs] or [-0.031%; +0.031%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [1862241.286op/s; 1863393.443op/s] or [-0.031%; +0.031%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [381.958µs; 382.028µs] or [-0.009%; +0.009%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2617611.073op/s; 2618091.278op/s] or [-0.009%; +0.009%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [189.994µs; 190.037µs] or [-0.011%; +0.011%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5262134.436op/s; 5263333.058op/s] or [-0.011%; +0.011%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [36.571µs; 36.584µs] or [-0.018%; +0.018%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [27334338.203op/s; 27344200.090op/s] or [-0.018%; +0.018%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [46.068µs; 46.083µs] or [-0.017%; +0.017%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [21699839.225op/s; 21707129.747op/s] or [-0.017%; +0.017%] None None None

Group 15

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz efdaa7e 1770413220 ekump/clippy-annotation-action
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
tags/replace_trace_tags execution_time 2.364µs 2.408µs ± 0.017µs 2.404µs ± 0.005µs 2.419µs 2.429µs 2.438µs 2.554µs 6.26% 3.292 27.652 0.69% 0.001µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
tags/replace_trace_tags execution_time [2.406µs; 2.410µs] or [-0.096%; +0.096%] None None None

Group 16

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz efdaa7e 1770413220 ekump/clippy-annotation-action
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
benching deserializing traces from msgpack to their internal representation execution_time 48.628ms 48.952ms ± 0.955ms 48.808ms ± 0.062ms 48.887ms 49.070ms 53.741ms 58.516ms 19.89% 8.445 73.546 1.95% 0.068ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
benching deserializing traces from msgpack to their internal representation execution_time [48.820ms; 49.084ms] or [-0.270%; +0.270%] None None None

Group 17

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz efdaa7e 1770413220 ekump/clippy-annotation-action
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... execution_time 205.763µs 206.440µs ± 0.420µs 206.353µs ± 0.219µs 206.631µs 207.027µs 208.596µs 208.731µs 1.15% 2.348 10.059 0.20% 0.030µs 1 200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput 4790863.900op/s 4844033.893op/s ± 9803.746op/s 4846059.994op/s ± 5139.933op/s 4849738.552op/s 4856137.517op/s 4857879.131op/s 4859960.246op/s 0.29% -2.309 9.799 0.20% 693.230op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 18.549µs 18.616µs ± 0.044µs 18.609µs ± 0.023µs 18.637µs 18.687µs 18.806µs 18.819µs 1.13% 1.661 4.783 0.23% 0.003µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 53139174.199op/s 53716948.269op/s ± 125817.676op/s 53738026.215op/s ± 67336.268op/s 53794476.641op/s 53874450.890op/s 53899198.670op/s 53909907.407op/s 0.32% -1.633 4.646 0.23% 8896.653op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 10.767µs 10.851µs ± 0.030µs 10.850µs ± 0.019µs 10.870µs 10.903µs 10.921µs 10.939µs 0.82% 0.056 0.086 0.28% 0.002µs 1 200
normalization/normalize_name/normalize_name/good throughput 91419096.542op/s 92162193.355op/s ± 257610.368op/s 92164958.430op/s ± 161531.058op/s 92316110.853op/s 92590108.994op/s 92762165.477op/s 92876776.623op/s 0.77% -0.038 0.081 0.28% 18215.804op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... execution_time [206.382µs; 206.499µs] or [-0.028%; +0.028%] None None None
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput [4842675.188op/s; 4845392.598op/s] or [-0.028%; +0.028%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [18.610µs; 18.622µs] or [-0.033%; +0.033%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [53699511.149op/s; 53734385.389op/s] or [-0.032%; +0.032%] None None None
normalization/normalize_name/normalize_name/good execution_time [10.846µs; 10.855µs] or [-0.039%; +0.039%] None None None
normalization/normalize_name/normalize_name/good throughput [92126491.036op/s; 92197895.675op/s] or [-0.039%; +0.039%] None None None

Group 18

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz efdaa7e 1770413220 ekump/clippy-annotation-action
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
credit_card/is_card_number/ execution_time 3.893µs 3.912µs ± 0.003µs 3.912µs ± 0.001µs 3.914µs 3.918µs 3.923µs 3.924µs 0.30% -0.063 9.940 0.08% 0.000µs 1 200
credit_card/is_card_number/ throughput 254861505.646op/s 255601543.355op/s ± 198978.648op/s 255634250.876op/s ± 93593.252op/s 255714268.870op/s 255800683.149op/s 255827957.471op/s 256886429.977op/s 0.49% 0.091 10.071 0.08% 14069.915op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 77.046µs 77.522µs ± 0.427µs 77.406µs ± 0.245µs 77.740µs 78.475µs 78.793µs 79.192µs 2.31% 1.297 1.317 0.55% 0.030µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 12627585.106op/s 12899909.345op/s ± 70500.660op/s 12918861.542op/s ± 40812.820op/s 12954415.678op/s 12970851.923op/s 12978049.027op/s 12979222.579op/s 0.47% -1.270 1.218 0.55% 4985.149op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 70.633µs 70.881µs ± 0.299µs 70.737µs ± 0.071µs 70.955µs 71.502µs 72.214µs 72.296µs 2.20% 2.186 5.613 0.42% 0.021µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 13832006.262op/s 14108499.822op/s ± 59009.715op/s 14136894.470op/s ± 14245.628op/s 14145646.233op/s 14153410.939op/s 14156951.647op/s 14157601.618op/s 0.15% -2.151 5.388 0.42% 4172.617op/s 1 200
credit_card/is_card_number/37828224631 execution_time 3.890µs 3.912µs ± 0.003µs 3.912µs ± 0.001µs 3.913µs 3.917µs 3.922µs 3.928µs 0.43% -0.379 15.689 0.08% 0.000µs 1 200
credit_card/is_card_number/37828224631 throughput 254558508.735op/s 255625113.792op/s ± 200275.714op/s 255651093.946op/s ± 93742.690op/s 255734696.805op/s 255823900.648op/s 255871207.263op/s 257043101.615op/s 0.54% 0.421 15.857 0.08% 14161.632op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 67.613µs 67.820µs ± 0.276µs 67.698µs ± 0.044µs 67.906µs 68.417µs 68.686µs 69.507µs 2.67% 2.608 8.721 0.41% 0.019µs 1 200
credit_card/is_card_number/378282246310005 throughput 14387035.959op/s 14745182.147op/s ± 59305.280op/s 14771491.022op/s ± 9702.377op/s 14778954.768op/s 14785272.169op/s 14788448.817op/s 14790139.414op/s 0.13% -2.562 8.328 0.40% 4193.517op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 44.830µs 45.195µs ± 0.146µs 45.207µs ± 0.100µs 45.303µs 45.407µs 45.478µs 45.514µs 0.68% -0.277 -0.528 0.32% 0.010µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 21971172.436op/s 22126710.893op/s ± 71782.871op/s 22120385.415op/s ± 48712.324op/s 22172230.392op/s 22255909.516op/s 22281908.143op/s 22306737.740op/s 0.84% 0.291 -0.520 0.32% 5075.815op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 6.028µs 6.036µs ± 0.004µs 6.035µs ± 0.003µs 6.039µs 6.043µs 6.049µs 6.049µs 0.23% 0.853 0.570 0.07% 0.000µs 1 200
credit_card/is_card_number/x371413321323331 throughput 165319434.661op/s 165680647.532op/s ± 112325.433op/s 165703148.367op/s ± 71533.127op/s 165764150.730op/s 165821014.526op/s 165854137.550op/s 165885061.374op/s 0.11% -0.849 0.560 0.07% 7942.608op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 3.893µs 3.912µs ± 0.003µs 3.913µs ± 0.002µs 3.914µs 3.916µs 3.918µs 3.920µs 0.19% -1.417 10.271 0.07% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 255094634.922op/s 255596919.968op/s ± 179353.002op/s 255590338.965op/s ± 124601.047op/s 255719230.086op/s 255822690.006op/s 255899474.161op/s 256846511.458op/s 0.49% 1.438 10.440 0.07% 12682.172op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 65.503µs 65.722µs ± 0.078µs 65.727µs ± 0.055µs 65.778µs 65.835µs 65.866µs 65.883µs 0.24% -0.390 -0.208 0.12% 0.006µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 15178419.343op/s 15215627.869op/s ± 18045.422op/s 15214444.614op/s ± 12817.042op/s 15227304.847op/s 15249994.583op/s 15260182.498op/s 15266401.703op/s 0.34% 0.396 -0.200 0.12% 1276.004op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 52.954µs 53.014µs ± 0.032µs 53.007µs ± 0.021µs 53.032µs 53.077µs 53.098µs 53.100µs 0.17% 0.765 0.207 0.06% 0.002µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 18832519.317op/s 18863084.382op/s ± 11217.710op/s 18865279.397op/s ± 7321.354op/s 18871311.361op/s 18877622.938op/s 18883027.180op/s 18884173.174op/s 0.10% -0.762 0.202 0.06% 793.212op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 3.894µs 3.912µs ± 0.003µs 3.911µs ± 0.002µs 3.913µs 3.916µs 3.920µs 3.920µs 0.22% -0.807 9.612 0.07% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 255087681.900op/s 255634003.553op/s ± 177624.618op/s 255657842.616op/s ± 100686.771op/s 255750733.088op/s 255834270.009op/s 255888633.181op/s 256826190.966op/s 0.46% 0.830 9.756 0.07% 12559.957op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 49.745µs 49.836µs ± 0.042µs 49.838µs ± 0.032µs 49.867µs 49.902µs 49.925µs 49.935µs 0.20% -0.006 -0.759 0.08% 0.003µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 20025852.279op/s 20065910.344op/s ± 16988.602op/s 20065014.641op/s ± 12816.075op/s 20080023.389op/s 20093496.238op/s 20098323.398op/s 20102605.298op/s 0.19% 0.009 -0.760 0.08% 1201.276op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 44.755µs 45.219µs ± 0.160µs 45.221µs ± 0.113µs 45.336µs 45.455µs 45.543µs 45.555µs 0.74% -0.278 -0.210 0.35% 0.011µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 21951697.761op/s 22114991.670op/s ± 78149.323op/s 22113586.737op/s ± 55506.237op/s 22167867.682op/s 22257887.424op/s 22307788.138op/s 22343658.553op/s 1.04% 0.296 -0.190 0.35% 5525.992op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 6.028µs 6.035µs ± 0.007µs 6.034µs ± 0.002µs 6.036µs 6.040µs 6.052µs 6.102µs 1.14% 7.306 62.357 0.12% 0.001µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 163871327.087op/s 165705989.532op/s ± 201648.326op/s 165738907.210op/s ± 45481.313op/s 165779955.673op/s 165837869.314op/s 165870307.672op/s 165890840.823op/s 0.09% -7.266 61.862 0.12% 14258.690op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
credit_card/is_card_number/ execution_time [3.912µs; 3.913µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/ throughput [255573966.828op/s; 255629119.882op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [77.463µs; 77.581µs] or [-0.076%; +0.076%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [12890138.631op/s; 12909680.058op/s] or [-0.076%; +0.076%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [70.839µs; 70.922µs] or [-0.058%; +0.058%] None None None
credit_card/is_card_number/ 378282246310005 throughput [14100321.643op/s; 14116678.001op/s] or [-0.058%; +0.058%] None None None
credit_card/is_card_number/37828224631 execution_time [3.912µs; 3.912µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/37828224631 throughput [255597357.504op/s; 255652870.079op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/378282246310005 execution_time [67.782µs; 67.858µs] or [-0.056%; +0.056%] None None None
credit_card/is_card_number/378282246310005 throughput [14736963.005op/s; 14753401.288op/s] or [-0.056%; +0.056%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [45.174µs; 45.215µs] or [-0.045%; +0.045%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [22116762.477op/s; 22136659.308op/s] or [-0.045%; +0.045%] None None None
credit_card/is_card_number/x371413321323331 execution_time [6.035µs; 6.036µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/x371413321323331 throughput [165665080.307op/s; 165696214.756op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/ execution_time [3.912µs; 3.913µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/ throughput [255572063.367op/s; 255621776.570op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [65.711µs; 65.733µs] or [-0.016%; +0.016%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [15213126.947op/s; 15218128.791op/s] or [-0.016%; +0.016%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [53.009µs; 53.018µs] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [18861529.716op/s; 18864639.049op/s] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/37828224631 execution_time [3.911µs; 3.912µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/37828224631 throughput [255609386.490op/s; 255658620.617op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [49.830µs; 49.842µs] or [-0.012%; +0.012%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [20063555.888op/s; 20068264.801op/s] or [-0.012%; +0.012%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [45.197µs; 45.241µs] or [-0.049%; +0.049%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [22104160.925op/s; 22125822.414op/s] or [-0.049%; +0.049%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [6.034µs; 6.036µs] or [-0.017%; +0.017%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [165678043.013op/s; 165733936.050op/s] or [-0.017%; +0.017%] None None None

Group 19

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz efdaa7e 1770413220 ekump/clippy-annotation-action
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_trace/test_trace execution_time 242.994ns 253.717ns ± 13.887ns 246.281ns ± 2.626ns 259.545ns 285.723ns 287.920ns 290.855ns 18.10% 1.378 0.470 5.46% 0.982ns 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
normalization/normalize_trace/test_trace execution_time [251.793ns; 255.642ns] or [-0.759%; +0.759%] None None None

Baseline

Omitted due to size.

@codecov-commenter
Copy link

codecov-commenter commented May 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.17%. Comparing base (a3f9e86) to head (c650eff).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1049      +/-   ##
==========================================
- Coverage   71.19%   71.17%   -0.02%     
==========================================
  Files         392      392              
  Lines       62677    62677              
==========================================
- Hits        44622    44613       -9     
- Misses      18055    18064       +9     
Components Coverage Δ
libdd-crashtracker 59.90% <ø> (ø)
libdd-crashtracker-ffi 15.31% <ø> (ø)
libdd-alloc 98.73% <ø> (ø)
libdd-data-pipeline 86.02% <ø> (ø)
libdd-data-pipeline-ffi 77.63% <ø> (ø)
libdd-common 80.93% <ø> (ø)
libdd-common-ffi 73.90% <ø> (ø)
libdd-telemetry 60.02% <ø> (ø)
libdd-telemetry-ffi 21.24% <ø> (ø)
libdd-dogstatsd-client 83.75% <ø> (ø)
datadog-ipc 82.71% <ø> (+0.10%) ⬆️
libdd-profiling 79.68% <ø> (ø)
libdd-profiling-ffi 62.13% <ø> (ø)
datadog-sidecar 36.98% <ø> (ø)
datdog-sidecar-ffi 16.40% <ø> (ø)
spawn-worker 55.18% <ø> (ø)
libdd-tinybytes 92.44% <ø> (ø)
libdd-trace-normalization 98.24% <ø> (ø)
datadog-trace-obfuscation 94.17% <ø> (ø)
libdd-trace-protobuf 59.65% <ø> (ø)
libdd-trace-utils 90.25% <ø> (ø)
datadog-tracer-flare 62.06% <ø> (ø)
libdd-log 75.57% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@r1viollet
Copy link
Contributor

r1viollet commented May 2, 2025

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 8.38 MB 8.38 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 91.69 MB 91.69 MB 0% (0 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 106.40 MB 106.40 MB 0% (0 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.76 MB 10.76 MB 0% (0 B) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 25.08 MB 25.08 MB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 75.94 KB 75.94 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 172.51 MB 172.53 MB +.01% (+24.00 KB) 🔍
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 882.83 MB 882.83 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 9.57 MB 9.57 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 75.94 KB 75.94 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 23.04 MB 23.04 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 48.45 MB 48.45 MB 0% (0 B) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 21.22 MB 21.22 MB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 77.12 KB 77.12 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 176.66 MB 176.63 MB --.01% (-32.00 KB) 💪
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 866.92 MB 866.92 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 7.24 MB 7.24 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 77.12 KB 77.12 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 24.62 MB 24.62 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 44.15 MB 44.15 MB 0% (0 B) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 80.18 MB 80.18 MB 0% (0 B) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 9.88 MB 9.88 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 100.31 MB 100.31 MB 0% (0 B) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.44 MB 11.44 MB 0% (0 B) 👌

@ekump ekump force-pushed the ekump/clippy-annotation-action branch from 4dae85a to a1c1a9d Compare May 2, 2025 17:05
@DataDog DataDog deleted a comment from github-actions bot May 2, 2025
@ekump ekump force-pushed the ekump/clippy-annotation-action branch from 4db63c3 to c0d22c4 Compare May 2, 2025 19:07
@DataDog DataDog deleted a comment from github-actions bot May 2, 2025
@DataDog DataDog deleted a comment from github-actions bot May 2, 2025
@DataDog DataDog deleted a comment from github-actions bot May 2, 2025
@DataDog DataDog deleted a comment from github-actions bot May 2, 2025
@DataDog DataDog deleted a comment from github-actions bot May 2, 2025
@DataDog DataDog deleted a comment from github-actions bot May 2, 2025
@DataDog DataDog deleted a comment from github-actions bot May 2, 2025
@DataDog DataDog deleted a comment from github-actions bot May 2, 2025
@DataDog DataDog deleted a comment from github-actions bot May 2, 2025
@github-actions
Copy link

github-actions bot commented May 2, 2025

Clippy Allow Annotation Report

Comparing clippy allow annotations between branches:

  • Base Branch: origin/main
  • PR Branch: origin/ekump/clippy-annotation-action

Summary by Rule

Rule Base Branch PR Branch Change
unwrap_used 0 5 ⚠️ +5 (N/A)
Total 0 5 ⚠️ +5 (N/A)

Annotation Counts by File

File Base Branch PR Branch Change
.github/actions/clippy-annotation-reporter/src/analyzer/annotation.rs 0 5 ⚠️ +5 (N/A)

Annotation Stats by Crate

Crate Base Branch PR Branch Change
clippy-annotation-reporter 0 5 ⚠️ +5 (N/A)
datadog-ffe-ffi 1 1 No change (0%)
datadog-ipc 27 27 No change (0%)
datadog-live-debugger 6 6 No change (0%)
datadog-live-debugger-ffi 10 10 No change (0%)
datadog-profiling-replayer 4 4 No change (0%)
datadog-remote-config 3 3 No change (0%)
datadog-sidecar 59 59 No change (0%)
libdd-common 10 10 No change (0%)
libdd-common-ffi 12 12 No change (0%)
libdd-crashtracker 12 12 No change (0%)
libdd-data-pipeline 6 6 No change (0%)
libdd-ddsketch 2 2 No change (0%)
libdd-dogstatsd-client 1 1 No change (0%)
libdd-profiling 13 13 No change (0%)
libdd-telemetry 19 19 No change (0%)
libdd-tinybytes 4 4 No change (0%)
libdd-trace-normalization 2 2 No change (0%)
libdd-trace-obfuscation 9 9 No change (0%)
libdd-trace-utils 15 15 No change (0%)
Total 215 220 ⚠️ +5 (+2.3%)

About This Report

This report tracks Clippy allow annotations for specific rules, showing how they've changed in this PR. Decreasing the number of these annotations generally improves code quality.

@DataDog DataDog deleted a comment from github-actions bot May 2, 2025
@ekump ekump force-pushed the ekump/clippy-annotation-action branch 6 times, most recently from 196838e to 78c37d6 Compare May 8, 2025 13:02
@ekump ekump force-pushed the ekump/clippy-annotation-action branch from 92c3830 to 145fb3f Compare May 9, 2025 20:35
@ekump ekump force-pushed the ekump/clippy-annotation-action branch 4 times, most recently from f56f485 to 3242198 Compare June 1, 2025 02:23
@ekump ekump force-pushed the ekump/clippy-annotation-action branch 2 times, most recently from a0b7788 to 9a877f9 Compare June 1, 2025 02:53
@ekump ekump marked this pull request as ready for review June 1, 2025 03:06
@ekump ekump requested review from a team as code owners June 1, 2025 03:06
@ekump ekump changed the title wip: init commit of clippy annotation reporter clippy annotation reporter Jun 1, 2025
shell: bash
run: |
cd ${{ github.action_path }}
cargo build --release
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure how this is usually done, but should we cache the binary as it probably won't change very often.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The build time relative to the rest of CI is very short. I don't think it's an issue in the short-term. Once we move this to a separate repo the action should be pre-built.


let rule_pattern = rules.join("|");
let regex = Regex::new(&format!(
r"#\s*\[\s*allow\s*\(\s*clippy\s*::\s*({})\s*\)\s*\]",
Copy link
Contributor

Choose a reason for hiding this comment

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

It could be useful to allow non-clippy lints for things like "missing_docs". WDYT ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

100% agree, the missing docs one would be quite useful. I think we can do it in a follow-up PR. There are probably a handful of features we'll want to add.

annotations: &[ClippyAnnotation],
) -> HashMap<Rc<String>, usize> {
let mut counts = HashMap::new();
let mut crate_cache: HashMap<String, Rc<String>> = HashMap::new();
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be to naive to assume all files in sub directory of the same cargo.toml are in the same crate (may be wrong in workspace though) ? Are at least cache based on directory. This could reduce the number of calls to get_crate_for_file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You can have crates within crates, even when the parent isn't a workspace. And as you mentioned we'd need extra logic to handle the top level workspace cargo.

I think this implementation is a good starting point (at least for libdatadog), but we likely will want to evolve the logic for matching files to crates. Ideally, it would be nice if we could leverage cargo metadata more for this rather than file paths.

After compilation, the reporter takes just a couple of seconds to run for all of libdatadog (including time communicating with GitHub). I think we'd be ok adding better caching later.

Copy link
Contributor

@VianneyRuhlmann VianneyRuhlmann left a comment

Choose a reason for hiding this comment

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

LGTM

@ekump ekump force-pushed the ekump/clippy-annotation-action branch from 9a877f9 to 0a96a8f Compare July 24, 2025 19:13
@datadog-datadog-prod-us1
Copy link
Contributor

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

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

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

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. To override this behavior, add the keep-open label or update the PR.

@github-actions github-actions bot added the stale Used by actions/stale to identify PRs that have been inactive for 90+ days label Oct 23, 2025
@ekump ekump added keep-open Overrides actions/stale auto-closing stale PRs and removed stale Used by actions/stale to identify PRs that have been inactive for 90+ days labels Oct 23, 2025
@ekump ekump force-pushed the ekump/clippy-annotation-action branch from 0a96a8f to c650eff Compare November 19, 2025 20:42
ekump added 5 commits February 6, 2026 16:21
This is not part of the libdatadog workspace. It's a github action that
will run for CI. It reports counts of clippy allow annotations for both
changed files in the PR and a repo overall. The goal is to call
attention to excessive usage of allows, which could be a signal of
reduced code quality. This action should be moved to its own repo when
confident of its functionality.
reviews the files in the repo to parse and count the allow annotations
usage. It also compares changed files to their base to determine the
diffs of counts.
combines env vars and CLI args to get relevant info about the PR being
analyzed.
finished report and comments it on the PR. it checks for existing
comments and updates them instead of repeatedly posting a new comment
for every PR change.
data from the analyzer and generates the text of the report that will be
posted on the PR.
@ekump ekump force-pushed the ekump/clippy-annotation-action branch from c650eff to 064d846 Compare February 6, 2026 21:21
@ekump ekump requested a review from a team as a code owner February 6, 2026 21:21
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

📚 Documentation Check Results

No documentation warnings found!

📦 clippy-annotation-reporter - ✅ No warnings


Updated: 2026-02-06 21:27:35 UTC | Commit: 464b6fe | missing-docs job results

@ekump ekump changed the title clippy annotation reporter ci: clippy annotation reporter to comment on PRs with changes in usage of panic allow annotations Feb 6, 2026
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

🔒 Cargo Deny Results

⚠️ 3 issue(s) found, showing only errors (advisories, bans, sources)

📦 clippy-annotation-reporter - 3 error(s)

Show output
error[vulnerability]: Integer overflow in `BytesMut::reserve`
   ┌─ /home/runner/work/libdatadog/libdatadog/.github/actions/clippy-annotation-reporter/Cargo.lock:39:1
   │
39 │ bytes 1.10.1 registry+https://github.com/rust-lang/crates.io-index
   │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ security vulnerability detected
   │
   ├ ID: RUSTSEC-2026-0007
   ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2026-0007
   ├ In the unique reclaim path of `BytesMut::reserve`, the condition
     ```rs
     if v_capacity >= new_cap + offset
     ```
     uses an unchecked addition. When `new_cap + offset` overflows `usize` in release builds, this condition may incorrectly pass, causing `self.cap` to be set to a value that exceeds the actual allocated capacity. Subsequent APIs such as `spare_capacity_mut()` then trust this corrupted `cap` value and may create out-of-bounds slices, leading to UB.
     
     This behavior is observable in release builds (integer overflow wraps), whereas debug builds panic due to overflow checks.
     
     ## PoC
     
     ```rs
     use bytes::*;
     
     fn main() {
         let mut a = BytesMut::from(&b"hello world"[..]);
         let mut b = a.split_off(5);
     
         // Ensure b becomes the unique owner of the backing storage
         drop(a);
     
         // Trigger overflow in new_cap + offset inside reserve
         b.reserve(usize::MAX - 6);
     
         // This call relies on the corrupted cap and may cause UB & HBO
         b.put_u8(b'h');
     }
     ```
     
     # Workarounds
     
     Users of `BytesMut::reserve` are only affected if integer overflow checks are configured to wrap. When integer overflow is configured to panic, this issue does not apply.
   ├ Announcement: https://github.com/advisories/GHSA-434x-w66g-qw3r
   ├ Solution: Upgrade to >=1.11.1 (try `cargo update -p bytes`)
   ├ bytes v1.10.1
     ├── http v0.2.12
     │   ├── http-body v0.4.6
     │   │   └── hyper v0.14.32
     │   │       └── httpmock v0.6.8
     │   │           └── (dev) clippy-annotation-reporter v0.1.0
     │   ├── hyper v0.14.32 (*)
     │   └── isahc v1.7.2
     │       └── httpmock v0.6.8 (*)
     ├── http v1.3.1
     │   ├── (dev) clippy-annotation-reporter v0.1.0 (*)
     │   ├── http-body v1.0.1
     │   │   ├── http-body-util v0.1.3
     │   │   │   └── octocrab v0.44.1
     │   │   │       └── clippy-annotation-reporter v0.1.0 (*)
     │   │   ├── hyper v1.6.0
     │   │   │   ├── hyper-rustls v0.27.6
     │   │   │   │   └── octocrab v0.44.1 (*)
     │   │   │   ├── hyper-timeout v0.5.2
     │   │   │   │   └── octocrab v0.44.1 (*)
     │   │   │   ├── hyper-util v0.1.13
     │   │   │   │   ├── hyper-rustls v0.27.6 (*)
     │   │   │   │   ├── hyper-timeout v0.5.2 (*)
     │   │   │   │   └── octocrab v0.44.1 (*)
     │   │   │   └── octocrab v0.44.1 (*)
     │   │   ├── hyper-util v0.1.13 (*)
     │   │   ├── octocrab v0.44.1 (*)
     │   │   └── tower-http v0.6.4
     │   │       └── octocrab v0.44.1 (*)
     │   ├── http-body-util v0.1.3 (*)
     │   ├── hyper v1.6.0 (*)
     │   ├── hyper-rustls v0.27.6 (*)
     │   ├── hyper-util v0.1.13 (*)
     │   ├── octocrab v0.44.1 (*)
     │   └── tower-http v0.6.4 (*)
     ├── http-body v0.4.6 (*)
     ├── http-body v1.0.1 (*)
     ├── http-body-util v0.1.3 (*)
     ├── hyper v0.14.32 (*)
     ├── hyper v1.6.0 (*)
     ├── hyper-util v0.1.13 (*)
     ├── octocrab v0.44.1 (*)
     ├── tokio-util v0.7.15
     │   └── tower v0.5.2
     │       ├── octocrab v0.44.1 (*)
     │       └── tower-http v0.6.4 (*)
     └── tower-http v0.6.4 (*)

error[vulnerability]: `idna` accepts Punycode labels that do not produce any non-ASCII when decoded
    ┌─ /home/runner/work/libdatadog/libdatadog/.github/actions/clippy-annotation-reporter/Cargo.lock:110:1
    │
110 │ idna 0.5.0 registry+https://github.com/rust-lang/crates.io-index
    │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ security vulnerability detected
    │
    ├ ID: RUSTSEC-2024-0421
    ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2024-0421
    ├ `idna` 0.5.0 and earlier accepts Punycode labels that do not produce any non-ASCII output, which means that either ASCII labels or the empty root label can be masked such that they appear unequal without IDNA processing or when processed with a different implementation and equal when processed with `idna` 0.5.0 or earlier.
      
      Concretely, `example.org` and `xn--example-.org` become equal after processing by `idna` 0.5.0 or earlier. Also, `example.org.xn--` and `example.org.` become equal after processing by `idna` 0.5.0 or earlier.
      
      In applications using `idna` (but not in `idna` itself) this may be able to lead to privilege escalation when host name comparison is part of a privilege check and the behavior is combined with a client that resolves domains with such labels instead of treating them as errors that preclude DNS resolution / URL fetching and with the attacker managing to introduce a DNS entry (and TLS certificate) for an `xn--`-masked name that turns into the name of the target when processed by `idna` 0.5.0 or earlier.
      
      ## Remedy
      
      Upgrade to `idna` 1.0.3 or later, if depending on `idna` directly, or to `url` 2.5.4 or later, if depending on `idna` via `url`. (This issue was fixed in `idna` 1.0.0, but versions earlier than 1.0.3 are not recommended for other reasons.)
      
      When upgrading, please take a moment to read about [alternative Unicode back ends for `idna`](https://docs.rs/crate/idna_adapter/latest).
      
      If you are using Rust earlier than 1.81 in combination with SQLx 0.8.2 or earlier, please also read an [issue](https://github.com/servo/rust-url/issues/992) about combining them with `url` 2.5.4 and `idna` 1.0.3.
      
      ## Additional information
      
      This issue resulted from `idna` 0.5.0 and earlier implementing the UTS 46 specification literally on this point and the specification having this bug. The specification bug has been fixed in [revision 33 of UTS 46](https://www.unicode.org/reports/tr46/tr46-33.html#Modifications).
      
      ## Acknowledgements
      
      Thanks to kageshiron for recognizing the security implications of this behavior.
    ├ Announcement: https://bugzilla.mozilla.org/show_bug.cgi?id=1887898
    ├ Solution: Upgrade to >=1.0.0 (try `cargo update -p idna`)
    ├ idna v0.5.0
      └── url v2.5.2
          ├── clippy-annotation-reporter v0.1.0
          ├── httpmock v0.6.8
          │   └── (dev) clippy-annotation-reporter v0.1.0 (*)
          ├── isahc v1.7.2
          │   └── httpmock v0.6.8 (*)
          └── octocrab v0.44.1
              └── clippy-annotation-reporter v0.1.0 (*)

error[vulnerability]: Denial of Service via Stack Exhaustion
    ┌─ /home/runner/work/libdatadog/libdatadog/.github/actions/clippy-annotation-reporter/Cargo.lock:225:1
    │
225 │ time 0.3.41 registry+https://github.com/rust-lang/crates.io-index
    │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ security vulnerability detected
    │
    ├ ID: RUSTSEC-2026-0009
    ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2026-0009
    ├ ## Impact
      
      When user-provided input is provided to any type that parses with the RFC 2822 format, a denial of
      service attack via stack exhaustion is possible. The attack relies on formally deprecated and
      rarely-used features that are part of the RFC 2822 format used in a malicious manner. Ordinary,
      non-malicious input will never encounter this scenario.
      
      ## Patches
      
      A limit to the depth of recursion was added in v0.3.47. From this version, an error will be returned
      rather than exhausting the stack.
      
      ## Workarounds
      
      Limiting the length of user input is the simplest way to avoid stack exhaustion, as the amount of
      the stack consumed would be at most a factor of the length of the input.
    ├ Announcement: https://github.com/time-rs/time/blob/main/CHANGELOG.md#0347-2026-02-05
    ├ Solution: Upgrade to >=0.3.47 (try `cargo update -p time`)
    ├ time v0.3.41
      └── simple_asn1 v0.6.3
          └── jsonwebtoken v9.3.1
              └── octocrab v0.44.1
                  └── clippy-annotation-reporter v0.1.0

advisories FAILED, bans ok, sources ok

Updated: 2026-02-06 21:27:37 UTC | Commit: 464b6fe | dependency-check job results

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

Labels

ci-build keep-open Overrides actions/stale auto-closing stale PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants