Skip to content

Open version bump PR after official SqlClient release - #5093

Open
cheenamalhotra wants to merge 6 commits into
mainfrom
dev/cheena/release-version-bump-pr
Open

cheenamalhotra wants to merge 6 commits into
mainfrom
dev/cheena/release-version-bump-pr

Conversation

@cheenamalhotra

Copy link
Copy Markdown
Member

Description

After a production release, SqlClientNextVersion has to be bumped by hand on the branch the release came from. This adds a stage to the OneBranch official pipeline that opens that PR automatically.

  • New stage version-bump-pr-stage.yml runs after release_production succeeds. It is only added when releaseToProduction and releaseSqlClient are both true.
  • New script new-version-bump-pr.ps1 uses the GitHub REST API with PATToken from the GitHub PAT Tokens variable group.
  • The target branch is the build's own branch. Only main and release/X.Y are allowed, with an optional internal/ prefix. Other branches log a warning and are skipped.
  • A real run only works inside an ADO build (TF_BUILD). A local run must use -DryRun.

How the next version is chosen:

Published Branch Next version
GA (for example 8.1.0) any Next patch (8.1.1)
Preview release/* Its GA version
Preview main Lowest open milestone in the same major.minor above it; otherwise its GA version

How the PR milestone is chosen: the milestone that matches the new version exactly. If there isn't one, the closest earlier milestone, open or closed.

The script makes no change when:

  • The branch is already at or above the next version.
  • An open bump PR already exists.
  • Versions.props is missing.

Docs: updated onebranch-pipeline-design.instructions.md and the scripts test README.

Issues

N/A

Testing

  • Invoke-Pester eng/pipelines/onebranch/scripts/tests/new-version-bump-pr.Tests.ps1: 41 passed, 0 failed. The tests cover the version and milestone rules, the branch allowlist, and the full flow with mocked GitHub calls.
  • Ran -DryRun against the live repo for internal/main and release/8.0. Both reported the PR they would open, with the right version and milestone.
  • Ran -DryRun for dev/* and release/7.1-hotfix. Both were skipped with a warning.
  • A local run without -DryRun failed as expected with "Only -DryRun is allowed outside an Azure DevOps build".

Guidelines

Please review the contribution guidelines before submitting a pull request:

cheenamalhotra and others added 5 commits November 12, 2026 20:11
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…llback

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@cheenamalhotra
cheenamalhotra requested review from a team and a balanced review from Copilot November 17, 2026 06:31
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Nov 17, 2026
@cheenamalhotra cheenamalhotra added this to the 8.1.0-preview1 milestone Nov 17, 2026
@cheenamalhotra cheenamalhotra added Hotfix 7.1.3 PRs targeting main that should be backported to release/7.1 for 7.1.3. Hotfix 8.0.0 PRs that must be backported to release/8.0 labels Nov 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The fallback milestone can make generated PRs fail repository checks, while shared branch names can cause one target’s bump PR to suppress another’s.

2 open issues
What changed in this PR

Automates the post-release SqlClientNextVersion bump by opening a GitHub PR against the branch used for an official production release.

Changes:

  • Adds a pipeline stage gated on successful production publication of the SqlClient family.
  • Implements version and milestone selection, branch validation, duplicate-PR detection, and dry-run support.
  • Adds mocked Pester coverage and documents the automation.
File Description
eng/​pipelines/​onebranch/​stages/​version-bump-pr-stage.yml Defines the gated post-release job and token mapping.
eng/​pipelines/​onebranch/​sqlclient-official.yml Includes the version-bump stage in the official pipeline.
eng/​pipelines/​onebranch/​scripts/​tests/​README.md Lists version-bump test coverage.
eng/​pipelines/​onebranch/​scripts/​tests/​new-version-bump-pr.Tests.ps1 Tests selection rules, safeguards, and mocked GitHub operations.
eng/​pipelines/​onebranch/​scripts/​new-version-bump-pr.ps1 Implements version-bump PR creation through the GitHub API.
.github/​instructions/​onebranch-pipeline-design.instructions.md Documents stage gating, selection rules, and credentials.

Review effort: Balanced

@cheenamalhotra cheenamalhotra moved this from To triage to In review in SqlClient Board Nov 17, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 17, 2026 06:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The milestone fallback can assign a closed or mismatched milestone, causing generated version-bump PRs to fail repository milestone checks and require manual repair.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Hotfix 7.1.3 PRs targeting main that should be backported to release/7.1 for 7.1.3. Hotfix 8.0.0 PRs that must be backported to release/8.0

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

5 participants