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 1 commit 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:
|
| # colon trips ADO's "potentially dangerous Request.Path" filter. | ||
| - ${{ if ne(parameters.baselineSourceRef, '') }}: | ||
| - bash: | | ||
| echo "##vso[build.addbuildtag]Baseline ${{ parameters.baselineSourceRef }}" |
There was a problem hiding this comment.
Build tag omits the baseline commit, so every run is tagged identically
The tag is evaluated at compile time from the parameter, so with the default it is Baseline main on every run. It doesn't distinguish which main commit was measured, which is exactly what the <ref>@<sha> label exists to capture.
Consider dropping the tag here, or having the on-VM script emit ##vso[build.addbuildtag] with the resolved short SHA once it is known.
There was a problem hiding this comment.
This one does make sense. It's good to have a reference somewhere to the sha of the baseline.
There was a problem hiding this comment.
Yes, I'll update tag to sha instead.
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