Reach feature parity on credit card obfuscation#1633
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes Luhn checksum computation in the credit card detector used by libdd-trace-obfuscation, aligning behavior with the Datadog Agent implementation.
Changes:
- Correct Luhn digit transformation (
dbl_x - 9) and checksum calculation ((10 - (acc % 10)) % 10) incalculate_luhn. - Update existing “valid cards” test to exercise the Luhn-validation path.
- Add targeted unit tests for
luhn_validand additionalcalculate_luhncases (odd/even payload lengths).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Clippy Allow Annotation ReportComparing clippy allow annotations between branches:
Summary by Rule
Annotation Counts by File
Annotation Stats by Crate
About This ReportThis 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. |
BenchmarksComparisonBenchmark execution time: 2026-02-26 16:34:45 Comparing candidate commit 7a23859 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 57 metrics, 2 unstable metrics. CandidateCandidate benchmark detailsGroup 1
Group 2
Group 3
Group 4
Group 5
Group 6
Group 7
Group 8
Group 9
Group 10
Group 11
Group 12
Group 13
Group 14
Group 15
Group 16
Group 17
Group 18
Group 19
BaselineOmitted due to size. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1633 +/- ##
==========================================
+ Coverage 71.19% 71.24% +0.04%
==========================================
Files 423 423
Lines 62453 62463 +10
==========================================
+ Hits 44466 44499 +33
+ Misses 17987 17964 -23
🚀 New features to boost your workflow:
|
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
195b024
into
main
# What does this PR do? Bump version to 28.0.2 This includes: - [chore: update bytes to 1.11.1 to address RUSTSEC-2026-0007](https://github.com/DataDog/libdatadog/pull/1628)[chore: update bytes to 1.11.1 to address RUSTSEC-2026-0007](#1628) - [chore(release): merge release branch to main](https://github.com/DataDog/libdatadog/pull/1629)[chore(release): merge release branch to main](#1629) - [fix: add ecs task metadata to unobfuscated ip addresses](https://github.com/DataDog/libdatadog/pull/1631)[fix: add ecs task metadata to unobfuscated ip addresses](#1631) - [fix: credit card luhn validation for obfuscation](https://github.com/DataDog/libdatadog/pull/1633)[fix: credit card luhn validation for obfuscation](#1633) - [perf(profiling): cache TLS in ProfileExporter::new](https://github.com/DataDog/libdatadog/pull/1619)[perf(profiling): cache TLS in ProfileExporter::new](#1619) # Motivation [perf(profiling): cache TLS in ProfileExporter::new](https://github.com/DataDog/libdatadog/pull/1619)[perf(profiling): cache TLS in ProfileExporter::new](#1619) fixes slow TLS issue # Additional Notes Anything else we should know when reviewing? # How to test the change? Describe here in detail how the change can be validated. Co-authored-by: gyuheon.oh <[email protected]>
What does this PR do?
calculate_luhnMotivation
Making libdatadog’s obfuscation feature equivalent to the Agent’s implementation.