Skip to content

FEAT: Migrate Release (and dummy) Pipelines to use ReleaseJob#511

Open
gargsaumya wants to merge 1 commit intomainfrom
saumya/fix-release-failure
Open

FEAT: Migrate Release (and dummy) Pipelines to use ReleaseJob#511
gargsaumya wants to merge 1 commit intomainfrom
saumya/fix-release-failure

Conversation

@gargsaumya
Copy link
Copy Markdown
Contributor

@gargsaumya gargsaumya commented Apr 10, 2026

Work Item / Issue Reference

AB#43946

GitHub Issue: #<ISSUE_NUMBER>


Summary

This pull request restructures both the dummy and official release pipelines to improve clarity, enforce OneBranch policy requirements, and streamline artifact handling. The main changes include splitting the pipelines into explicit preparation/validation and release jobs, ensuring ESRP release steps run on the correct pool, updating artifact paths, and enhancing dry run handling.

Pipeline Restructuring and Policy Compliance:

  • Split the pipelines into two explicit jobs: PrepAndValidate (for downloading, validating, and staging artifacts using a custom pool) and a release job (DummyRelease or PyPIRelease) that runs on a 1ES hosted pool as required by OneBranch policy. ESRP release steps are now only in the release job, which depends on the preparation job. (OneBranchPipelines/dummy-release-pipeline.yml, OneBranchPipelines/official-release-pipeline.yml) [1] [2] [3] [4]

  • ESRP release jobs now use templateContext.type: releaseJob and ensure artifact download and publishing steps are run in the correct environment, preventing accidental production releases from test pipelines. (OneBranchPipelines/dummy-release-pipeline.yml, OneBranchPipelines/official-release-pipeline.yml) [1] [2]

Artifact Path and Handling Updates:

  • Changed artifact and wheel file paths throughout the pipelines to use the new consolidated artifact location ($(Build.SourcesDirectory)/artifacts/dist) instead of the previous dist folder. This affects validation, ESRP release, and summary steps. (OneBranchPipelines/dummy-release-pipeline.yml, OneBranchPipelines/official-release-pipeline.yml) [1] [2] [3]

  • Removed unnecessary steps for copying wheels to a separate dist folder, as the new artifact structure makes this redundant. (OneBranchPipelines/official-release-pipeline.yml)

Dry Run and Summary Improvements:

  • Enhanced dry run handling: when release parameters are disabled, a clear summary is shown and release steps are skipped. This logic is now more explicit and avoids accidental releases. (OneBranchPipelines/dummy-release-pipeline.yml, OneBranchPipelines/official-release-pipeline.yml) [1] [2] [3] [4]

Step Renumbering and Minor Cleanups:

  • Updated step numbers and comments for clarity and consistency after restructuring, and removed obsolete or duplicate summary steps. (OneBranchPipelines/dummy-release-pipeline.yml, OneBranchPipelines/official-release-pipeline.yml) [1] [2] [3] [4]

These changes make the pipelines more robust, easier to understand, and compliant with internal release policies.

Copilot AI review requested due to automatic review settings April 10, 2026 11:11
@github-actions github-actions bot added the pr-size: medium Moderate update size 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

This PR migrates the official and dummy OneBranch release pipelines to a two-job structure that separates artifact preparation/validation from ESRP publishing, using releaseJob for policy-compliant ESRP execution.

Changes:

  • Split pipelines into PrepAndValidate (custom pool) + PyPIRelease/DummyRelease (templateContext.type: releaseJob on hosted pool).
  • Standardized wheel release input to $(Build.SourcesDirectory)/artifacts/dist and removed some redundant staging steps.
  • Improved dry-run messaging when release parameters are disabled.

Reviewed changes

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

File Description
OneBranchPipelines/official-release-pipeline.yml Restructures official release into prep/validate + ESRP release job; updates artifact paths and summaries.
OneBranchPipelines/dummy-release-pipeline.yml Mirrors the restructure for the dummy pipeline; moves ESRP step into a release job and updates artifact paths/summaries.

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

Write-Host "Verifying wheel file integrity..."

$wheels = Get-ChildItem -Path "$(Build.SourcesDirectory)/dist" -Filter "*.whl"
$wheels = Get-ChildItem -Path "$(Build.SourcesDirectory)/artifacts/dist" -Filter "*.whl"
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

The wheel integrity step will succeed even if no wheels are present (Get-ChildItem returns empty → loop never runs → $allValid stays true). Add an explicit check to fail fast when no *.whl files are found in artifacts/dist, so a release can’t proceed with an empty or mis-downloaded artifact set.

Suggested change
$wheels = Get-ChildItem -Path "$(Build.SourcesDirectory)/artifacts/dist" -Filter "*.whl"
$wheels = @(Get-ChildItem -Path "$(Build.SourcesDirectory)/artifacts/dist" -Filter "*.whl")
if ($wheels.Count -eq 0) {
Write-Error "No wheel files were found in $(Build.SourcesDirectory)/artifacts/dist. Failing release to prevent publishing with empty or missing artifacts."
exit 1
}

Copilot uses AI. Check for mistakes.
dependsOn: PrepAndValidate

templateContext:
type: releaseJob
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

For a non-official/test pipeline, consider explicitly setting templateContext.isProduction: false (if supported by the OneBranch template) on this releaseJob. This makes it harder for future template/default changes to accidentally treat the dummy release job as production-gated behavior and keeps the intent (“test only”) unambiguous.

Suggested change
type: releaseJob
type: releaseJob
isProduction: false

Copilot uses AI. Check for mistakes.
Comment on lines 239 to 241
Write-Host "- Downloaded symbols from build pipeline"
if ("${{ parameters.publishSymbols }}" -eq "True") {
Write-Host "- Published symbols to SqlClientDrivers org"
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

The pipeline summary implies symbols can be published, but the earlier symbol staging logic only copies "$(Build.SourcesDirectory)/artifacts/symbols/.pdb" (non-recursive). If PDBs are in nested folders, PublishSymbols@2 (SearchPattern **/.pdb) won’t see them. Update the staging step to copy recursively or point the SymbolsFolder directly at artifacts/symbols.

Copilot uses AI. Check for mistakes.
# This ensures no accidental production releases to PyPI
ContentType: 'Maven'
ContentSource: 'Folder'
FolderLocation: '$(Build.SourcesDirectory)/artifacts/dist'
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

This release job publishes from $(Build.SourcesDirectory)/artifacts/dist, but in PrepAndValidate the wheel integrity verification currently targets $(Build.SourcesDirectory)/dist (populated by an extra copy step). That means the integrity check may not cover the exact files being released here. Align the PrepAndValidate integrity check (and any wheel staging) to validate artifacts/dist directly.

Suggested change
FolderLocation: '$(Build.SourcesDirectory)/artifacts/dist'
# Release from the same staged directory validated in PrepAndValidate
# so integrity verification covers the exact files being released.
FolderLocation: '$(Build.SourcesDirectory)/dist'

Copilot uses AI. Check for mistakes.
Comment on lines +329 to +331
if ("${{ parameters.publishSymbols }}" -eq "True") {
Write-Host "✓ Symbol publishing to SqlClientDrivers org"
}
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

This summary calls out symbol publishing, but the current symbol staging in PrepAndValidate only copies root-level .pdb files (non-recursive) from artifacts/symbols. If PDBs are nested, PublishSymbols@2 (SearchPattern **/.pdb) will miss most symbols. Copy recursively or set the SymbolsFolder to artifacts/symbols.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-size: medium Moderate update size

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants