Support GitHub/GitLab/Azure DevOps/Bitbucket Server SourceLink variants - #8505
Support GitHub/GitLab/Azure DevOps/Bitbucket Server SourceLink variants#8505OmerRaviv wants to merge 1 commit into
Conversation
Extends SourceLink URL parsers to cover on-prem and enterprise URL
variants emitted by real-world PDBs that the existing parsers rejected:
- GitHub: GitHub Enterprise with subdomain isolation (raw.{host}) and
main-host /raw/ path form, in addition to raw.githubusercontent.com
- Azure DevOps: TFS on-prem, virtual directories, collections, custom
ports - handled uniformly via a single /_apis/git/repositories/
anchor instead of host-specific branching
- GitLab: new /-/raw/ path format (>= 12.0) and nested groups/subgroups
- Bitbucket Server: new parser for /projects/{p}/repos/{r}/raw/*?at=
(>= 4.7) and /browse/*?at=&raw (< 4.7), with base path support
Also fixes a latent bug in SourceLinkInformationExtractor where an
InformationalVersion like "1.0.0+" (empty after the plus) was treated
as a valid but empty commit SHA.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8505) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-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:
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 chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8505) - mean (73ms) : 70, 76
master - mean (75ms) : 71, 79
section Bailout
This PR (8505) - mean (79ms) : 75, 83
master - mean (78ms) : 75, 81
section CallTarget+Inlining+NGEN
This PR (8505) - mean (1,076ms) : 1017, 1135
master - mean (1,078ms) : 1025, 1130
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 (8505) - mean (117ms) : 111, 123
master - mean (116ms) : 110, 121
section Bailout
This PR (8505) - mean (118ms) : 112, 124
master - mean (114ms) : 111, 117
section CallTarget+Inlining+NGEN
This PR (8505) - mean (777ms) : 748, 805
master - mean (778ms) : 755, 801
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8505) - mean (102ms) : 97, 106
master - mean (101ms) : 97, 104
section Bailout
This PR (8505) - mean (105ms) : 101, 109
master - mean (104ms) : 97, 110
section CallTarget+Inlining+NGEN
This PR (8505) - mean (938ms) : 903, 974
master - mean (937ms) : 901, 974
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8505) - mean (101ms) : 95, 106
master - mean (102ms) : 96, 108
section Bailout
This PR (8505) - mean (101ms) : 98, 104
master - mean (101ms) : 99, 104
section CallTarget+Inlining+NGEN
This PR (8505) - mean (823ms) : 786, 861
master - mean (823ms) : 790, 856
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 (8505) - mean (201ms) : 193, 209
master - mean (206ms) : 193, 219
section Bailout
This PR (8505) - mean (204ms) : 196, 212
master - mean (206ms) : 197, 216
section CallTarget+Inlining+NGEN
This PR (8505) - mean (1,192ms) : 1130, 1255
master - mean (1,200ms) : 1144, 1256
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 (8505) - mean (287ms) : 274, 301
master - mean (292ms) : 274, 310
section Bailout
This PR (8505) - mean (289ms) : 276, 303
master - mean (295ms) : 277, 313
section CallTarget+Inlining+NGEN
This PR (8505) - mean (948ms) : 920, 975
master - mean (956ms) : 937, 976
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8505) - mean (282ms) : 266, 299
master - mean (288ms) : 270, 306
section Bailout
This PR (8505) - mean (281ms) : 269, 292
master - mean (288ms) : 270, 305
section CallTarget+Inlining+NGEN
This PR (8505) - mean (1,149ms) : 1093, 1205
master - mean (1,158ms) : 1100, 1216
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8505) - mean (282ms) : 267, 298
master - mean (285ms) : 266, 305
section Bailout
This PR (8505) - mean (280ms) : 269, 290
master - mean (287ms) : 266, 308
section CallTarget+Inlining+NGEN
This PR (8505) - mean (1,037ms) : 991, 1082
master - mean (1,051ms) : 980, 1123
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BenchmarksBenchmark execution time: 2026-04-23 05:26:30 Comparing candidate commit 647d1c7 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 27 metrics, 0 unstable metrics, 58 known flaky benchmarks, 29 flaky benchmarks without significant changes.
|
Summary of changes
Extends the SourceLink URL parsers under
tracer/src/Datadog.Trace/PDBs/SourceLink/to cover on-prem and enterprise URL variants emitted by real-world PDBs that the existing parsers rejected.raw.{host}/...) and main-host path form ({host}/raw/...), in addition to the existingraw.githubusercontent.com/_apis/git/repositories/anchor instead of host-specific branching/-/raw/path format (GitLab ≥ 12.0) and arbitrary nested groups/subgroups/projects/{p}/repos/{r}/raw/*?at=SHA(≥ 4.7) and/browse/*?at=SHA&raw(< 4.7), with support for base path deploymentsAlso fixes a latent bug in
SourceLinkInformationExtractorwhere anInformationalVersionlike"1.0.0+"(empty after the plus) was treated as a valid-but-empty commit SHA.Reason for change
Several users have PDBs that embed SourceLink URLs from GHE / GitLab self-hosted / Azure DevOps Server / Bitbucket Server. The old parsers only handled the canonical cloud variants, so the repository URL and commit SHA were not surfaced from those PDBs.
Implementation details
/_apis/git/repositories/anchor. Everything before_apisbecomes the project prefix path (supporting/{vdir}/{collection}/{project}/...); the repo URL is{scheme}://{authority}{prefix}/_git/{repo}./{owner}/{repo}/{sha}/*and/raw/{owner}/{repo}/{sha}/*layouts.LastIndexOf("/-/raw/")thenLastIndexOf("/raw/"), with a trimmed segment count to ensure at least{group}/{repo}before the anchor./projects/to precede/repos/, walks the query string once to extractat={sha}and — for the/browse/variant — a standalonerawflag (not a substring match).Test coverage
Datadog.Trace.Tests.Pdb.SourceLink.*(covering each parser individually and via the composite router).Datadog.Trace.ClrProfiler.Managed.Tests.SourceLinkInformationExtractorTests(assembly-attribute extraction).-/raw/and nested groups, Bitbucket Server ≥ 4.7 and < 4.7 with base paths and varied query-param ordering.raw.with too few segments, missing/projects/prefix,raws=false-positive check, emptyInformationalVersionmetadata.All 121 tests pass locally on
net10.0.Other details
Datadog.Trace.ClrProfiler.Managed.Tests/SourceLinkInformationExtractorTests.cswas previously untracked in the working tree; it's now included and the extractor bug it surfaces is fixed.🤖 Generated with Claude Code