Add sqlclient-perf-pr pipeline comparing against main branch source - #4519
Add sqlclient-perf-pr pipeline comparing against main branch source#4519cheenamalhotra wants to merge 3 commits into
Conversation
Introduces eng/pipelines/perf/sqlclient-perf-pr-pipeline.yml, a PR-oriented variant of the perf pipeline. It extends the same Perf.Test.Job.yml template and exposes the same configuration options, but: * runs against the branch the run is queued on (manual/queue-time only), * uses the 'main' branch SOURCE as the baseline instead of a released package, * does not ingest results into Kusto (no ADX variable group, no translate/ publish/ingest steps). To support this, the on-VM run scripts gain a second baseline selector: * run-perf-tests.sh: --baseline-source-ref / --baseline-repo-url * run-perf-tests.ps1: -BaselineSourceRef / -BaselineRepoUrl The selector is mutually exclusive with the existing package baseline. The baseline ref is materialised outside the checkout (git worktree from the checkout's origin, falling back to a shallow clone) and that ref's own PerformanceTests project is built, so the measured driver is the baseline source. The comparison is labelled '<ref>@<sha>' so the exact baseline commit is recorded. README documents both pipelines, the source-baseline mechanism, the PR-only parameters, and new troubleshooting entries. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 08b18803-3735-44b6-8afc-1996ef05fe15
There was a problem hiding this comment.
Pull request overview
Adds a PR-oriented performance pipeline that runs the existing SqlClient perf benchmark suite against the queued branch (“current”) and compares it to a source baseline from another ref in this repo (default main), without ingesting results into Kusto. This fits into the existing eng/pipelines/perf/ perf automation by reusing the same Perf Test Lab extends template and the same on-VM run scripts.
Changes:
- Introduces
sqlclient-perf-pr-pipeline.yml, a manual-only perf pipeline variant using source-baseline comparison and publishing artifacts/summaries only (no Kusto). - Extends the on-VM run scripts (
run-perf-tests.sh/.ps1) with a mutually-exclusive baseline selector that can materialize/build a baseline from another git ref’s source. - Updates perf pipeline documentation to describe the new PR pipeline and the new baseline-source mechanism.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| eng/pipelines/perf/sqlclient-perf-pr-pipeline.yml | New manual-only PR perf pipeline wiring source-baseline parameters into the existing PerfTemplates job, omitting Kusto steps. |
| eng/pipelines/perf/scripts/run-perf-tests.sh | Adds --baseline-source-ref / --baseline-repo-url support and refactors baseline execution to allow package or source baselines. |
| eng/pipelines/perf/scripts/run-perf-tests.ps1 | Windows equivalent support for source-baseline acquisition (origin fetch/worktree + clone fallback) and baseline execution refactor. |
| eng/pipelines/perf/README.md | Documents the PR pipeline, source-baseline behavior, and troubleshooting updates. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4519 +/- ##
==========================================
- Coverage 64.73% 62.72% -2.02%
==========================================
Files 288 283 -5
Lines 44088 67041 +22953
==========================================
+ Hits 28542 42051 +13509
- Misses 15546 24990 +9444
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ch category * Build tag now records the baseline COMMIT, not just the ref. The pipeline cannot know the resolved SHA at compile time, so the run scripts write the resolved '<ref>@<sha>' label to <results>/baseline-label.txt and the post-test step reads it after the results are copied back. Falls back to the requested ref (with a warning) if the run never got as far as resolving the baseline. * _branch_category() in perf_to_kusto.py now strips the internal ADO mirror's 'internal/' prefix, so 'internal/main' maps to 'main' and 'internal/release/*' maps to 'release' instead of falling through to 'other'. Reviewer feedback on baselineRepoUrl (allowlist) and on consolidating the two perf pipelines was discussed and resolved as no-change: the pipeline is internal-only, and the shared logic already lives in the perf runner scripts. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 08b18803-3735-44b6-8afc-1996ef05fe15
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.
Suppressed comments (1)
eng/pipelines/perf/README.md:298
- README says the PR pipeline build is tagged
Baseline <ref>, but the pipeline/script normally resolves and tagsBaseline <ref>@<short-sha>(falling back to<ref>only when baseline-label.txt is missing). This is inconsistent with the earlier “Source baseline” section and could mislead users when looking for the tag.
3. After the run, review the **run summary** (comparison, labelled `<ref>@<short-sha>`) and the
`perf-results` artifact. The build is tagged **`Baseline <ref>`**.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.
Suppressed comments (2)
eng/pipelines/perf/scripts/perf_to_kusto.py:152
- _branch_category strips the internal ADO mirror prefix ("internal/") after the pull-request detection. If a mirrored PR ref is named like "internal/pull/...", it will be categorized as "other" instead of "pull_request".
Strip the "internal/" prefix before checking for pull-request refs so both internal and public naming patterns are bucketed consistently.
name = branch_name
for prefix in ("refs/heads/", "refs/"):
if name.startswith(prefix):
name = name[len(prefix):]
break
if name.startswith("pull/") or branch_name.startswith("refs/pull/"):
return "pull_request"
# The internal ADO mirror prefixes its branches with 'internal/', so 'internal/main' and
# 'internal/release/*' are the same branches as their public counterparts and must land in the
# same buckets - otherwise mirrored runs would all be categorised as 'other'.
if name.startswith("internal/"):
name = name[len("internal/"):]
if name == "main" or name == "master":
eng/pipelines/perf/README.md:319
- This section says the PR pipeline build is tagged
Baseline <ref>, but the PR pipeline actually tagsBaseline <ref>@<short-sha>whenbaseline-label.txtis present (and only falls back toBaseline <ref>when the baseline SHA can't be resolved). The README should match what users will see in the ADO build list.
`perf-results` artifact. The build is tagged **`Baseline <ref>`**.
Summary
Introduces a PR-oriented variant of the perf pipeline:
eng/pipelines/perf/sqlclient-perf-pr-pipeline.yml.Pipeline in ADO: sqlclient-perf-pr
Purpose: To be used to run perf tests to capture benchmarks for PRs, personal braches, and publish comparison results locally against dotnet/sqlclient:main branch.
It extends the same
v1/Perf.Test.Job.yml@PerfTemplatestemplate and exposes the same configuration options assqlclient-perf-pipeline.yml(platform, framework, run mode, confirmation runs, regression threshold/gate, managed SNI, optimized async behaviour, connection pool V2), but:pr: none,trigger: none).mainbranch source code as the baseline instead of a released NuGet package.Source baseline mechanism
The perf template only exposes post-test steps, so both benchmark passes must happen inside the on-VM script. The run scripts therefore gain a second, mutually-exclusive baseline selector:
run-perf-tests.sh--baseline-source-ref,--baseline-repo-urlrun-perf-tests.ps1-BaselineSourceRef,-BaselineRepoUrlWhen a source ref is given, the script materialises that ref outside the checkout (so it can never be picked up by the candidate build or the results copy-back):
git fetch --no-tags --depth 1 origin '+refs/heads/<ref>:refs/remotes/perfbaseline/<ref>'+git worktree add --detach— uses the copied checkout's ownorigin.git clone --quiet --depth 1 --branch <ref> <baselineRepoUrl>when the tree arrived without.gitororiginneeds credentials the VM lacks.The baseline pass then builds that ref's own
PerformanceTestsproject, whose defaultProjectReferencepoints at that ref's driver source. This keepsinterleave_perf.py's--baseline-exe-dir/--current-exe-dircontract unchanged, and both passes still use the same injectedRUNNER_CONFIG/DATATYPES_CONFIGso configuration is identical on both sides.The comparison is labelled
<ref>@<sha>(e.g.main@9b20e5ec3) so each run records exactly which baseline commit it measured against.The existing package baseline (
--baseline-version->ReferenceType=Package+MdsPackageVersion) is unchanged; supplying both selectors fails fast.Verification
bash -nonrun-perf-tests.sh; PowerShell parser check onrun-perf-tests.ps1.gitbeing a file in a worktreedotnet buildof the perf project from a detached worktree into a separate output dir — 0 warnings, 0 errors, ~13sNotes for reviewers
eng/pipelines/perf/sqlclient-perf-pr-pipeline.yml..git-present path and the GitHub clone fallback.compare_perf.pyreports them asnew/removedrather than failing.Checklist
sqlclient-perfpipeline and its package-baseline path are unchangedeng/pipelines/perf/README.mdcovers both pipelines, the source-baseline mechanism, PR-only parameters, and new troubleshooting entries