Skip to content
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

Fix compilation of Samples.Security.AspNetCore5 #6512

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

kevingosse
Copy link
Collaborator

Summary of changes

Make Samples.Security.AspNetCore5 compile again.

Implementation details

A field that was inadvertently removed was actually used.

@kevingosse kevingosse requested a review from a team as a code owner January 8, 2025 14:08
@github-actions github-actions bot added the area:tests unit tests, integration tests label Jan 8, 2025
Copy link
Member

@andrewlock andrewlock left a comment

Choose a reason for hiding this comment

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

Thanks. Looks like it was caused essentially by merge conflicts between #6491 and #6482

Copy link
Contributor

@daniel-romano-DD daniel-romano-DD left a comment

Choose a reason for hiding this comment

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

TY!

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Jan 8, 2025

Datadog Report

Branch report: kevin/fix_compilation
Commit report: 5750d12
Test service: dd-trace-dotnet

✅ 0 Failed, 242316 Passed, 2033 Skipped, 18h 30m 26.6s Total Time
❄️ 1 New Flaky
⌛ 1 Performance Regression

New Flaky Tests (1)

  • TypicalLoop_WithLogsQueueTrigger - Datadog.Trace.Tests.Telemetry.TelemetryControllerSchedulerTests - Last Failure

    Expand for error
     Expected _scheduler.ShouldFlushRedactedErrorLogs to be true, but found False.
    

⌛ Performance Regressions vs Default Branch (1)

  • RunWafRealisticBenchmarkWithAttack - Benchmarks.Trace.Asm.AppSecWafBenchmark 122.54µs (+6.59µs, +6%) - Details

@andrewlock
Copy link
Member

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing the following branches/commits:

Execution-time benchmarks measure the whole time it takes to execute a program. And are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are shown in red. The following thresholds were used for comparing the execution times:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard.

Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph).

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6512) - mean (68ms)  : 66, 71
     .   : milestone, 68,
    master - mean (69ms)  : 66, 72
     .   : milestone, 69,

    section CallTarget+Inlining+NGEN
    This PR (6512) - mean (981ms)  : 954, 1008
     .   : milestone, 981,
    master - mean (981ms)  : 954, 1008
     .   : milestone, 981,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6512) - mean (107ms)  : 105, 110
     .   : milestone, 107,
    master - mean (107ms)  : 105, 110
     .   : milestone, 107,

    section CallTarget+Inlining+NGEN
    This PR (6512) - mean (679ms)  : 661, 697
     .   : milestone, 679,
    master - mean (678ms)  : 662, 695
     .   : milestone, 678,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6512) - mean (91ms)  : 89, 93
     .   : milestone, 91,
    master - mean (91ms)  : 90, 93
     .   : milestone, 91,

    section CallTarget+Inlining+NGEN
    This PR (6512) - mean (636ms)  : 622, 650
     .   : milestone, 636,
    master - mean (633ms)  : 616, 651
     .   : milestone, 633,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6512) - mean (194ms)  : 189, 199
     .   : milestone, 194,
    master - mean (195ms)  : 189, 202
     .   : milestone, 195,

    section CallTarget+Inlining+NGEN
    This PR (6512) - mean (1,103ms)  : 1076, 1131
     .   : milestone, 1103,
    master - mean (1,104ms)  : 1076, 1132
     .   : milestone, 1104,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6512) - mean (280ms)  : 275, 285
     .   : milestone, 280,
    master - mean (278ms)  : 273, 282
     .   : milestone, 278,

    section CallTarget+Inlining+NGEN
    This PR (6512) - mean (875ms)  : 850, 900
     .   : milestone, 875,
    master - mean (874ms)  : 847, 901
     .   : milestone, 874,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6512) - mean (267ms)  : 264, 271
     .   : milestone, 267,
    master - mean (268ms)  : 264, 272
     .   : milestone, 268,

    section CallTarget+Inlining+NGEN
    This PR (6512) - mean (853ms)  : 823, 884
     .   : milestone, 853,
    master - mean (857ms)  : 829, 885
     .   : milestone, 857,

Loading

@andrewlock
Copy link
Member

Benchmarks Report for appsec 🐌

Benchmarks for #6512 compared to master:

  • All benchmarks have the same speed
  • 2 benchmarks have fewer allocations
  • 2 benchmarks have more allocations

The following thresholds were used for comparing the benchmark speeds:

  • Mann–Whitney U test with statistical test for significance of 5%
  • Only results indicating a difference greater than 10% and 0.3 ns are considered.

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 202μs 169ns 655ns 2.61 0 0 188.76 KB
master AllCycleSimpleBody netcoreapp3.1 299μs 200ns 773ns 2.68 0 0 196.09 KB
master AllCycleSimpleBody net472 273μs 118ns 441ns 35.8 2.05 0 225.79 KB
master AllCycleMoreComplexBody net6.0 209μs 123ns 459ns 2.72 0 0 192.26 KB
master AllCycleMoreComplexBody netcoreapp3.1 317μs 139ns 520ns 2.68 0 0 199.5 KB
master AllCycleMoreComplexBody net472 278μs 174ns 674ns 36.4 2.08 0 229.3 KB
master ObjectExtractorSimpleBody net6.0 161ns 0.13ns 0.486ns 0.00393 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 195ns 0.139ns 0.52ns 0.00373 0 0 272 B
master ObjectExtractorSimpleBody net472 168ns 0.0874ns 0.338ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 2.91μs 1.13ns 4.07ns 0.0524 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.76μs 3.16ns 11.8ns 0.0488 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.63μs 2.34ns 8.75ns 0.603 0.00722 0 3.8 KB
#6512 AllCycleSimpleBody net6.0 207μs 131ns 489ns 2.68 0 0 188.76 KB
#6512 AllCycleSimpleBody netcoreapp3.1 304μs 177ns 663ns 2.59 0 0 196.09 KB
#6512 AllCycleSimpleBody net472 274μs 164ns 636ns 35.8 2.05 0 225.79 KB
#6512 AllCycleMoreComplexBody net6.0 210μs 103ns 387ns 2.73 0 0 192.26 KB
#6512 AllCycleMoreComplexBody netcoreapp3.1 313μs 190ns 734ns 2.64 0 0 199.5 KB
#6512 AllCycleMoreComplexBody net472 278μs 201ns 778ns 36.4 2.07 0 229.3 KB
#6512 ObjectExtractorSimpleBody net6.0 146ns 0.118ns 0.441ns 0.00397 0 0 280 B
#6512 ObjectExtractorSimpleBody netcoreapp3.1 188ns 0.146ns 0.564ns 0.00374 0 0 272 B
#6512 ObjectExtractorSimpleBody net472 167ns 0.242ns 0.936ns 0.0446 0 0 281 B
#6512 ObjectExtractorMoreComplexBody net6.0 2.89μs 1.31ns 4.73ns 0.0524 0 0 3.78 KB
#6512 ObjectExtractorMoreComplexBody netcoreapp3.1 3.77μs 1.64ns 6.14ns 0.051 0 0 3.69 KB
#6512 ObjectExtractorMoreComplexBody net472 3.69μs 6.79ns 26.3ns 0.603 0.00548 0 3.8 KB
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EncodeArgs net6.0 36.7μs 26.7ns 104ns 0.457 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 55.2μs 33.8ns 131ns 0.412 0 0 32.4 KB
master EncodeArgs net472 67.9μs 47.8ns 179ns 5.15 0.0678 0 32.5 KB
master EncodeLegacyArgs net6.0 74.4μs 22.5ns 84.3ns 0 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 105μs 155ns 602ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 156μs 56.3ns 218ns 0.312 0 0 2.15 KB
#6512 EncodeArgs net6.0 37.8μs 23.4ns 87.4ns 0.453 0 0 32.4 KB
#6512 EncodeArgs netcoreapp3.1 54.5μs 30.8ns 119ns 0.433 0 0 32.4 KB
#6512 EncodeArgs net472 66.6μs 59.9ns 232ns 5.16 0.0674 0 32.5 KB
#6512 EncodeLegacyArgs net6.0 80.5μs 34.7ns 130ns 0 0 0 2.14 KB
#6512 EncodeLegacyArgs netcoreapp3.1 105μs 100ns 388ns 0 0 0 2.15 KB
#6512 EncodeLegacyArgs net472 155μs 80.1ns 289ns 0.309 0 0 2.15 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 174μs 90.3ns 338ns 0 0 0 2.44 KB
master RunWafRealisticBenchmark netcoreapp3.1 187μs 225ns 812ns 0 0 0 2.39 KB
master RunWafRealisticBenchmark net472 199μs 119ns 462ns 0.3 0 0 2.46 KB
master RunWafRealisticBenchmarkWithAttack net6.0 114μs 65.1ns 252ns 0 0 0 1.47 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 124μs 279ns 1.08μs 0 0 0 1.46 KB
master RunWafRealisticBenchmarkWithAttack net472 132μs 51.1ns 198ns 0.198 0 0 1.49 KB
#6512 RunWafRealisticBenchmark net6.0 173μs 110ns 427ns 0 0 0 2.44 KB
#6512 RunWafRealisticBenchmark netcoreapp3.1 187μs 154ns 578ns 0 0 0 2.39 KB
#6512 RunWafRealisticBenchmark net472 200μs 101ns 393ns 0.299 0 0 2.46 KB
#6512 RunWafRealisticBenchmarkWithAttack net6.0 123μs 101ns 392ns 0 0 0 1.47 KB
#6512 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 124μs 154ns 597ns 0 0 0 1.46 KB
#6512 RunWafRealisticBenchmarkWithAttack net472 132μs 48ns 186ns 0.199 0 0 1.48 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #6512

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 276.42 KB 278.53 KB 2.11 KB 0.76%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 255.18 KB 256.62 KB 1.44 KB 0.56%

Fewer allocations 🎉 in #6512

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 61.73 KB 59.65 KB -2.08 KB -3.37%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 262.87 KB 253.83 KB -9.04 KB -3.44%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 60μs 755ns 7.55μs 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 53.2μs 243ns 1.09μs 0 0 0 42.64 KB
master StringConcatBenchmark net472 37.5μs 111ns 416ns 0 0 0 61.73 KB
master StringConcatAspectBenchmark net6.0 321μs 1.8μs 11.7μs 0 0 0 255.18 KB
master StringConcatAspectBenchmark netcoreapp3.1 340μs 1.87μs 11.4μs 0 0 0 262.87 KB
master StringConcatAspectBenchmark net472 269μs 5.16μs 49.2μs 0 0 0 276.42 KB
#6512 StringConcatBenchmark net6.0 52.4μs 260ns 1.16μs 0 0 0 43.44 KB
#6512 StringConcatBenchmark netcoreapp3.1 53.7μs 132ns 528ns 0 0 0 42.64 KB
#6512 StringConcatBenchmark net472 38μs 143ns 514ns 0 0 0 59.65 KB
#6512 StringConcatAspectBenchmark net6.0 324μs 1.81μs 12.4μs 0 0 0 256.62 KB
#6512 StringConcatAspectBenchmark netcoreapp3.1 354μs 1.97μs 12.9μs 0 0 0 253.83 KB
#6512 StringConcatAspectBenchmark net472 257μs 3.16μs 28.6μs 0 0 0 278.53 KB

@kevingosse kevingosse merged commit c0655f6 into master Jan 8, 2025
97 of 102 checks passed
@kevingosse kevingosse deleted the kevin/fix_compilation branch January 8, 2025 16:03
@github-actions github-actions bot added this to the vNext-v3 milestone Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:tests unit tests, integration tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants