Skip to content

Add SDK release kickoff pipeline#677

Closed
YunchuWang wants to merge 3 commits intomainfrom
wangbill/add-release-kickoff-pipeline
Closed

Add SDK release kickoff pipeline#677
YunchuWang wants to merge 3 commits intomainfrom
wangbill/add-release-kickoff-pipeline

Conversation

@YunchuWang
Copy link
Copy Markdown
Member

Summary

Adds an automated SDK release kickoff pipeline and a local PowerShell helper script to streamline the release process.

New Files

  • *\�ng/ci/release-kickoff.yml* — Azure DevOps pipeline (manually triggered) that:

    • Takes user input for version bump type (\major/\minor/\patch/\�xplicit), explicit version, and optional version suffix
    • Bumps \VersionPrefix\ and \VersionSuffix\ in \�ng/targets/Release.props\
    • Runs \generate_changelog.py\ to update \CHANGELOG.md\ with the new version header
    • Creates a
      elease/v\ branch and pushes it
    • Opens a release PR targeting \main\ via the ADO REST API
  • *\�ng/scripts/Start-Release.ps1* — Local PowerShell script for the same workflow (useful for running locally or in other CI systems). Uses \gh\ CLI to open the PR.

How to Use

In Azure DevOps:

  1. Navigate to the pipeline and click Run pipeline
  2. Select the version bump type (\major, \minor, \patch, or \�xplicit)
  3. If \�xplicit, provide the version in \X.Y.Z\ format
  4. Optionally set a version suffix (e.g., \preview,
    c.1)
  5. The pipeline creates a release branch and PR automatically

Locally:
\\powershell

Minor version bump (1.22.0 -> 1.23.0)

./eng/scripts/Start-Release.ps1 -BumpType minor

Patch bump with preview suffix

./eng/scripts/Start-Release.ps1 -BumpType patch -VersionSuffix preview

Explicit version

./eng/scripts/Start-Release.ps1 -BumpType explicit -ExplicitVersion 2.0.0
\\

Motivation

Follows the existing release process documented in \doc/release_process.md\ but automates steps 1–3 (version bump, changelog update, and branch creation) to reduce manual effort and risk of errors.

Add an Azure DevOps pipeline (eng/ci/release-kickoff.yml) and a local
PowerShell helper (eng/scripts/Start-Release.ps1) to automate the SDK
release kickoff process:

- Pipeline parameters for bump type (major/minor/patch/explicit),
  explicit version, and version suffix
- Bumps VersionPrefix/VersionSuffix in eng/targets/Release.props
- Generates changelog update via generate_changelog.py
- Creates a release/v<version> branch and pushes it
- Opens a release PR targeting main
Copilot AI review requested due to automatic review settings March 17, 2026 17:00
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

Adds automation for starting an SDK release by bumping versioning props, updating the changelog, creating a release branch, and opening a release PR.

Changes:

  • Add a PowerShell script to kick off a release from a developer machine.
  • Add an Azure Pipelines YAML definition intended to perform the same release kickoff steps in CI.

Reviewed changes

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

File Description
eng/scripts/Start-Release.ps1 New local release kickoff script (version bump, changelog update, release branch + PR).
eng/ci/release-kickoff.yml New CI pipeline to automate the release kickoff steps.

You can also share your feedback on Copilot code review. Take the survey.

YunchuWang and others added 2 commits March 24, 2026 11:01
- Fix Set-Content to use -Encoding UTF8 to preserve file encoding
- Fix generate_changelog.py tag argument to use v-prefix (matches repo convention)
- Incorporate generated changelog entries into CHANGELOG.md instead of ignoring them
- Ensure script checks out main and pulls latest before creating release branch
- Refactor YAML pipeline to call Start-Release.ps1 instead of duplicating logic
- Replace ADO REST API PR creation with gh CLI (repo is on GitHub, not ADO)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 24, 2026 18:32
@YunchuWang YunchuWang closed this Mar 24, 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

Adds automation to streamline the SDK release kickoff workflow (version bump + changelog update + release branch + release PR), aligning with the repo’s documented release process.

Changes:

  • Added a local PowerShell helper (Start-Release.ps1) to bump eng/targets/Release.props, update CHANGELOG.md, push a release/v<version> branch, and open a PR via gh.
  • Added an Azure DevOps manual pipeline (release-kickoff.yml) that sets up tooling and delegates the workflow to Start-Release.ps1.

Reviewed changes

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

File Description
eng/scripts/Start-Release.ps1 Implements the release kickoff workflow locally (and as the pipeline entrypoint), including version bump + changelog update + git branching + PR creation.
eng/ci/release-kickoff.yml Adds a manually-triggered ADO pipeline to run the kickoff script in CI with parameters.

[Parameter(Mandatory = $false)]
[string]$ExplicitVersion = '',

[Parameter(Mandatory = $false)]
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

VersionSuffix is used to build the git branch name and tag (and is also written into XML via -replace) but it isn’t validated. Please add input validation to restrict it to a safe SemVer prerelease charset (e.g., alphanumerics plus . and -, no whitespace/quotes/slashes) to avoid invalid branch/tag names or accidental PowerShell/regex replacement quirks with characters like $.

Suggested change
[Parameter(Mandatory = $false)]
[Parameter(Mandatory = $false)]
[ValidatePattern('^[0-9A-Za-z.-]*$')]

Copilot uses AI. Check for mistakes.
Comment on lines +96 to +104
$content = Get-Content $releasePropsPath -Raw

# Update VersionPrefix
$content = $content -replace '<VersionPrefix>[^<]*</VersionPrefix>', "<VersionPrefix>$NewVersion</VersionPrefix>"

# Update VersionSuffix
$content = $content -replace '<VersionSuffix>[^<]*</VersionSuffix>', "<VersionSuffix>$Suffix</VersionSuffix>"

Set-Content -Path $releasePropsPath -Value $content -NoNewline -Encoding UTF8
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

Set-Version updates Release.props using regex -replace with a replacement string that directly interpolates $NewVersion/$Suffix. In PowerShell regex replacements, $ sequences in the replacement are treated as capture-group substitutions, so certain suffix values can produce incorrect output. Consider switching to XML DOM updates or a match-evaluator replacement so the inserted values are treated literally.

Suggested change
$content = Get-Content $releasePropsPath -Raw
# Update VersionPrefix
$content = $content -replace '<VersionPrefix>[^<]*</VersionPrefix>', "<VersionPrefix>$NewVersion</VersionPrefix>"
# Update VersionSuffix
$content = $content -replace '<VersionSuffix>[^<]*</VersionSuffix>', "<VersionSuffix>$Suffix</VersionSuffix>"
Set-Content -Path $releasePropsPath -Value $content -NoNewline -Encoding UTF8
[xml]$props = Get-Content $releasePropsPath -Raw
# Update VersionPrefix
$props.Project.PropertyGroup.VersionPrefix = $NewVersion
# Update VersionSuffix
$props.Project.PropertyGroup.VersionSuffix = $Suffix
$props.Save($releasePropsPath)

Copilot uses AI. Check for mistakes.
Comment on lines +177 to +182
# Ensure we start from an up-to-date main branch
Write-Host "Switching to main and pulling latest..."
git checkout main
if ($LASTEXITCODE -ne 0) { throw "Failed to checkout main." }
git pull origin main
if ($LASTEXITCODE -ne 0) { throw "Failed to pull latest main." }
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

Before switching branches and pulling (git checkout main / git pull), the script should validate that the working tree is clean (e.g., git status --porcelain is empty). Otherwise uncommitted local changes can be carried into the release branch/PR or cause checkout/pull to fail in a confusing way, which is risky for a release kickoff workflow.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants