Skip to content

Fix GeneratePackageVersions so that it correctly respects IncludePackages and ExcludePackages#8340

Merged
andrewlock merged 7 commits intomasterfrom
andrew/fix-regenerate-package-versions
Mar 19, 2026
Merged

Fix GeneratePackageVersions so that it correctly respects IncludePackages and ExcludePackages#8340
andrewlock merged 7 commits intomasterfrom
andrew/fix-regenerate-package-versions

Conversation

@andrewlock
Copy link
Copy Markdown
Member

Summary of changes

Fixes GeneratePackageVersions so that it doesn't update things it shouldn't

Reason for change

There has been a long-standing issue where running:

.\tracer\build.ps1 GeneratePackageVersions -includepackages MongoDB.Driver

should only update the MongoDB.Driver package, but it often didn't, and often made updates to AWSSDK (for example). This made only updating a single package a real pain, with a bunch of workarounds required. After this PR, the above command only updates the package you tell it to.

Implementation details

  • Added a nuget_version_cache.json file which is the package versions returned by NuGet the last time that GeneratePackageVersions was run.
  • We parse this file, and the supported_package_versions.json file to know the "current state".
  • We then conditionally update this list based on the include/exclude package filter.
  • After updating the versions, we re-generate all the files, and persist the new list.
  • If you run without a package filter, it updates everything, as today

Test coverage

Tested this a bunch of times locally to confirm the behaviour locally, and it LGTM

Other details

Once this is merged, will run the TestPackageVersions action, just to confirm nothing's broken there

@andrewlock andrewlock requested a review from a team as a code owner March 19, 2026 13:18
@andrewlock andrewlock added area:builds project files, build scripts, pipelines, versioning, releases, packages AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos labels Mar 19, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ab85b53264

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tracer/build/_build/GeneratePackageVersions/GenerateSupportMatrix.cs Outdated
Comment thread tracer/build/_build/GeneratePackageVersions/NuGetVersionCache.cs Outdated
Copy link
Copy Markdown
Collaborator

@bouwkast bouwkast left a comment

Choose a reason for hiding this comment

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

Awesome thanks!

@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Mar 19, 2026

Benchmarks

Benchmark execution time: 2026-03-19 15:30:12

Comparing candidate commit ea28ed6 in PR branch andrew/fix-regenerate-package-versions with baseline commit 2b15f71 in branch master.

Found 8 performance improvements and 9 performance regressions! Performance is the same for 154 metrics, 21 unstable metrics.

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild netcoreapp3.1

  • 🟩 execution_time [-116.169ms; -114.260ms] or [-56.191%; -55.268%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net6.0

  • 🟩 execution_time [-23.550ms; -23.339ms] or [-18.905%; -18.736%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody netcoreapp3.1

  • 🟩 execution_time [-19.055ms; -12.691ms] or [-9.129%; -6.080%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net6.0

  • 🟥 execution_time [+10.120ms; +15.789ms] or [+5.058%; +7.891%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net6.0

  • 🟥 execution_time [+16.193ms; +22.513ms] or [+8.238%; +11.453%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody netcoreapp3.1

  • 🟥 execution_time [+17.175ms; +23.449ms] or [+8.741%; +11.935%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs netcoreapp3.1

  • 🟩 execution_time [-21.153ms; -19.984ms] or [-10.517%; -9.935%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1

  • 🟥 throughput [-192.431op/s; -149.850op/s] or [-12.199%; -9.500%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool netcoreapp3.1

  • 🟩 throughput [+25.561op/s; +29.761op/s] or [+5.066%; +5.899%]

scenario:Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery net6.0

  • 🟩 throughput [+28150.337op/s; +40204.772op/s] or [+5.524%; +7.889%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net6.0

  • 🟥 throughput [-3271.339op/s; -1226.937op/s] or [-14.527%; -5.448%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟩 execution_time [-12.654ms; -12.037ms] or [-6.265%; -5.960%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog netcoreapp3.1

  • 🟥 execution_time [+29.577ms; +32.409ms] or [+17.238%; +18.888%]

scenario:Benchmarks.Trace.NLogBenchmark.EnrichedLog netcoreapp3.1

  • 🟩 execution_time [-14.479ms; -10.635ms] or [-7.045%; -5.175%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net6.0

  • 🟥 execution_time [+6.095ms; +10.492ms] or [+6.687%; +11.512%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore netcoreapp3.1

  • 🟥 throughput [-16059274.150op/s; -15079623.098op/s] or [-6.665%; -6.258%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net6.0

  • 🟥 execution_time [+14.038ms; +18.224ms] or [+7.092%; +9.206%]

@dd-trace-dotnet-ci-bot
Copy link
Copy Markdown

dd-trace-dotnet-ci-bot Bot commented Mar 19, 2026

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8340) and master.

⚠️ Potential regressions detected

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration68.88 ± (68.85 - 69.12) ms75.17 ± (75.22 - 75.51) ms+9.1%❌⬆️
.NET Framework 4.8 - Bailout
duration72.74 ± (72.65 - 72.87) ms80.52 ± (80.23 - 80.63) ms+10.7%❌⬆️
Full Metrics Comparison

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration68.88 ± (68.85 - 69.12) ms75.17 ± (75.22 - 75.51) ms+9.1%❌⬆️
.NET Framework 4.8 - Bailout
duration72.74 ± (72.65 - 72.87) ms80.52 ± (80.23 - 80.63) ms+10.7%❌⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1044.68 ± (1046.91 - 1054.55) ms1101.92 ± (1104.43 - 1110.54) ms+5.5%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms21.94 ± (21.91 - 21.98) ms23.22 ± (23.15 - 23.28) ms+5.8%✅⬆️
process.time_to_main_ms79.95 ± (79.78 - 80.13) ms88.93 ± (88.73 - 89.14) ms+11.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.89 ± (10.89 - 10.90) MB10.92 ± (10.92 - 10.93) MB+0.3%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms21.87 ± (21.85 - 21.90) ms23.34 ± (23.28 - 23.41) ms+6.7%✅⬆️
process.time_to_main_ms81.13 ± (80.96 - 81.30) ms91.34 ± (91.13 - 91.55) ms+12.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.94 ± (10.93 - 10.94) MB10.96 ± (10.96 - 10.97) MB+0.3%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms217.31 ± (216.32 - 218.31) ms226.35 ± (225.05 - 227.64) ms+4.2%✅⬆️
process.time_to_main_ms472.53 ± (471.95 - 473.12) ms507.20 ± (506.27 - 508.12) ms+7.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed47.22 ± (47.19 - 47.25) MB47.21 ± (47.18 - 47.24) MB-0.0%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-1.4%
.NET 6 - Baseline
process.internal_duration_ms20.78 ± (20.75 - 20.80) ms21.86 ± (21.82 - 21.90) ms+5.2%✅⬆️
process.time_to_main_ms69.34 ± (69.21 - 69.47) ms76.52 ± (76.34 - 76.71) ms+10.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.61 ± (10.61 - 10.62) MB10.65 ± (10.65 - 10.65) MB+0.3%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms20.70 ± (20.67 - 20.72) ms21.69 ± (21.64 - 21.75) ms+4.8%✅⬆️
process.time_to_main_ms70.13 ± (70.01 - 70.26) ms77.51 ± (77.31 - 77.71) ms+10.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.72 ± (10.71 - 10.72) MB10.75 ± (10.75 - 10.76) MB+0.3%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms205.49 ± (203.60 - 207.38) ms210.38 ± (208.66 - 212.10) ms+2.4%✅⬆️
process.time_to_main_ms474.73 ± (473.78 - 475.67) ms504.58 ± (503.74 - 505.42) ms+6.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.97 ± (48.91 - 49.03) MB49.21 ± (49.17 - 49.24) MB+0.5%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.1%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms18.92 ± (18.90 - 18.95) ms20.05 ± (20.01 - 20.10) ms+6.0%✅⬆️
process.time_to_main_ms68.66 ± (68.53 - 68.78) ms76.12 ± (75.96 - 76.28) ms+10.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.67 ± (7.67 - 7.68) MB7.67 ± (7.66 - 7.68) MB-0.1%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms18.98 ± (18.94 - 19.01) ms20.18 ± (20.12 - 20.24) ms+6.3%✅⬆️
process.time_to_main_ms69.96 ± (69.84 - 70.07) ms77.87 ± (77.68 - 78.07) ms+11.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.73 ± (7.72 - 7.73) MB7.73 ± (7.72 - 7.74) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms157.34 ± (156.36 - 158.33) ms170.53 ± (169.53 - 171.53) ms+8.4%✅⬆️
process.time_to_main_ms450.08 ± (449.43 - 450.73) ms485.31 ± (484.59 - 486.03) ms+7.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.49 ± (36.47 - 36.50) MB36.53 ± (36.52 - 36.55) MB+0.1%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.6%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration193.10 ± (193.27 - 194.18) ms194.60 ± (194.86 - 195.95) ms+0.8%✅⬆️
.NET Framework 4.8 - Bailout
duration196.74 ± (196.62 - 197.21) ms197.83 ± (197.54 - 198.15) ms+0.6%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1152.56 ± (1153.77 - 1161.61) ms1156.18 ± (1156.57 - 1164.47) ms+0.3%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms189.37 ± (188.95 - 189.80) ms189.57 ± (189.14 - 190.01) ms+0.1%✅⬆️
process.time_to_main_ms81.34 ± (81.17 - 81.51) ms81.59 ± (81.35 - 81.84) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.14 ± (16.12 - 16.16) MB16.10 ± (16.08 - 16.12) MB-0.2%
runtime.dotnet.threads.count20 ± (19 - 20)20 ± (20 - 20)+0.6%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms187.42 ± (187.09 - 187.76) ms190.10 ± (189.63 - 190.56) ms+1.4%✅⬆️
process.time_to_main_ms82.04 ± (81.94 - 82.14) ms83.13 ± (82.92 - 83.33) ms+1.3%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.16 ± (16.13 - 16.19) MB16.21 ± (16.18 - 16.24) MB+0.3%✅⬆️
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)-0.1%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms398.17 ± (396.19 - 400.15) ms398.51 ± (396.63 - 400.39) ms+0.1%✅⬆️
process.time_to_main_ms472.98 ± (472.30 - 473.65) ms476.81 ± (476.01 - 477.62) ms+0.8%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed57.78 ± (57.63 - 57.94) MB58.17 ± (58.04 - 58.29) MB+0.7%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+0.0%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms193.01 ± (192.57 - 193.46) ms193.90 ± (193.52 - 194.28) ms+0.5%✅⬆️
process.time_to_main_ms70.12 ± (69.93 - 70.32) ms71.18 ± (70.96 - 71.40) ms+1.5%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.00 ± (15.86 - 16.14) MB16.46 ± (16.43 - 16.48) MB+2.9%✅⬆️
runtime.dotnet.threads.count19 ± (18 - 19)19 ± (19 - 19)+2.5%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms191.65 ± (191.31 - 191.99) ms193.62 ± (193.22 - 194.03) ms+1.0%✅⬆️
process.time_to_main_ms71.10 ± (70.99 - 71.20) ms71.92 ± (71.76 - 72.09) ms+1.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.07 ± (15.92 - 16.22) MB16.37 ± (16.26 - 16.48) MB+1.9%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)20 ± (19 - 20)+2.5%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms429.10 ± (427.14 - 431.05) ms430.15 ± (428.28 - 432.02) ms+0.2%✅⬆️
process.time_to_main_ms477.14 ± (476.30 - 477.98) ms479.32 ± (478.32 - 480.32) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed60.22 ± (60.15 - 60.29) MB60.24 ± (60.17 - 60.30) MB+0.0%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 31)+0.2%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms190.10 ± (189.64 - 190.56) ms191.17 ± (190.82 - 191.52) ms+0.6%✅⬆️
process.time_to_main_ms69.82 ± (69.66 - 69.97) ms69.99 ± (69.81 - 70.17) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.84 ± (11.81 - 11.87) MB11.80 ± (11.77 - 11.82) MB-0.4%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-0.2%
.NET 8 - Bailout
process.internal_duration_ms189.61 ± (189.26 - 189.95) ms190.78 ± (190.38 - 191.18) ms+0.6%✅⬆️
process.time_to_main_ms70.93 ± (70.77 - 71.09) ms71.40 ± (71.24 - 71.56) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.84 ± (11.81 - 11.87) MB11.86 ± (11.83 - 11.89) MB+0.2%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.3%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms355.55 ± (354.22 - 356.87) ms355.25 ± (353.90 - 356.59) ms-0.1%
process.time_to_main_ms453.51 ± (452.85 - 454.17) ms455.97 ± (455.34 - 456.61) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed48.38 ± (48.33 - 48.42) MB48.36 ± (48.33 - 48.40) MB-0.0%
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)-0.1%
Comparison explanation

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 highlighted 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).

Duration charts
FakeDbCommand (.NET Framework 4.8)
gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8340) - mean (75ms)  : 73, 77
    master - mean (69ms)  : 67, 71

    section Bailout
    This PR (8340) - mean (80ms)  : crit, 78, 83
    master - mean (73ms)  : 72, 74

    section CallTarget+Inlining+NGEN
    This PR (8340) - mean (1,107ms)  : 1062, 1153
    master - mean (1,051ms)  : 996, 1105

Loading
FakeDbCommand (.NET Core 3.1)
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8340) - mean (119ms)  : 116, 123
    master - mean (108ms)  : 105, 111

    section Bailout
    This PR (8340) - mean (122ms)  : crit, 119, 125
    master - mean (109ms)  : 106, 111

    section CallTarget+Inlining+NGEN
    This PR (8340) - mean (770ms)  : crit, 738, 801
    master - mean (727ms)  : 707, 747

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8340) - mean (105ms)  : 101, 109
    master - mean (95ms)  : 93, 98

    section Bailout
    This PR (8340) - mean (106ms)  : crit, 104, 108
    master - mean (96ms)  : 94, 98

    section CallTarget+Inlining+NGEN
    This PR (8340) - mean (753ms)  : crit, 708, 798
    master - mean (709ms)  : 659, 758

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8340) - mean (104ms)  : 101, 107
    master - mean (94ms)  : 91, 97

    section Bailout
    This PR (8340) - mean (106ms)  : crit, 103, 109
    master - mean (96ms)  : 94, 98

    section CallTarget+Inlining+NGEN
    This PR (8340) - mean (695ms)  : crit, 663, 726
    master - mean (642ms)  : 608, 676

Loading
HttpMessageHandler (.NET Framework 4.8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8340) - mean (195ms)  : 189, 202
    master - mean (194ms)  : 188, 199

    section Bailout
    This PR (8340) - mean (198ms)  : 195, 201
    master - mean (197ms)  : 194, 200

    section CallTarget+Inlining+NGEN
    This PR (8340) - mean (1,161ms)  : 1104, 1217
    master - mean (1,158ms)  : 1102, 1214

Loading
HttpMessageHandler (.NET Core 3.1)
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8340) - mean (280ms)  : 274, 287
    master - mean (279ms)  : 270, 289

    section Bailout
    This PR (8340) - mean (282ms)  : 274, 291
    master - mean (278ms)  : 274, 281

    section CallTarget+Inlining+NGEN
    This PR (8340) - mean (908ms)  : 878, 938
    master - mean (904ms)  : 875, 933

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8340) - mean (273ms)  : 268, 279
    master - mean (271ms)  : 266, 277

    section Bailout
    This PR (8340) - mean (274ms)  : 269, 279
    master - mean (271ms)  : 266, 276

    section CallTarget+Inlining+NGEN
    This PR (8340) - mean (942ms)  : 911, 974
    master - mean (939ms)  : 904, 973

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8340) - mean (271ms)  : 266, 275
    master - mean (270ms)  : 265, 275

    section Bailout
    This PR (8340) - mean (272ms)  : 266, 278
    master - mean (270ms)  : 264, 275

    section CallTarget+Inlining+NGEN
    This PR (8340) - mean (841ms)  : 815, 867
    master - mean (839ms)  : 812, 865

Loading

@andrewlock andrewlock requested a review from Copilot March 19, 2026 14:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the GeneratePackageVersions build pipeline to correctly respect IncludePackages/ExcludePackages by reusing cached NuGet/package-support data for non-targeted packages instead of recomputing/updating them.

Changes:

  • Introduces a persisted NuGet version list cache (nuget_version_cache.json) and uses it to avoid querying/updating excluded packages.
  • Loads previously generated supported_versions.json to reuse support range data when packages are not being updated.
  • Refactors NuGet helper APIs to separate “fetch all versions” from “filter to entry bounds”, and threads filtering predicates through both generation pipelines.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tracer/build/_build/Honeypot/IntegrationGroups.cs Reuses previous supported_versions.json data for excluded packages instead of querying NuGet.
tracer/build/_build/Honeypot/DependabotFileManager.cs Threads update predicate + previous support data into integration map generation.
tracer/build/_build/GeneratePackageVersions/PackageVersionGenerator.cs Uses cached/all-versions + filtering approach and persists queried versions into a cache.
tracer/build/_build/GeneratePackageVersions/NuGetVersionCache.cs Adds load/save helper for persisted NuGet version cache.
tracer/build/_build/GeneratePackageVersions/NuGetPackageHelper.cs Splits “fetch all versions” from “filter versions by entry range”; updates metadata fetch signature.
tracer/build/_build/GeneratePackageVersions/GenerateSupportMatrix.cs Adds LoadPreviousVersions helper to read prior supported_versions.json as a lookup.
tracer/build/_build/Build.Utilities.cs Wires the new caching + “should update” predicate into both generation pipelines.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread tracer/build/_build/GeneratePackageVersions/NuGetVersionCache.cs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@andrewlock andrewlock enabled auto-merge (squash) March 19, 2026 17:04
@andrewlock andrewlock merged commit a9e4caf into master Mar 19, 2026
137 of 138 checks passed
@andrewlock andrewlock deleted the andrew/fix-regenerate-package-versions branch March 19, 2026 17:47
@github-actions github-actions Bot added this to the vNext-v3 milestone Mar 19, 2026
bouwkast added a commit that referenced this pull request Apr 22, 2026
## Summary of changes

This goes back through the recent changes (#8371 and #8340) to
`GeneratePackageVersions` and attempts to do some removals,
refactorings, and fixes that have come up. Notably this removes the
`nuget_cache`, fixes `IncludePackages` (again 😅), and rewrites the
cooldown logic to not use `supported_versions.json` and `nuget_cache`
and instead reads from the `.g.cs` files in addition to refactoring the
verbage used throughout.

## Reason for change

While working on (#8128) I started running into several issues with
`GeneratePackageVersions` namely that I couldn't get `IncludePackages`
to work and then I started fighting issues with the `nuget_cache` as
well when attempting to add a new integration.

This sets out to do a few things:

- Simplify the logic for NuGet cooldown (automated dependency updates
must adhere to our current cooldown policy for potential supply chain
attacks)
- Remove the `nuget_cache` - this was added so that we wouldn't go and
query NuGet info for packages not listed in the `IncludePackages`
- Change the "verbage" of the cooldown/baseline to be easier to read /
follow
- Do NOT read / rely upon `supported_versions` (this is what I
previously used to determine what the highest version was currently
allowed) - this file is planned to be changed/modified/removed by
another team in the near future hence why we shouldn't use it.
- I didn't account for different timezones in the publish state of the
`nuget_cache` before so if someone ran it depending on their locale it
would change.

## Implementation details

- New `CooldownMode` `enum`: `Normal`, `BypassCooldown`, `Freeze`
  - Normal drops recent versions that are above the previous max
- BypassCooldown accepts all in-range versions (no cooldown) (when
`IncludePackages` is used is an example)
  - Freeze re-emits the previous run's output verbatim
- `XUnitFileGenerator.LoadExistingVersions` reads the previous `.g.cs`
and returns `Dictionary<IntegrationName, List<(Framework, Versions)>>`.
`PackageGroup` loads this once and exposes `TryGetFrozenVersions`
- I think we should probably still try and do something different here
but this seems a bit more reasonable
- Deleted `nuget_version_cache.json` and `NuGetVersionCache.cs`
  - No longer used/needed
- Some readability improvements
  -  `IsWithinCooldown` → `WasPublishedTooRecently`
  - `baseline` → `previousMaxVersions`
- `ApplyCooldown` now uses two named local booleans
(`publishedTooRecently`, `atOrBelowPreviousMax`) so the drop condition
reads positively: "drop the version if it was published too recently
**and** we haven't already shipped against it."

## Test coverage

I ran it locally for a handful of cases I think it is better.

## Other details
<!-- Fixes #{issue} -->

I have ran through several instances with this and it _seems_ to be
good, basically default runs, runs with configurable cooldowns, runs
with `IncludePackages` and runs with `ExcludePackages`. All appeared as
expected to me.


<!--  ⚠️ Note:

Where possible, please obtain 2 approvals prior to merging. Unless
CODEOWNERS specifies otherwise, for external teams it is typically best
to have one review from a team member, and one review from apm-dotnet.
Trivial changes do not require 2 reviews.

MergeQueue is NOT enabled in this repository. If you have write access
to the repo, the PR has 1-2 approvals (see above), and all of the
required checks have passed, you can use the Squash and Merge button to
merge the PR. If you don't have write access, or you need help, reach
out in the #apm-dotnet channel in Slack.
-->

---------

Co-authored-by: Andrew Lock <andrew.lock@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos area:builds project files, build scripts, pipelines, versioning, releases, packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants