Skip to content

[CI] Add commit-only fallback when resolving serverless/single-step Azure build artifacts#8782

Merged
NachoEchevarria merged 7 commits into
masterfrom
nacho/fixGitlabDownloadJobs
Jun 29, 2026
Merged

[CI] Add commit-only fallback when resolving serverless/single-step Azure build artifacts#8782
NachoEchevarria merged 7 commits into
masterfrom
nacho/fixGitlabDownloadJobs

Conversation

@NachoEchevarria

@NachoEchevarria NachoEchevarria commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

The serverless and single-step artifact download scripts (.gitlab/download-serverless-artifacts.sh, .gitlab/download-single-step-artifacts.sh) resolved the Azure DevOps build by matching branch name + commit SHA. This intermittently failed:

No build found for commit 'cf138c11...' on branch 'refs/heads/dudik/bounded-capture-filters' (including PRs)
ERROR: Job failed: command terminated with exit code 1

Root cause: cf138c11 is a normal master commit whose artifacts live on the master Azure builds. But the GitLab pipeline ran with CI_COMMIT_BRANCH=dudik/bounded-capture-filters — a feature branch whose tip transiently parked on this commit during a rebase/force-push, firing a branch pipeline for a (branch, SHA) pair that has no Azure build. The branch-keyed lookups never checked master, where the artifacts actually exist → exit 1.

Change

Resolve the build most-specific-first, stopping at the first hit:

  1. PR build for this branch + commit — unchanged.
  2. Standalone (manual/individualCI) build for this branch + commit — unchanged.
  3. New fallback: any build carrying this commit on any branch, preferring completed-successful, non-scheduled builds:
buildId=$(curl -sS "$allBuildsUrl" | jq -r --arg version "$CI_COMMIT_SHA" '
  [ .value[] | select((.triggerInfo["pr.sourceSha"] == $version) or (.sourceVersion == $version)) ]
  | ( map(select(.reason != "schedule" and .result == "succeeded"))
    + map(select(.reason == "schedule"  and .result == "succeeded"))
    + map(select(.reason != "schedule"))
    + map(select(.reason == "schedule")) )
  | .[0].id // empty')

Why most-specific-first: Azure builds can be parameterized (e.g. debug mode), so when the branch is correct we still pick the exact (branch, commit) build, preserving today's behavior. Tier 3 only fires when the precise build genuinely can't be found.

Why prefer completed-successful in tier 3: when several runs carry the same SHA, this avoids locking onto a queued/canceled/failed build that never reaches the artifact-publish stage and polling it for 40 minutes before failing. Applied only to tier 3 — tiers 1–2 intentionally wait on an in-progress build for the exact branch. If no successful build exists, tier 3 still falls back to an in-progress one rather than failing.

Test coverage

Validated against the live Azure DevOps API for the failing inputs (branch=dudik/bounded-capture-filters, sha=cf138c11):

  • Before: branch-keyed searches return 0 matches → reproduces the failure.
  • After: tier 3 resolves to build 203307, with both serverless-artifacts and ssi-artifacts confirmed present.
  • Tier-3 jq selection unit-checked: succeeded non-scheduled preferred over failed/scheduled; unknown SHA → empty; falls back to failed/in-progress when that's all that carries the SHA.
  • A bogus SHA returns empty at every tier (correct exit 1); bash -n passes on both scripts.

Notes

  • "No Azure build exists for the SHA at all" still (correctly) exits 1.
  • The benchmark check-azure-pipeline jobs do an equivalent lookup but delegate to an external wait-for-pipeline.sh (out of scope here); flagged separately for those owners.

@datadog-datadog-prod-us1-2

This comment has been minimized.

@NachoEchevarria NachoEchevarria changed the title Fix [CI] Look up serverless/single-step artifacts by commit SHA instead of branch Jun 11, 2026
@NachoEchevarria NachoEchevarria added the area:builds project files, build scripts, pipelines, versioning, releases, packages label Jun 11, 2026
@NachoEchevarria NachoEchevarria added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label Jun 11, 2026
@pr-commenter

pr-commenter Bot commented Jun 11, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-06-29 10:49:00

Comparing candidate commit 871ee93 in PR branch nacho/fixGitlabDownloadJobs with baseline commit 4ab6729 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 1 performance regressions! Performance is the same for 71 metrics, 0 unstable metrics, 58 known flaky benchmarks, 68 flaky benchmarks without significant changes.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:Benchmarks.Trace.HttpClientBenchmark.SendAsync net472

  • 🟥 throughput [-5249.165op/s; -5009.324op/s] or [-5.992%; -5.719%]

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net472

  • 🟥 throughput [-6741.713op/s; -6278.695op/s] or [-7.994%; -7.445%]

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

  • 🟥 throughput [-6211.578op/s; -4951.219op/s] or [-6.316%; -5.034%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+299.922ms; +302.674ms] or [+148.832%; +150.197%]
  • 🟥 throughput [-48.764op/s; -44.501op/s] or [-8.774%; -8.007%]

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

  • 🟥 execution_time [+377.233ms; +381.731ms] or [+298.037%; +301.591%]
  • 🟩 throughput [+86.614op/s; +91.249op/s] or [+11.420%; +12.031%]

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

  • 🟥 execution_time [+393.376ms; +396.196ms] or [+348.123%; +350.619%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net472

  • 🟥 allocated_mem [+1.308KB; +1.308KB] or [+27.528%; +27.540%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+9.976%; +9.987%]
  • 🟩 execution_time [-15.871ms; -11.690ms] or [-7.412%; -5.460%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+27.500%; +27.510%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net472

  • 🟥 allocated_mem [+1.307KB; +1.307KB] or [+105.743%; +105.758%]
  • 🟥 throughput [-264547.032op/s; -261613.212op/s] or [-27.012%; -26.712%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.557%; +38.566%]
  • 🟩 execution_time [-26.528ms; -21.639ms] or [-11.830%; -9.650%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.288%; +105.304%]
  • 🟥 throughput [-158146.767op/s; -141599.880op/s] or [-22.723%; -20.345%]

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

  • 🟩 throughput [+9500.418op/s; +12427.941op/s] or [+6.045%; +7.908%]

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

  • 🟩 throughput [+8460.159op/s; +11165.972op/s] or [+6.740%; +8.895%]

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

  • 🟩 throughput [+508503.230op/s; +523381.874op/s] or [+16.956%; +17.452%]

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

  • 🟩 execution_time [-19.339ms; -14.998ms] or [-8.915%; -6.914%]
  • 🟩 throughput [+190753.199op/s; +244764.361op/s] or [+7.572%; +9.715%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net472

  • 🟥 execution_time [+299.868ms; +300.618ms] or [+149.834%; +150.208%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net6.0

  • 🟥 execution_time [+299.960ms; +303.638ms] or [+151.271%; +153.125%]

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

  • 🟥 execution_time [+299.860ms; +303.089ms] or [+151.046%; +152.673%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net472

  • 🟥 execution_time [+296.991ms; +297.853ms] or [+145.870%; +146.294%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net6.0

  • 🟥 execution_time [+295.032ms; +298.303ms] or [+144.230%; +145.829%]

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

  • 🟥 execution_time [+301.750ms; +304.367ms] or [+150.814%; +152.122%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net6.0

  • 🟥 execution_time [+26.367µs; +50.159µs] or [+8.418%; +16.013%]
  • 🟥 throughput [-462.009op/s; -261.955op/s] or [-14.402%; -8.166%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+300.166ms; +301.013ms] or [+149.814%; +150.236%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net6.0

  • 🟥 execution_time [+414.368ms; +422.403ms] or [+450.228%; +458.958%]
  • 🟩 throughput [+617.938op/s; +853.227op/s] or [+5.078%; +7.011%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest netcoreapp3.1

  • unstable execution_time [+198.475ms; +263.256ms] or [+150.700%; +199.888%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+338.324ms; +379.999ms] or [+155.558%; +174.720%]
  • 🟥 throughput [-527.041op/s; -487.099op/s] or [-47.755%; -44.136%]

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

  • unstable execution_time [+143.641ms; +288.356ms] or [+61.214%; +122.885%]
  • 🟥 throughput [-677.942op/s; -594.106op/s] or [-45.219%; -39.627%]

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

  • 🟥 execution_time [+334.203ms; +350.724ms] or [+199.892%; +209.774%]
  • 🟥 throughput [-433.086op/s; -388.523op/s] or [-30.155%; -27.052%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+303.431ms; +304.805ms] or [+152.802%; +153.494%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net6.0

  • 🟥 execution_time [+304.347ms; +306.896ms] or [+152.509%; +153.786%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch netcoreapp3.1

  • 🟥 execution_time [+300.175ms; +303.970ms] or [+150.795%; +152.701%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+298.277ms; +301.608ms] or [+149.785%; +151.458%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net6.0

  • 🟥 execution_time [+296.442ms; +298.313ms] or [+146.577%; +147.503%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync netcoreapp3.1

  • 🟥 execution_time [+303.339ms; +307.340ms] or [+153.745%; +155.774%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+299.272ms; +301.098ms] or [+150.208%; +151.124%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net6.0

  • 🟥 execution_time [+298.132ms; +300.894ms] or [+148.591%; +149.968%]
  • 🟩 throughput [+47518.592op/s; +56629.769op/s] or [+9.436%; +11.245%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync netcoreapp3.1

  • 🟥 execution_time [+299.466ms; +301.848ms] or [+148.982%; +150.167%]

scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net6.0

  • 🟩 execution_time [-16.404ms; -12.690ms] or [-7.628%; -5.901%]
  • 🟩 throughput [+20560.033op/s; +27986.362op/s] or [+5.640%; +7.677%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net472

  • unstable execution_time [+11.201µs; +56.565µs] or [+2.767%; +13.972%]

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

  • 🟩 allocated_mem [-26.357KB; -26.335KB] or [-9.614%; -9.606%]
  • unstable execution_time [-41.103µs; +17.274µs] or [-8.124%; +3.414%]
  • unstable throughput [-55.511op/s; +153.393op/s] or [-2.770%; +7.654%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark netcoreapp3.1

  • 🟩 allocated_mem [-16.905KB; -16.886KB] or [-6.163%; -6.156%]
  • unstable execution_time [-53.753µs; +7.812µs] or [-9.315%; +1.354%]

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

  • 🟥 execution_time [+5.524µs; +9.619µs] or [+13.057%; +22.735%]
  • 🟥 throughput [-4497.030op/s; -2667.668op/s] or [-18.931%; -11.230%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark netcoreapp3.1

  • unstable execution_time [-14.575µs; -7.179µs] or [-22.613%; -11.138%]
  • 🟩 throughput [+1766.781op/s; +3390.122op/s] or [+10.840%; +20.800%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+303.390ms; +304.864ms] or [+153.350%; +154.095%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net6.0

  • 🟥 execution_time [+306.022ms; +309.055ms] or [+155.764%; +157.308%]

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

  • 🟥 execution_time [+300.883ms; +305.899ms] or [+150.629%; +153.140%]

scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net6.0

  • 🟩 throughput [+30284.315op/s; +35401.598op/s] or [+5.732%; +6.701%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+301.190ms; +303.274ms] or [+150.116%; +151.155%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net6.0

  • 🟥 execution_time [+302.085ms; +303.984ms] or [+151.693%; +152.646%]

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

  • 🟥 execution_time [+302.756ms; +304.892ms] or [+153.538%; +154.621%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+298.817ms; +300.011ms] or [+149.052%; +149.647%]
  • 🟩 throughput [+61154609.535op/s; +61499195.185op/s] or [+44.537%; +44.788%]

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

  • 🟥 execution_time [+418.671ms; +422.566ms] or [+520.692%; +525.536%]

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

  • 🟥 execution_time [+298.428ms; +299.511ms] or [+148.849%; +149.389%]
  • 🟩 throughput [+18264408.581op/s; +19248080.737op/s] or [+8.090%; +8.526%]

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

  • 🟩 throughput [+96343.978op/s; +102508.988op/s] or [+8.995%; +9.571%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope netcoreapp3.1

  • 🟩 throughput [+48841.166op/s; +68598.509op/s] or [+5.653%; +7.940%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan netcoreapp3.1

  • 🟩 throughput [+85270.880op/s; +95038.093op/s] or [+8.469%; +9.439%]

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

  • 🟩 throughput [+53354.280op/s; +59075.226op/s] or [+9.688%; +10.727%]

scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net6.0

  • 🟩 throughput [+89224.917op/s; +106224.044op/s] or [+9.969%; +11.868%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net472
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog netcoreapp3.1
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net6.0
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes netcoreapp3.1
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

@NachoEchevarria
NachoEchevarria marked this pull request as ready for review June 11, 2026 14:52
@NachoEchevarria
NachoEchevarria requested review from a team as code owners June 11, 2026 14:52

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

Copy link
Copy Markdown

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: 3c172248b7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

# So match on the commit SHA first, across all branches. A build "carries" the commit when
# it is a PR build with pr.sourceSha == SHA, or any build with sourceVersion == SHA. Prefer
# non-scheduled builds, but fall back to a scheduled build for the same SHA.
allBuildsUrl="https://dev.azure.com/datadoghq/dd-trace-dotnet/_apis/build/builds?api-version=7.1&definitions=54&\$top=200&queryOrder=queueTimeDescending"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore the branch-scoped fallback when SHA scan misses

With this URL the script only searches the latest 200 builds across the entire definition before exiting. In a GitLab pipeline for a release/hotfix/PR branch whose matching Azure build has aged past the global top 200, this now reports no build even though the previous branch-scoped query (branchName=$branchName&$top=10) would still find one because Azure filters by branch before applying $top. This can break artifact downloads for quieter branches during periods with many master/PR builds; keeping the old branch-keyed lookup as a fallback avoids that regression. The same pattern is duplicated in download-single-step-artifacts.sh.

Useful? React with 👍 / 👎.

Comment thread .gitlab/download-serverless-artifacts.sh Outdated
# non-scheduled builds, but fall back to a scheduled build for the same SHA.
allBuildsUrl="https://dev.azure.com/datadoghq/dd-trace-dotnet/_apis/build/builds?api-version=7.1&definitions=54&\$top=200&queryOrder=queueTimeDescending"
buildId=$(curl -sS "$allBuildsUrl" | jq -r --arg version "$CI_COMMIT_SHA" '
[ .value[] | select((.triggerInfo["pr.sourceSha"] == $version) or (.sourceVersion == $version)) ]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid reusing unrelated PR-merge artifacts

This SHA-only predicate can select any PR validation build whose source branch happened to point at the same commit, before the branch build for the current ref. In the inspected Azure workflow, PR jobs use steps/clone-repo.yml to merge the PR source with its target branch before building, so those artifacts are not necessarily the raw CI_COMMIT_SHA tree; if another PR with the same source SHA targets a different or newer base, this can download artifacts containing code from that unrelated target branch. Keep PR matches scoped to pr.sourceBranch == $CI_COMMIT_BRANCH, or prefer exact sourceVersion branch builds before cross-branch PR builds.

Useful? React with 👍 / 👎.

Comment on lines +32 to +33
# Artifacts are identified by the commit SHA, not the branch: the same SHA always produces
# the same artifacts regardless of which ref the pipeline ran on. A branch-keyed lookup

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure this is technically true, because we can (and do) configure Azure Devops with extra variables that change the build (e.g. enable debug mode). While that should be an edge case we can ignore, it does make me a little nervous, given the single-step-artifacts download is downloading the "real" artifacts for publish... Maybe we should reverse the fallback here - e.g. try to find by pr first, then try to find for build, and then try to find by commit only? 🤔 WDYT?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good point, agreed. I've modified it to try PR first, then the branch build, and only fall back to a commit-only (any-branch) match if those don't find anything. That keeps the exact build for the normal case and just rescues the mis-attributed-branch situation. Thanks!

Comment thread .gitlab/download-serverless-artifacts.sh Outdated
@NachoEchevarria NachoEchevarria changed the title [CI] Look up serverless/single-step artifacts by commit SHA instead of branch [CI] Add commit-only fallback when resolving serverless/single-step Azure build artifacts Jun 11, 2026
@dd-trace-dotnet-ci-bot

dd-trace-dotnet-ci-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

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

✅ No regressions detected - check the details below

Full Metrics Comparison

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration72.80 ± (73.56 - 74.96) ms70.25 ± (70.31 - 70.65) ms-3.5%
.NET Framework 4.8 - Bailout
duration74.80 ± (74.63 - 74.99) ms73.88 ± (73.75 - 74.08) ms-1.2%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1079.94 ± (1078.23 - 1084.46) ms1080.82 ± (1081.48 - 1088.43) ms+0.1%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.34 ± (22.29 - 22.38) ms22.05 ± (22.02 - 22.08) ms-1.3%
process.time_to_main_ms82.70 ± (82.45 - 82.96) ms80.78 ± (80.62 - 80.93) ms-2.3%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.93 ± (10.92 - 10.93) MB10.91 ± (10.91 - 10.92) MB-0.1%
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.02 ± (21.99 - 22.04) ms21.94 ± (21.92 - 21.96) ms-0.4%
process.time_to_main_ms82.28 ± (82.12 - 82.44) ms81.82 ± (81.69 - 81.94) ms-0.6%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.97 ± (10.96 - 10.97) MB10.95 ± (10.95 - 10.95) MB-0.1%
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms209.65 ± (208.86 - 210.43) ms209.60 ± (208.77 - 210.42) ms-0.0%
process.time_to_main_ms527.21 ± (526.04 - 528.39) ms529.95 ± (528.83 - 531.07) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.67 ± (48.64 - 48.69) MB48.74 ± (48.71 - 48.76) MB+0.1%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.6%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms21.03 ± (20.98 - 21.08) ms20.90 ± (20.87 - 20.93) ms-0.6%
process.time_to_main_ms71.75 ± (71.44 - 72.06) ms70.17 ± (70.04 - 70.29) ms-2.2%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.63 ± (10.63 - 10.63) MB10.64 ± (10.64 - 10.64) MB+0.1%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.08 ± (21.04 - 21.12) ms20.73 ± (20.70 - 20.75) ms-1.7%
process.time_to_main_ms73.75 ± (73.52 - 73.98) ms70.87 ± (70.77 - 70.97) ms-3.9%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.73 ± (10.73 - 10.74) MB10.75 ± (10.75 - 10.76) MB+0.2%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms372.45 ± (370.05 - 374.85) ms372.51 ± (369.97 - 375.05) ms+0.0%✅⬆️
process.time_to_main_ms538.39 ± (537.04 - 539.74) ms534.65 ± (533.56 - 535.74) ms-0.7%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed50.19 ± (50.16 - 50.21) MB50.17 ± (50.15 - 50.19) MB-0.0%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.0%
.NET 8 - Baseline
process.internal_duration_ms19.11 ± (19.08 - 19.15) ms19.27 ± (19.22 - 19.31) ms+0.8%✅⬆️
process.time_to_main_ms69.23 ± (69.12 - 69.35) ms71.69 ± (71.45 - 71.94) ms+3.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.68 ± (7.67 - 7.69) MB7.67 ± (7.66 - 7.67) MB-0.2%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms18.99 ± (18.96 - 19.02) ms19.12 ± (19.09 - 19.16) ms+0.7%✅⬆️
process.time_to_main_ms70.92 ± (70.73 - 71.10) ms71.54 ± (71.34 - 71.73) ms+0.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.73 ± (7.72 - 7.73) MB7.72 ± (7.71 - 7.72) MB-0.1%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms295.74 ± (293.51 - 297.97) ms300.36 ± (298.15 - 302.57) ms+1.6%✅⬆️
process.time_to_main_ms485.77 ± (484.71 - 486.82) ms481.03 ± (480.10 - 481.97) ms-1.0%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed37.16 ± (37.13 - 37.19) MB37.19 ± (37.16 - 37.21) MB+0.1%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)-0.2%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration203.90 ± (203.58 - 204.24) ms202.88 ± (202.33 - 203.28) ms-0.5%
.NET Framework 4.8 - Bailout
duration206.51 ± (206.13 - 206.90) ms205.96 ± (205.35 - 206.38) ms-0.3%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1210.40 ± (1210.60 - 1217.11) ms1202.41 ± (1202.04 - 1208.38) ms-0.7%
.NET Core 3.1 - Baseline
process.internal_duration_ms197.19 ± (196.80 - 197.59) ms196.47 ± (196.08 - 196.85) ms-0.4%
process.time_to_main_ms86.01 ± (85.69 - 86.33) ms85.61 ± (85.35 - 85.87) ms-0.5%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.02 ± (15.99 - 16.05) MB16.02 ± (15.99 - 16.05) MB-0.0%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.5%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms195.94 ± (195.55 - 196.32) ms194.39 ± (194.11 - 194.67) ms-0.8%
process.time_to_main_ms86.64 ± (86.48 - 86.81) ms86.06 ± (85.86 - 86.26) ms-0.7%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.06 ± (16.04 - 16.09) MB16.16 ± (16.13 - 16.19) MB+0.6%✅⬆️
runtime.dotnet.threads.count21 ± (20 - 21)21 ± (21 - 21)+0.5%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms389.58 ± (388.43 - 390.73) ms389.66 ± (388.62 - 390.70) ms+0.0%✅⬆️
process.time_to_main_ms546.36 ± (545.00 - 547.73) ms543.00 ± (541.90 - 544.10) ms-0.6%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.50 ± (58.26 - 58.74) MB58.28 ± (58.05 - 58.51) MB-0.4%
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+0.0%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms202.57 ± (202.10 - 203.05) ms201.53 ± (201.14 - 201.92) ms-0.5%
process.time_to_main_ms74.90 ± (74.65 - 75.15) ms74.38 ± (74.15 - 74.62) ms-0.7%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.34 ± (16.32 - 16.37) MB16.38 ± (16.35 - 16.40) MB+0.2%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-1.2%
.NET 6 - Bailout
process.internal_duration_ms201.41 ± (200.91 - 201.91) ms201.15 ± (200.76 - 201.54) ms-0.1%
process.time_to_main_ms75.44 ± (75.23 - 75.65) ms75.08 ± (74.88 - 75.28) ms-0.5%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.43 ± (16.40 - 16.45) MB16.44 ± (16.40 - 16.47) MB+0.1%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.9%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms585.51 ± (583.08 - 587.95) ms584.43 ± (581.90 - 586.96) ms-0.2%
process.time_to_main_ms555.33 ± (554.22 - 556.44) ms553.77 ± (552.71 - 554.82) ms-0.3%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.41 ± (61.32 - 61.49) MB61.47 ± (61.38 - 61.55) MB+0.1%✅⬆️
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)+0.7%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms198.88 ± (198.46 - 199.31) ms199.96 ± (199.58 - 200.34) ms+0.5%✅⬆️
process.time_to_main_ms73.61 ± (73.39 - 73.84) ms74.08 ± (73.84 - 74.33) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.76 ± (11.74 - 11.78) MB11.73 ± (11.71 - 11.75) MB-0.3%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)+0.3%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms197.92 ± (197.47 - 198.38) ms198.62 ± (198.28 - 198.96) ms+0.4%✅⬆️
process.time_to_main_ms74.44 ± (74.21 - 74.68) ms74.80 ± (74.64 - 74.96) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.78 ± (11.76 - 11.80) MB11.76 ± (11.74 - 11.78) MB-0.2%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.3%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms513.43 ± (510.70 - 516.17) ms513.61 ± (510.59 - 516.62) ms+0.0%✅⬆️
process.time_to_main_ms504.98 ± (504.17 - 505.80) ms501.46 ± (500.65 - 502.28) ms-0.7%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.93 ± (50.89 - 50.97) MB50.94 ± (50.90 - 50.98) 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 (8782) - mean (70ms)  : 68, 73
    master - mean (74ms)  : 63, 85

    section Bailout
    This PR (8782) - mean (74ms)  : 72, 76
    master - mean (75ms)  : 73, 77

    section CallTarget+Inlining+NGEN
    This PR (8782) - mean (1,085ms)  : 1036, 1134
    master - mean (1,081ms)  : 1036, 1127

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 (8782) - mean (109ms)  : 106, 112
    master - mean (112ms)  : 106, 119

    section Bailout
    This PR (8782) - mean (110ms)  : 109, 112
    master - mean (111ms)  : 109, 112

    section CallTarget+Inlining+NGEN
    This PR (8782) - mean (776ms)  : 749, 803
    master - mean (775ms)  : 751, 798

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8782) - mean (97ms)  : 94, 99
    master - mean (99ms)  : 93, 105

    section Bailout
    This PR (8782) - mean (97ms)  : 96, 99
    master - mean (102ms)  : 97, 106

    section CallTarget+Inlining+NGEN
    This PR (8782) - mean (937ms)  : 897, 976
    master - mean (942ms)  : 897, 986

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8782) - mean (98ms)  : 93, 103
    master - mean (95ms)  : 93, 97

    section Bailout
    This PR (8782) - mean (98ms)  : 93, 102
    master - mean (97ms)  : 91, 103

    section CallTarget+Inlining+NGEN
    This PR (8782) - mean (810ms)  : 775, 846
    master - mean (811ms)  : 779, 843

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 (8782) - mean (203ms)  : 198, 208
    master - mean (204ms)  : 201, 207

    section Bailout
    This PR (8782) - mean (206ms)  : 201, 211
    master - mean (207ms)  : 203, 210

    section CallTarget+Inlining+NGEN
    This PR (8782) - mean (1,205ms)  : 1163, 1247
    master - mean (1,214ms)  : 1165, 1263

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 (8782) - mean (292ms)  : 287, 298
    master - mean (293ms)  : 288, 299

    section Bailout
    This PR (8782) - mean (290ms)  : 287, 294
    master - mean (293ms)  : 289, 296

    section CallTarget+Inlining+NGEN
    This PR (8782) - mean (975ms)  : 950, 1000
    master - mean (979ms)  : 954, 1004

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8782) - mean (286ms)  : 280, 292
    master - mean (287ms)  : 281, 293

    section Bailout
    This PR (8782) - mean (286ms)  : 281, 290
    master - mean (286ms)  : 280, 292

    section CallTarget+Inlining+NGEN
    This PR (8782) - mean (1,170ms)  : 1124, 1215
    master - mean (1,173ms)  : 1134, 1211

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8782) - mean (284ms)  : 276, 293
    master - mean (283ms)  : 276, 290

    section Bailout
    This PR (8782) - mean (284ms)  : 279, 288
    master - mean (282ms)  : 276, 288

    section CallTarget+Inlining+NGEN
    This PR (8782) - mean (1,047ms)  : 1001, 1092
    master - mean (1,050ms)  : 1003, 1096

Loading

@andrewlock andrewlock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks!

Comment thread .gitlab/download-serverless-artifacts.sh

if [ -z "${buildId}" ]; then
echo "No build found for commit '$CI_COMMIT_SHA' on branch '$branchName' (including PRs)"
echo "No build found carrying commit '$CI_COMMIT_SHA' (branch '$branchName') in the recent build history"

@lucaspimentel lucaspimentel Jun 26, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The other script still says "No build found for commit..." (which sounds better to me than "carrying").

Not critical, but it would be nice to keep consistency across the scripts if possible (maybe event refactor the duplicated code into a share file someday?).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Corrected. Thanks!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Improves the GitLab CI artifact download helpers for serverless and single-step jobs by making Azure DevOps build resolution more resilient when a GitLab branch pipeline points at a commit whose artifacts were produced on a different Azure branch (e.g., due to rebase/force-push behavior).

Changes:

  • Reworks build lookup to be most-specific-first (PR build → manual/individualCI build → commit-only fallback across branches).
  • Adds a tier-3 jq selector intended to prefer successful builds to avoid long waits on builds that never publish artifacts.
  • Updates logging/error messages to reflect the new resolution strategy.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
.gitlab/download-single-step-artifacts.sh Adds tier-3 commit-only fallback build resolution to locate ssi-artifacts when branch+SHA lookup fails.
.gitlab/download-serverless-artifacts.sh Adds the same tier-3 commit-only fallback build resolution to locate serverless-artifacts when branch+SHA lookup fails.

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

Comment on lines +80 to +86
buildId=$(curl -sS "$allBuildsUrl" | jq -r --arg version "$CI_COMMIT_SHA" '
[ .value[] | select((.triggerInfo["pr.sourceSha"] == $version) or (.sourceVersion == $version)) ]
| ( map(select(.reason != "schedule" and .result == "succeeded"))
+ map(select(.reason == "schedule" and .result == "succeeded"))
+ map(select(.reason != "schedule"))
+ map(select(.reason == "schedule")) )
| .[0].id // empty')

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Preferring an in-progress build over a failed-but-complete one could make us wait needlessly. Verdict: common case already handled; the extra .status reordering isn't clearly an improvement.

Comment on lines 62 to 63
allBuildsForPrUrl="https://dev.azure.com/datadoghq/dd-trace-dotnet/_apis/build/builds?api-version=7.1&definitions=54&\$top=100&queryOrder=queueTimeDescending&reasonFilter=pullRequest"
buildId=$(curl -sS $allBuildsForPrUrl | jq --arg version $CI_COMMIT_SHA --arg branch $CI_COMMIT_BRANCH '.value[] | select(.triggerInfo["pr.sourceBranch"] == $branch and .triggerInfo["pr.sourceSha"] == $version) | .id' | head -n 1)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

pr.sourceBranch in triggerInfo is the short branch name, so matching it against CI_COMMIT_BRANCH (also short) is correct. The refs/heads/$CI_COMMIT_BRANCH form is only used for the tier-2 branchName= URL param, which genuinely requires the full ref. The code uses the right format for each field.

Comment on lines 68 to 69
allBuildsForBranchUrl="https://dev.azure.com/datadoghq/dd-trace-dotnet/_apis/build/builds?api-version=7.1&definitions=54&\$top=10&queryOrder=queueTimeDescending&branchName=$branchName&reasonFilter=manual,individualCI"
buildId=$(curl -sS $allBuildsForBranchUrl | jq --arg version $CI_COMMIT_SHA '.value[] | select(.sourceVersion == $version and .reason != "schedule") | .id' | head -n 1)
Comment on lines +61 to +67
buildId=$(curl -sS "$allBuildsUrl" | jq -r --arg version "$CI_COMMIT_SHA" '
[ .value[] | select((.triggerInfo["pr.sourceSha"] == $version) or (.sourceVersion == $version)) ]
| ( map(select(.reason != "schedule" and .result == "succeeded"))
+ map(select(.reason == "schedule" and .result == "succeeded"))
+ map(select(.reason != "schedule"))
+ map(select(.reason == "schedule")) )
| .[0].id // empty')
Comment on lines +42 to 44
# 1. PR build for this branch + commit
allBuildsForPrUrl="https://dev.azure.com/datadoghq/dd-trace-dotnet/_apis/build/builds?api-version=7.1&definitions=54&\$top=100&queryOrder=queueTimeDescending&reasonFilter=pullRequest"
buildId=$(curl -sS $allBuildsForPrUrl | jq --arg version $CI_COMMIT_SHA --arg branch $CI_COMMIT_BRANCH '.value[] | select(.triggerInfo["pr.sourceBranch"] == $branch and .triggerInfo["pr.sourceSha"] == $version) | .id' | head -n 1)
Comment on lines 49 to 50
allBuildsForBranchUrl="https://dev.azure.com/datadoghq/dd-trace-dotnet/_apis/build/builds?api-version=7.1&definitions=54&\$top=10&queryOrder=queueTimeDescending&branchName=$branchName&reasonFilter=manual,individualCI"
buildId=$(curl -sS $allBuildsForBranchUrl | jq --arg version $CI_COMMIT_SHA '.value[] | select(.sourceVersion == $version and .reason != "schedule") | .id' | head -n 1)
@NachoEchevarria

Copy link
Copy Markdown
Collaborator Author

Thanks for the feedback and reviews

@NachoEchevarria
NachoEchevarria merged commit 90d7fcb into master Jun 29, 2026
140 checks passed
@NachoEchevarria
NachoEchevarria deleted the nacho/fixGitlabDownloadJobs branch June 29, 2026 13:02
@github-actions github-actions Bot added this to the vNext-v3 milestone Jun 29, 2026
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