Skip to content

clippy annotation reporter #1049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

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: 2025-06-01 03:04:12

Comparing candidate commit 9a877f9 in PR branch ekump/clippy-annotation-action with baseline commit 8d26d4b in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 52 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 9a877f9 1748746363 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.420µs 2.455µs ± 0.029µs 2.453µs ± 0.018µs 2.467µs 2.496µs 2.620µs 2.625µs 7.02% 2.849 13.443 1.20% 0.002µ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.451µs; 2.459µs] or [-0.166%; +0.166%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 9a877f9 1748746363 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 147.588µs 148.555µs ± 0.406µs 148.452µs ± 0.178µs 148.753µs 149.273µs 150.143µs 150.839µs 1.61% 2.041 7.573 0.27% 0.029µ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 [148.499µs; 148.611µs] or [-0.038%; +0.038%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 9a877f9 1748746363 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 214.587µs 215.442µs ± 0.190µs 215.417µs ± 0.108µs 215.548µs 215.772µs 215.894µs 216.146µs 0.34% 0.112 2.266 0.09% 0.013µs 1 200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput 4626511.375op/s 4641617.736op/s ± 4082.662op/s 4642157.066op/s ± 2321.037op/s 4644303.742op/s 4647061.670op/s 4649432.641op/s 4660106.703op/s 0.39% -0.101 2.285 0.09% 288.688op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 19.633µs 19.776µs ± 0.041µs 19.779µs ± 0.024µs 19.803µs 19.835µs 19.859µs 19.936µs 0.79% -0.392 1.934 0.21% 0.003µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 50161158.800op/s 50567092.749op/s ± 104263.275op/s 50559438.026op/s ± 60785.413op/s 50620835.377op/s 50749305.914op/s 50851000.105op/s 50934074.330op/s 0.74% 0.415 1.936 0.21% 7372.527op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 11.764µs 12.089µs ± 0.064µs 12.110µs ± 0.029µs 12.131µs 12.147µs 12.169µs 12.188µs 0.65% -2.131 5.930 0.53% 0.005µs 1 200
normalization/normalize_name/normalize_name/good throughput 82046758.961op/s 82720616.560op/s ± 446250.731op/s 82576196.710op/s ± 196209.198op/s 82834680.447op/s 83557195.965op/s 84408741.082op/s 85007810.093op/s 2.94% 2.186 6.258 0.54% 31554.692op/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 [215.416µs; 215.469µs] or [-0.012%; +0.012%] None None None
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput [4641051.918op/s; 4642183.554op/s] or [-0.012%; +0.012%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [19.770µs; 19.781µs] or [-0.029%; +0.029%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [50552642.862op/s; 50581542.636op/s] or [-0.029%; +0.029%] None None None
normalization/normalize_name/normalize_name/good execution_time [12.080µs; 12.098µs] or [-0.074%; +0.074%] None None None
normalization/normalize_name/normalize_name/good throughput [82658770.501op/s; 82782462.620op/s] or [-0.075%; +0.075%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 9a877f9 1748746363 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 65.414µs 65.601µs ± 0.315µs 65.566µs ± 0.048µs 65.625µs 65.750µs 65.924µs 69.830µs 6.50% 12.240 161.524 0.48% 0.022µ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 [65.557µs; 65.645µs] or [-0.067%; +0.067%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 9a877f9 1748746363 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.191µs 3.199µs ± 1.446µs 2.997µs ± 0.029µs 3.029µs 3.680µs 14.012µs 15.045µs 401.99% 7.403 55.752 45.09% 0.102µ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.999µs; 3.399µs] or [-6.264%; +6.264%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 9a877f9 1748746363 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 533.152µs 535.260µs ± 2.598µs 534.022µs ± 0.399µs 536.443µs 539.341µs 542.850µs 549.923µs 2.98% 2.238 6.613 0.48% 0.184µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 1818436.205op/s 1868295.453op/s ± 8973.641op/s 1872583.679op/s ± 1400.167op/s 1873632.421op/s 1874691.124op/s 1875211.782op/s 1875637.303op/s 0.16% -2.187 6.215 0.48% 634.532op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 450.000µs 450.618µs ± 0.398µs 450.569µs ± 0.175µs 450.779µs 451.098µs 451.504µs 454.508µs 0.87% 4.780 43.727 0.09% 0.028µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2200182.505op/s 2219174.630op/s ± 1954.104op/s 2219414.047op/s ± 861.392op/s 2220124.020op/s 2221484.689op/s 2222126.663op/s 2222220.741op/s 0.13% -4.720 42.953 0.09% 138.176op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 184.509µs 185.237µs ± 0.317µs 185.290µs ± 0.212µs 185.476µs 185.707µs 185.887µs 186.132µs 0.45% -0.159 -0.516 0.17% 0.022µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5372529.879op/s 5398514.397op/s ± 9230.531op/s 5396958.072op/s ± 6177.651op/s 5404901.070op/s 5413555.339op/s 5418736.838op/s 5419801.570op/s 0.42% 0.167 -0.519 0.17% 652.697op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 39.718µs 39.861µs ± 0.061µs 39.858µs ± 0.037µs 39.898µs 39.971µs 40.023µs 40.039µs 0.45% 0.311 0.212 0.15% 0.004µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 24975500.910op/s 25087044.926op/s ± 38103.249op/s 25088858.792op/s ± 23189.210op/s 25111195.061op/s 25150157.892op/s 25163367.602op/s 25177204.588op/s 0.35% -0.302 0.202 0.15% 2694.307op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 45.333µs 45.476µs ± 0.075µs 45.474µs ± 0.045µs 45.519µs 45.565µs 45.592µs 46.129µs 1.44% 3.464 27.710 0.16% 0.005µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 21678373.390op/s 21989619.024op/s ± 35983.900op/s 21990665.941op/s ± 21785.769op/s 22012391.142op/s 22034727.367op/s 22046703.138op/s 22058823.529op/s 0.31% -3.378 26.754 0.16% 2544.446op/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 [534.900µs; 535.620µs] or [-0.067%; +0.067%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [1867051.793op/s; 1869539.114op/s] or [-0.067%; +0.067%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [450.563µs; 450.674µs] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2218903.810op/s; 2219445.450op/s] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [185.193µs; 185.281µs] or [-0.024%; +0.024%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5397235.134op/s; 5399793.660op/s] or [-0.024%; +0.024%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [39.853µs; 39.870µs] or [-0.021%; +0.021%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [25081764.182op/s; 25092325.670op/s] or [-0.021%; +0.021%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [45.466µs; 45.486µs] or [-0.023%; +0.023%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [21984632.002op/s; 21994606.047op/s] or [-0.023%; +0.023%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 9a877f9 1748746363 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.790µs 25.372µs ± 10.642µs 18.162µs ± 0.243µs 33.977µs 44.287µs 54.601µs 91.455µs 403.56% 2.029 7.390 41.84% 0.753µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
two way interface execution_time [23.897µs; 26.847µs] or [-5.813%; +5.813%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 9a877f9 1748746363 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 5.918ms 5.929ms ± 0.006ms 5.928ms ± 0.003ms 5.931ms 5.939ms 5.944ms 5.963ms 0.59% 1.533 5.947 0.10% 0.000ms 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 [5.928ms; 5.930ms] or [-0.013%; +0.013%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 9a877f9 1748746363 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 72.673ms 73.116ms ± 0.271ms 73.090ms ± 0.137ms 73.210ms 73.554ms 74.120ms 74.697ms 2.20% 2.122 8.246 0.37% 0.019ms 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 [73.078ms; 73.153ms] or [-0.051%; +0.051%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 9a877f9 1748746363 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 4.968µs 5.022µs ± 0.042µs 5.019µs ± 0.034µs 5.056µs 5.090µs 5.092µs 5.097µs 1.56% 0.454 -1.266 0.84% 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.017µs; 5.028µs] or [-0.116%; +0.116%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 9a877f9 1748746363 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.891µs 3.911µs ± 0.003µs 3.911µs ± 0.002µs 3.912µs 3.917µs 3.920µs 3.923µs 0.31% -0.394 10.017 0.08% 0.000µs 1 200
credit_card/is_card_number/ throughput 254916383.340op/s 255686517.635op/s ± 197546.076op/s 255703753.108op/s ± 104215.310op/s 255808665.523op/s 255898711.659op/s 255982294.720op/s 256982272.644op/s 0.50% 0.421 10.152 0.08% 13968.617op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 81.830µs 83.053µs ± 0.583µs 83.091µs ± 0.406µs 83.447µs 83.999µs 84.279µs 84.935µs 2.22% 0.083 -0.316 0.70% 0.041µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 11773704.725op/s 12041116.268op/s ± 84481.232op/s 12034973.845op/s ± 58831.702op/s 12098450.793op/s 12183681.985op/s 12206217.519op/s 12220400.272op/s 1.54% -0.048 -0.351 0.70% 5973.725op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 79.222µs 80.321µs ± 0.247µs 80.351µs ± 0.164µs 80.512µs 80.638µs 80.664µs 80.773µs 0.53% -1.095 2.310 0.31% 0.017µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 12380361.142op/s 12450115.096op/s ± 38483.251op/s 12445430.526op/s ± 25380.863op/s 12472713.148op/s 12512643.990op/s 12551367.400op/s 12622809.842op/s 1.43% 1.124 2.443 0.31% 2721.177op/s 1 200
credit_card/is_card_number/37828224631 execution_time 3.892µs 3.911µs ± 0.003µs 3.911µs ± 0.001µs 3.913µs 3.917µs 3.920µs 3.922µs 0.28% -0.203 6.789 0.08% 0.000µs 1 200
credit_card/is_card_number/37828224631 throughput 254995803.589op/s 255679005.920op/s ± 207995.543op/s 255716468.141op/s ± 94966.183op/s 255803235.791op/s 255902828.585op/s 256035839.187op/s 256940870.239op/s 0.48% 0.224 6.893 0.08% 14707.506op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 75.903µs 77.005µs ± 0.306µs 77.030µs ± 0.171µs 77.189µs 77.459µs 77.554µs 77.627µs 0.78% -0.802 1.362 0.40% 0.022µs 1 200
credit_card/is_card_number/378282246310005 throughput 12882090.228op/s 12986398.844op/s ± 51795.986op/s 12982028.330op/s ± 28795.232op/s 13013120.237op/s 13071751.320op/s 13153798.593op/s 13174671.107op/s 1.48% 0.835 1.449 0.40% 3662.529op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 51.336µs 51.392µs ± 0.030µs 51.388µs ± 0.016µs 51.403µs 51.452µs 51.494µs 51.504µs 0.23% 1.185 1.730 0.06% 0.002µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 19415865.231op/s 19458204.701op/s ± 11450.554op/s 19459766.932op/s ± 6217.184op/s 19466015.743op/s 19472429.377op/s 19475336.474op/s 19479464.748op/s 0.10% -1.181 1.717 0.06% 809.676op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 6.027µs 6.033µs ± 0.003µs 6.033µs ± 0.002µs 6.035µs 6.040µs 6.042µs 6.043µs 0.17% 0.783 0.540 0.05% 0.000µs 1 200
credit_card/is_card_number/x371413321323331 throughput 165478640.480op/s 165746680.735op/s ± 87136.661op/s 165761609.611op/s ± 46708.932op/s 165801318.121op/s 165875343.899op/s 165908835.533op/s 165922849.278op/s 0.10% -0.780 0.535 0.05% 6161.492op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 3.894µs 3.911µs ± 0.003µs 3.911µs ± 0.002µs 3.912µs 3.916µs 3.918µs 3.920µs 0.22% -0.740 8.933 0.07% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 255119010.824op/s 255679262.214op/s ± 174392.554op/s 255692110.717op/s ± 100034.871op/s 255789455.080op/s 255883325.853op/s 255935846.701op/s 256829217.406op/s 0.44% 0.761 9.062 0.07% 12331.416op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 65.831µs 66.147µs ± 0.139µs 66.124µs ± 0.077µs 66.225µs 66.398µs 66.510µs 66.896µs 1.17% 1.379 4.586 0.21% 0.010µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 14948471.047op/s 15117988.867op/s ± 31648.495op/s 15123083.995op/s ± 17729.053op/s 15136736.014op/s 15159779.138op/s 15169385.084op/s 15190518.079op/s 0.45% -1.350 4.432 0.21% 2237.887op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 59.416µs 59.644µs ± 0.103µs 59.649µs ± 0.083µs 59.728µs 59.811µs 59.841µs 59.898µs 0.42% -0.130 -0.699 0.17% 0.007µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 16694960.318op/s 16766298.646op/s ± 29052.021op/s 16764878.418op/s ± 23390.753op/s 16789658.829op/s 16816347.259op/s 16825831.331op/s 16830554.188op/s 0.39% 0.137 -0.699 0.17% 2054.288op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 3.891µs 3.911µs ± 0.002µs 3.911µs ± 0.001µs 3.912µs 3.915µs 3.916µs 3.916µs 0.14% -2.158 17.707 0.06% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 255349104.551op/s 255706979.503op/s ± 161050.795op/s 255708175.228op/s ± 84035.901op/s 255790548.539op/s 255919483.689op/s 255942684.735op/s 256977754.748op/s 0.50% 2.186 17.970 0.06% 11388.011op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 56.457µs 56.949µs ± 0.142µs 56.973µs ± 0.086µs 57.052µs 57.128µs 57.159µs 57.241µs 0.47% -0.933 0.690 0.25% 0.010µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 17470054.243op/s 17559597.889op/s ± 43749.412op/s 17552252.608op/s ± 26439.381op/s 17580918.989op/s 17649906.802op/s 17680003.385op/s 17712704.165op/s 0.91% 0.946 0.723 0.25% 3093.551op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 51.337µs 51.406µs ± 0.040µs 51.396µs ± 0.021µs 51.430µs 51.493µs 51.507µs 51.524µs 0.25% 0.858 0.226 0.08% 0.003µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 19408262.963op/s 19453135.900op/s ± 15008.696op/s 19456851.513op/s ± 8098.976op/s 19463589.949op/s 19472392.335op/s 19477611.091op/s 19479170.923op/s 0.11% -0.855 0.219 0.08% 1061.275op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 6.027µs 6.035µs ± 0.004µs 6.034µs ± 0.002µs 6.037µs 6.044µs 6.048µs 6.049µs 0.26% 1.109 1.140 0.07% 0.000µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 165308455.308op/s 165706055.869op/s ± 122957.543op/s 165735031.872op/s ± 63302.841op/s 165790015.296op/s 165857381.687op/s 165900298.683op/s 165924808.641op/s 0.11% -1.104 1.130 0.07% 8694.411op/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.911µs; 3.911µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/ throughput [255659139.648op/s; 255713895.621op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [82.972µs; 83.134µs] or [-0.097%; +0.097%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [12029407.982op/s; 12052824.554op/s] or [-0.097%; +0.097%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [80.287µs; 80.356µs] or [-0.043%; +0.043%] None None None
credit_card/is_card_number/ 378282246310005 throughput [12444781.688op/s; 12455448.505op/s] or [-0.043%; +0.043%] None None None
credit_card/is_card_number/37828224631 execution_time [3.911µs; 3.912µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/37828224631 throughput [255650179.738op/s; 255707832.102op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/378282246310005 execution_time [76.962µs; 77.047µs] or [-0.055%; +0.055%] None None None
credit_card/is_card_number/378282246310005 throughput [12979220.419op/s; 12993577.270op/s] or [-0.055%; +0.055%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [51.388µs; 51.396µs] or [-0.008%; +0.008%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [19456617.765op/s; 19459791.638op/s] or [-0.008%; +0.008%] None None None
credit_card/is_card_number/x371413321323331 execution_time [6.033µs; 6.034µs] or [-0.007%; +0.007%] None None None
credit_card/is_card_number/x371413321323331 throughput [165734604.432op/s; 165758757.038op/s] or [-0.007%; +0.007%] None None None
credit_card/is_card_number_no_luhn/ execution_time [3.911µs; 3.912µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/ throughput [255655093.083op/s; 255703431.345op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [66.127µs; 66.166µs] or [-0.029%; +0.029%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [15113602.690op/s; 15122375.044op/s] or [-0.029%; +0.029%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [59.629µs; 59.658µs] or [-0.024%; +0.024%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [16762272.315op/s; 16770324.977op/s] or [-0.024%; +0.024%] None None None
credit_card/is_card_number_no_luhn/37828224631 execution_time [3.910µs; 3.911µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/37828224631 throughput [255684659.412op/s; 255729299.595op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [56.930µs; 56.969µs] or [-0.034%; +0.034%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [17553534.641op/s; 17565661.137op/s] or [-0.035%; +0.035%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [51.400µs; 51.411µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [19451055.839op/s; 19455215.961op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [6.034µs; 6.035µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [165689015.136op/s; 165723096.602op/s] or [-0.010%; +0.010%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 9a877f9 1748746363 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 32.804µs 33.805µs ± 1.326µs 33.015µs ± 0.126µs 35.433µs 36.122µs 36.491µs 36.511µs 10.59% 0.958 -0.965 3.91% 0.094µ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.622µs; 33.989µs] or [-0.544%; +0.544%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 9a877f9 1748746363 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 248.446ns 258.777ns ± 12.990ns 253.055ns ± 3.304ns 258.212ns 291.378ns 295.739ns 298.492ns 17.96% 1.697 1.743 5.01% 0.919ns 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 [256.977ns; 260.577ns] or [-0.696%; +0.696%] 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 70.99%. Comparing base (8d26d4b) to head (9a877f9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1049      +/-   ##
==========================================
- Coverage   71.01%   70.99%   -0.03%     
==========================================
  Files         329      329              
  Lines       49888    49888              
==========================================
- Hits        35430    35420      -10     
- Misses      14458    14468      +10     
Components Coverage Δ
datadog-crashtracker 42.52% <ø> (-0.03%) ⬇️
datadog-crashtracker-ffi 6.03% <ø> (ø)
datadog-alloc 98.73% <ø> (ø)
data-pipeline 90.61% <ø> (ø)
data-pipeline-ffi 89.26% <ø> (ø)
ddcommon 80.07% <ø> (ø)
ddcommon-ffi 68.64% <ø> (ø)
ddtelemetry 60.56% <ø> (ø)
ddtelemetry-ffi 21.32% <ø> (ø)
dogstatsd-client 83.26% <ø> (ø)
datadog-ipc 82.58% <ø> (-0.19%) ⬇️
datadog-profiling 77.17% <ø> (ø)
datadog-profiling-ffi 62.12% <ø> (ø)
datadog-sidecar 42.37% <ø> (ø)
datdog-sidecar-ffi 10.80% <ø> (ø)
spawn-worker 55.35% <ø> (ø)
tinybytes 90.96% <ø> (ø)
datadog-trace-normalization 98.24% <ø> (ø)
datadog-trace-obfuscation 94.16% <ø> (ø)
datadog-trace-protobuf 77.10% <ø> (ø)
datadog-trace-utils 89.28% <ø> (ø)
🚀 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.26 MB 8.26 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 68.04 MB 68.04 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so.debug 21.15 MB 21.15 MB 0% (0 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so.debug 23.69 MB 23.69 MB 0% (0 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 74.96 MB 74.96 MB 0% (0 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 8.30 MB 8.30 MB 0% (0 B) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 16.70 MB 16.70 MB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 62.62 KB 62.62 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 112.67 MB 112.65 MB --.02% (-24.00 KB) 💪
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 632.41 MB 632.41 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 4.98 MB 4.98 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 62.62 KB 62.62 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 15.85 MB 15.85 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 26.38 MB 26.38 MB 0% (0 B) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 14.15 MB 14.15 MB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 63.58 KB 63.58 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 114.56 MB 114.55 MB --.01% (-16.00 KB) 💪
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 624.68 MB 624.68 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 3.77 MB 3.77 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 63.58 KB 63.58 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 16.48 MB 16.48 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 24.30 MB 24.30 MB 0% (0 B) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 59.31 MB 59.31 MB 0% (0 B) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 8.69 MB 8.69 MB 0% (0 B) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so.debug 19.47 MB 19.47 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 70.65 MB 70.65 MB 0% (0 B) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 8.70 MB 8.70 MB 0% (0 B) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so.debug 21.77 MB 21.77 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
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)
data-pipeline 10 10 No change (0%)
datadog-crashtracker 5 5 No change (0%)
datadog-ddsketch 2 2 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 11 11 No change (0%)
datadog-profiling-replayer 4 4 No change (0%)
datadog-remote-config 3 3 No change (0%)
datadog-sidecar 56 56 No change (0%)
datadog-trace-normalization 2 2 No change (0%)
datadog-trace-obfuscation 8 8 No change (0%)
datadog-trace-utils 17 17 No change (0%)
ddcommon 13 13 No change (0%)
ddcommon-ffi 8 8 No change (0%)
ddtelemetry 19 19 No change (0%)
dogstatsd-client 1 1 No change (0%)
tinybytes 3 3 No change (0%)
Total 205 210 ⚠️ +5 (+2.4%)

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 from cce6240 to a0b7788 Compare June 1, 2025 02:37
ekump added 5 commits May 31, 2025 22:45
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 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants