Release-prep pipeline: manual runs never create the PR, and scheduled runs fail after creating it

Open
#4,218 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
github-actions, powershell, yaml
Domain
ci-cd, release

Research direction

Start with eng/pipelines/release-prep.yml and trace how CheckSchedule sets ShouldPrepareRelease for manual and scheduled runs. Then inspect eng/scripts/helpers/ReleasePrepHelpers.ps1 and the Update-GitHubIssue parameter and variable named in eng/common/scripts/Invoke-GitHubAPI.ps1. Reproduce the manual-run and strict-mode failures; done means manual runs can create the prep PR and scheduled runs complete successfully after creating it.

Written by the indexing model from the issue text.

Description

bug Central-EngSys EngSys server-Azure.Mcp

Two problems with the Azure MCP release-prep pipeline (eng/pipelines/release-prep.yml), added in #4067 and updated in #4143, found during the 4.0.0-beta.9 and 4.0.0-beta.10 releases.

1. Manual runs never create the release-prep PR

The CheckSchedule job's condition is eq(variables['Build.Reason'], 'Schedule'), so manual runs skip it. PrepareRelease depends on its schedule.ShouldPrepareRelease output. That output can't be set when queuing a run, and the pipeline has no parameter to override it. As a result, a manual run (for example, run 20261117.3) succeeds without creating a PR.

A related problem: when the post-release "Increment version after release" PR hasn't merged yet, Invoke-ReleasePrepPullRequest logs "Version X is already finalized. Waiting for the post-release version increment." The run reports success without creating a PR. This happened in run 20261117.2 while #4186 was still open. The 4.0.0-beta.9 prep PR (#4200) then had to be created by hand.

Suggested fixes

  • Add a pipeline parameter (for example ForceRun plus an optional ReleaseDate) so manual runs can skip the schedule check and run PrepareRelease.
  • Make the "already finalized" and no-changelog-entries skips warn or fail visibly instead of reporting success.
  • Document in the release checklist that the version-bump PR must merge before the scheduled run.

2. Scheduled run fails after creating the PR ($Milestone not set)

Run 20261119.2 created #4217 and then failed:

[debug]Pull request created https://github.com/microsoft/mcp/pull/4217
##[error]Call to GitHub API failed with exception:
The variable '$Milestone' cannot be retrieved because it has not been set.
Submitting the release-preparation PR failed with exit code 1.
At eng\scripts\helpers\ReleasePrepHelpers.ps1:275

Root cause: in eng/common/scripts/Invoke-GitHubAPI.ps1, Update-GitHubIssue declares its parameter as [int]$Milestome (typo, line ~520) but reads $Milestone (line ~534). ReleasePrepHelpers.ps1 enables Set-StrictMode -Version Latest (line 190) before calling Submit-PullRequest.ps1, so reading the undefined variable throws. The PR is already created at that point, but every scheduled run is marked as failed.

Suggested fixes

  • Fix the typo upstream in Azure/azure-sdk-tools eng/common, then sync it here.
  • In the meantime, disable strict mode around the Submit-PullRequest.ps1 call in ReleasePrepHelpers.ps1.

cc @alzimmermsft @msalaman

Dominant language
C#
Stars
3.9k
Forks
689
Avg merge
2d 11h
Merged PRs (30d)
143

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/mcp

All issues in microsoft/mcp

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.