Skip to content

Conversation

@alcaeus
Copy link
Collaborator

@alcaeus alcaeus commented May 7, 2025

This change integrates the automatic-merge-up-action into the Go pre-release process.

If no push is requested, the behaviour does not change. However, when a push is requested, we determine the next branch (e.g. release/2.2 when releasing a 2.1 patch release) and merge the changes using the ours strategy. This marks the bump commit as fully merged up without accepting its changes. This removes the need for manually handling the merge-up pull request created due to pushing the new commit during the release process.

- name: "Determine branch to merge up to"
if: ${{ inputs.push_changes }}
id: get-next-branch
uses: alcaeus/automatic-merge-up-action/get-next-branch@main
Copy link
Member

@blink1073 blink1073 May 7, 2025

Choose a reason for hiding this comment

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

Can we use the current commit instead (b253eae7dfccc0b637edf71121608375e07a7678 as of right now).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. Updated.

Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

LGTM!

shell: bash
run: |
git checkout ${NEXT_BRANCH}
git merge --strategy=ours ${RELEASE_BRANCH}
Copy link
Collaborator

@prestonvasquez prestonvasquez May 9, 2025

Choose a reason for hiding this comment

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

Part of the release process bumps the patch version. Would this end up creating a PR to bump the version on a minor release > that the one being targeted by the action? For example if you are releasing 2.1.1 and a I release/2.2 branch exists would a PR be merged up to release/2.2 that attempts to change the version to 2.1.1? I would expect all other changes to release/2.1 to have already been merged up to release/2.2.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No. Let's assume you are releasing 2.1.1. Pushing that commit would usually trigger a pull request to merge that change into release/2.2. You'd have to manually ignore the changes in that one and merge the commit as merged.

With this change, we're manually merging the bump commit into the release/2.2 branch, but by using the ours strategy, no changes will be applied. Since release/2.2 then receives a push, it will trigger a merge-up of the commit (with no changes) to the next branch.

The main difference here is that this takes care of the first merge-up PR that would require manual intervention to not change the version in any newer branches. From there, it's just a straightforward approval to enable auto-merge until the end of the chain.

@alcaeus alcaeus merged commit 9455ec6 into mongodb-labs:main May 12, 2025
5 checks passed
@alcaeus alcaeus deleted the go-automatic-merge-up branch May 12, 2025 06:59
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