Conversation
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
There was a problem hiding this comment.
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.
- 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>
There was a problem hiding this comment.
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 bumpeng/targets/Release.props, updateCHANGELOG.md, push arelease/v<version>branch, and open a PR viagh. - Added an Azure DevOps manual pipeline (
release-kickoff.yml) that sets up tooling and delegates the workflow toStart-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)] |
There was a problem hiding this comment.
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 $.
| [Parameter(Mandatory = $false)] | |
| [Parameter(Mandatory = $false)] | |
| [ValidatePattern('^[0-9A-Za-z.-]*$')] |
| $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 |
There was a problem hiding this comment.
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.
| $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) |
| # 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." } |
There was a problem hiding this comment.
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.
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:
elease/v\ branch and pushes it
*\�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:
c.1)
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.