Skip to content

Move symbol publishing into a dedicated stage and refactor build artifacts#4175

Merged
paulmedynski merged 14 commits intomainfrom
dev/paul/symbols-publishing
Apr 20, 2026
Merged

Move symbol publishing into a dedicated stage and refactor build artifacts#4175
paulmedynski merged 14 commits intomainfrom
dev/paul/symbols-publishing

Conversation

@paulmedynski
Copy link
Copy Markdown
Contributor

@paulmedynski paulmedynski commented Apr 9, 2026

Summary

Adds a dedicated Publish Symbols stage to the OneBranch pipelines, extracts and refactors build artifact layout, and fixes several signing/pattern issues discovered during validation.

Changes

Symbols Publishing Stage

  • Extract symbol publishing from build jobs into a new publish_symbols stage (publish-symbols-stage.yml) with per-package jobs (publish-symbols-job.yml).
  • Extract inline PowerShell into publish-symbols.ps1 script with structured error handling and Pester tests.
  • Document the two-step process (upload via PublishSymbols@2, then publish to SymWeb/MSDL via REST API) in step template and script.
  • Guard stage against empty runs when no packages were built (no-op placeholder job).
  • Append $(System.JobAttempt) to symbol artifact names for retry safety.
  • Use PPE symbol server endpoints for non-official pipeline, Prod for official.
  • Disable APIScan and BinSkim in symbols jobs (they only upload PDBs, no assemblies to scan).

Build Artifact Reorganization

  • Reorganize JOB_OUTPUT subdirectories: assemblies/ (APIScan), packages/ (NuGet), symbols/ (PDBs shared by APIScan and symbol publishing).
  • Point APIScan at JOB_OUTPUT/assemblies and JOB_OUTPUT/symbols; remove copy-apiscan-files-sqlclient-step.yml.
  • Rename PACK_OUTPUTJOB_OUTPUT, PACK_INPUTJOB_INPUT for clarity.
  • Remove artifactPath variable from validate job in favor of packagesPath.

File Pattern and Signing Fixes

  • Tighten searchPattern globs in symbols stage to exact PDB filenames, preventing unrelated PDBs (e.g. native SNI) from being uploaded.
  • Fix CopyFiles and ESRP DLL signing patterns to exclude native SNI DLLs from SqlClient symbols and signing.
  • Include resource DLLs (satellite assemblies) in ESRP signing and APIScan scanning.
  • Add UseMinimatch: true to all EsrpCodeSigning@6 and EsrpMalwareScanning@6 tasks; update patterns to minimatch globs.
  • Add diagnostic step that logs matched PDB files before upload.

Release Stage Updates

  • release stage now depends on both mds_package_validation and publish_symbols.
  • publish_symbols stage always emits when the flag is set.

Documentation and Cleanup

  • Rename variable group symbols-variables-v2Symbols Publishing.
  • Fix variable name comments and script casing across pipeline and instruction files.
  • Add comments documenting pattern/glob fields across pipeline files.

Follow-up

Testing

  • Pester unit tests for publish-symbols.ps1 (success, transient failure, and terminal failure scenarios).
  • Validated via Non-Official pipeline runs on dev/paul/symbols-publishing branch.

@paulmedynski paulmedynski added this to the 7.1.0-preview1 milestone Apr 9, 2026
Copilot AI review requested due to automatic review settings April 9, 2026 19:50
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Apr 9, 2026
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 refactors the OneBranch pipeline artifact layout and moves symbol publishing out of individual build jobs into a dedicated publish_symbols stage, aligning APIScan and symbol publishing to consume standardized JOB_OUTPUT subfolders.

Changes:

  • Introduces a dedicated publish_symbols stage with per-package symbol publishing jobs, driven by a shared step/script.
  • Renames PACK_INPUT/PACK_OUTPUT to JOB_INPUT/JOB_OUTPUT and reorganizes outputs into assemblies/, packages/, and symbols/.
  • Updates build/release/validation templates to consume packages from packages/ and symbols from symbols/, removing the old SqlClient APIScan copy step.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
eng/pipelines/onebranch/variables/onebranch-variables.yml Switches symbol credentials variable group reference to Symbols Publishing.
eng/pipelines/onebranch/variables/common-variables.yml Renames PACK_* vars to JOB_* and documents new JOB_OUTPUT subfolder conventions.
eng/pipelines/onebranch/steps/tests/README.md Adds documentation for running Pester tests for symbol publishing script.
eng/pipelines/onebranch/steps/tests/Publish-Symbols.Tests.ps1 Adds Pester tests validating Publish-Symbols behavior via mocks.
eng/pipelines/onebranch/steps/Publish-Symbols.ps1 Extracts symbol publishing logic into a standalone script with structured error handling.
eng/pipelines/onebranch/steps/publish-symbols-step.yml Refactors publish step to call the extracted script and adds symbolsFolder parameter.
eng/pipelines/onebranch/steps/pack-sqlclient-step.yml Copies SqlClient NuGet outputs into $(JOB_OUTPUT)/packages.
eng/pipelines/onebranch/steps/pack-csproj-step.yml Packs csproj-based packages into $(JOB_OUTPUT)/packages.
eng/pipelines/onebranch/steps/copy-apiscan-files-sqlclient-step.yml Removes legacy APIScan file copy step (deleted).
eng/pipelines/onebranch/stages/release-stages.yml Updates release stage to push packages from the packages/ subdirectory.
eng/pipelines/onebranch/stages/publish-symbols-stage.yml Adds new stage template to publish symbols per package from downloaded build artifacts.
eng/pipelines/onebranch/stages/build-stages.yml Removes in-job symbol publishing parameters and job wiring (moved to stage).
eng/pipelines/onebranch/sqlclient-official.yml Wires in the new publish-symbols-stage.yml between build and release stages.
eng/pipelines/onebranch/sqlclient-non-official.yml Wires in the new publish-symbols-stage.yml between build and release stages.
eng/pipelines/onebranch/jobs/validate-signed-package-job.yml Updates validation job to locate packages under <artifact>/packages.
eng/pipelines/onebranch/jobs/publish-symbols-job.yml Adds per-package symbols publishing job template (download artifact + publish step).
eng/pipelines/onebranch/jobs/publish-nuget-package-job.yml Updates release job to treat packages as living under packages/ within artifacts.
eng/pipelines/onebranch/jobs/build-signed-sqlclient-package-job.yml Updates APIScan folder vars and copies DLLs/PDBs into JOB_OUTPUT subfolders; removes symbol publishing.
eng/pipelines/onebranch/jobs/build-signed-csproj-package-job.yml Updates APIScan folder vars and copies DLLs/PDBs into JOB_OUTPUT subfolders; removes symbol publishing.
.github/instructions/onebranch-pipeline-design.instructions.md Updates OneBranch pipeline design docs for new symbols stage and artifact layout.

Comment thread eng/pipelines/onebranch/stages/publish-symbols-stage.yml
Comment thread eng/pipelines/onebranch/stages/publish-symbols-stage.yml Outdated
Comment thread eng/pipelines/onebranch/jobs/publish-symbols-job.yml Outdated
Comment thread eng/pipelines/onebranch/steps/Publish-Symbols.ps1 Outdated
…facts

- Extract symbol publishing from build jobs into a new publish_symbols stage
  (publish-symbols-stage.yml) with per-package jobs (publish-symbols-job.yml)
- Reorganize JOB_OUTPUT subdirectories: assemblies/ (APIScan), packages/ (NuGet),
  symbols/ (PDBs shared by APIScan and symbol publishing)
- Point APIScan at JOB_OUTPUT/assemblies and JOB_OUTPUT/symbols instead of
  separate apiScan/ tree; remove copy-apiscan-files-sqlclient-step.yml
- Rename PACK_OUTPUT -> JOB_OUTPUT, PACK_INPUT -> JOB_INPUT for clarity
- Extract inline PowerShell into Publish-Symbols.ps1 with structured error
  handling; add Pester tests
- Rename variable group symbols-variables-v2 -> Symbols Publishing
- Remove artifactPath variable from validate job in favor of packagesPath
- Append $(System.JobAttempt) to symbol artifact names for retry safety
- Guard publish_symbols stage against empty runs when no packages were built
@paulmedynski paulmedynski force-pushed the dev/paul/symbols-publishing branch from 0dccecb to bbf6303 Compare April 10, 2026 11:18
Copilot AI review requested due to automatic review settings April 10, 2026 11:22
@paulmedynski paulmedynski moved this from To triage to In progress in SqlClient Board Apr 10, 2026
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

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

Comment thread eng/pipelines/onebranch/scripts/publish-symbols.ps1
Comment thread eng/pipelines/onebranch/scripts/tests/README.md
@paulmedynski paulmedynski moved this from In progress to In review in SqlClient Board Apr 10, 2026
@paulmedynski paulmedynski marked this pull request as ready for review April 10, 2026 12:02
@paulmedynski paulmedynski requested a review from a team as a code owner April 10, 2026 12:02
Copilot AI review requested due to automatic review settings April 10, 2026 12:02
@paulmedynski paulmedynski added the Hotfix Candidate 🚑 Issues/PRs that are candidate for backporting to earlier supported versions. label Apr 10, 2026
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

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

Comment thread eng/pipelines/onebranch/jobs/publish-nuget-package-job.yml
Copilot AI review requested due to automatic review settings April 10, 2026 13:56
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

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

Comment thread eng/pipelines/onebranch/scripts/tests/README.md
…ols jobs

- Add canonical docs link and two-step process documentation to
  publish-symbols-step.yml and publish-symbols.ps1
- Rename task display names to Step 1/Step 2 for clarity
- Disable APIScan and BinSkim in publish-symbols-job.yml since
  symbols jobs only upload/publish PDBs with no assemblies to scan
Copilot AI review requested due to automatic review settings April 10, 2026 18:26
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

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

Comment thread eng/pipelines/onebranch/variables/onebranch-variables.yml Outdated
Comment thread .github/instructions/onebranch-pipeline-design.instructions.md Outdated
@paulmedynski
Copy link
Copy Markdown
Contributor Author

Successful run using PPE for symbols publishing is here:

https://sqlclientdrivers.visualstudio.com/ADO.Net/_build/results?buildId=148117&view=results

- Update SymbolsPublishServer/SymbolsPublishTokenUri to their actual
  suffixed names (Prod/PPE) in onebranch-variables.yml header comment
- Fix Publish-Symbols.ps1 -> publish-symbols.ps1 casing in
  onebranch-pipeline-design.instructions.md
Copilot AI review requested due to automatic review settings April 16, 2026 22:02
@paulmedynski paulmedynski enabled auto-merge (squash) April 16, 2026 22:02
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

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

Comment thread eng/pipelines/onebranch/jobs/publish-nuget-package-job.yml
Comment thread eng/pipelines/onebranch/stages/publish-symbols-stage.yml
- Tighten searchPattern globs in publish-symbols-stage.yml to use exact
  PDB filenames (e.g. '**/X.pdb' instead of '**/X*.pdb'), preventing
  unrelated PDBs (such as native SNI PDBs) from being uploaded to the
  symbol server.

- Fix CopyFiles pattern in build-signed-sqlclient-package-job.yml to
  copy only Microsoft.Data.SqlClient.pdb, excluding SNI PDBs from the
  symbols artifact.

- Fix ESRP DLL signing pattern in build-signed-sqlclient-package-job.yml
  to sign only SqlClient and its resource DLLs, not native SNI DLLs
  (which are signed in their own package).

- Include resource DLLs (satellite assemblies) in ESRP signing and
  APIScan scanning for both the SqlClient and generic csproj build jobs
  using brace expansion ({,.resources}.dll) and multi-line Contents.

- Add a diagnostic step in publish-symbols-step.yml that logs all PDB
  files matching the search pattern before upload, converting the glob
  to a regex for correct cross-platform matching.

- Add comments to all pattern/glob fields across pipeline files
  documenting what each pattern matches, what it excludes, and why
  resource DLLs are included or not.
Copilot AI review requested due to automatic review settings April 17, 2026 12:22
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

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

Comment thread eng/pipelines/onebranch/jobs/build-signed-csproj-package-job.yml Outdated
Comment thread eng/pipelines/onebranch/jobs/build-signed-sqlclient-package-job.yml Outdated
Add UseMinimatch: true to all EsrpCodeSigning@6 and EsrpMalwareScanning@6
task inputs in esrp-dll-signing-step.yml and esrp-nuget-signing-step.yml.

Update callers to use minimatch glob patterns:
- DLL signing: multi-line patterns with **/ for recursive directory matching,
  replacing shell-style brace expansion ({,.resources}).
- NuGet signing: [0-9]* anchors to the version segment to avoid matching
  similarly-prefixed packages (e.g. Microsoft.Data.SqlClient.SNI), and ?(s)
  extglob matches both .nupkg and .snupkg.
@paulmedynski paulmedynski merged commit eacf112 into main Apr 20, 2026
7 checks passed
@paulmedynski paulmedynski deleted the dev/paul/symbols-publishing branch April 20, 2026 05:36
@github-project-automation github-project-automation Bot moved this from In review to Done in SqlClient Board Apr 20, 2026
github-actions Bot added a commit that referenced this pull request Apr 20, 2026
To resolve, run:  git cherry-pick eacf112
github-actions Bot added a commit that referenced this pull request Apr 20, 2026
To resolve, run:  git cherry-pick eacf112
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area\Engineering Use this for issues that are targeted for changes in the 'eng' folder or build systems. Hotfix 6.1.5 Hotfix 7.0.1 When this PR merges, automatically open a PR to cherry-pick to the 7.0.1 branch

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants