Skip to content

PHPC-2708: Automatically create new minor version branch on release#2027

Open
paulinevos wants to merge 1 commit into
mongodb:v2.xfrom
paulinevos:release-branch
Open

PHPC-2708: Automatically create new minor version branch on release#2027
paulinevos wants to merge 1 commit into
mongodb:v2.xfrom
paulinevos:release-branch

Conversation

@paulinevos

Copy link
Copy Markdown
Contributor

To automate the release process further with the appropriate verification steps necessary.

To automate the release process further with the appropriate
verification steps necessary.
Copilot AI review requested due to automatic review settings June 15, 2026 09:35
@paulinevos paulinevos requested a review from a team as a code owner June 15, 2026 09:35
@paulinevos paulinevos requested review from GromNaN and removed request for a team June 15, 2026 09:35
@paulinevos paulinevos changed the title Automatically create new minor version branch on release PHPC-2708: Automatically create new minor version branch on release Jun 15, 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.

Pull request overview

Automates parts of the PHP driver release workflow by validating the release context (tags/branches), creating a new stable minor branch when releasing a new minor from the dev branch, and ensuring subsequent merge-up/release steps target the correct release branch.

Changes:

  • Adds release preflight checks (tag existence and branch/version alignment) and stores derived version/branch names in environment variables.
  • Automatically creates a new stable minor branch (e.g., vX.Y) when releasing X.Y.0* from the dev branch (vX.x), and bumps the dev branch to the next minor development version.
  • Ensures merge-up determination and GitHub release draft target the computed RELEASE_BRANCH instead of always using the triggering branch.

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

Comment on lines +113 to +116
echo '🆕 Creating new release branch ${{ env.STABLE_BRANCH }} from ${{ github.ref_name }}' >> $GITHUB_STEP_SUMMARY
git checkout -b ${STABLE_BRANCH}
git push origin ${STABLE_BRANCH}
echo RELEASE_BRANCH=${STABLE_BRANCH} >> $GITHUB_ENV

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Idk about reusing an existing branch... seems like it would be easy to use a branch that doesn't reflect the state we actually want. I'd rather use git switch --force-create and force push it I think...

What do you think @GromNaN?

@GromNaN GromNaN Jun 15, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If the new branch already exists, I'd rather not overwriting it.
I don't see any reason to have the branch pre-existing (simply because we are not allowed to create it). This case should not happen, but if it happens then we should not perform a destructive action.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok, so implement the suggestion or let it fail?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let it fail.

echo RELEASE_BRANCH=${STABLE_BRANCH} >> $GITHUB_ENV

- name: "Bump default branch to next minor development version"
if: ${{ endsWith(env.RELEASE_VERSION_WITHOUT_STABILITY, '.0') && env.DEV_BRANCH == github.ref_name }}
Comment on lines +123 to +125
git add phongo_version.h
git commit -m "Bump to next minor dev version"
git push origin ${DEV_BRANCH}
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.

3 participants