Skip to content

Fall back to auto-merge + branch update when direct merge fails#48

Open
ajpallares wants to merge 2 commits intomainfrom
pallares/auto-merge-fallback-on-merge-failure
Open

Fall back to auto-merge + branch update when direct merge fails#48
ajpallares wants to merge 2 commits intomainfrom
pallares/auto-merge-fallback-on-merge-failure

Conversation

@ajpallares
Copy link
Copy Markdown
Member

@ajpallares ajpallares commented Apr 9, 2026

Summary

  • When the direct merge of a release PR fails (e.g. because the branch is not up-to-date with main), and merge queue is not in use, the merge-release-pr job now falls back to:
    1. Enabling auto-merge on the PR (with the same merge method)
    2. Updating the PR branch by merging the base branch into it via the GitHub API

This handles repos like purchases-flutter that have the "Require branches to be up to date before merging" branch protection rule. See this pipeline for an example of the failures this fixes.

Depends on: fastlane-plugin-revenuecat_internal#125 (new update_pr_branch action).

Test plan

  • Verify the orb packs and lints successfully
  • Test on a repo with "require up-to-date" branch protection by triggering a release where main has diverged
  • Verify merge queue path still fails normally on enqueue errors

When the direct merge of a release PR fails (e.g. because the branch is not
up-to-date with main), and merge queue is not in use, the job now:
1. Enables auto-merge on the PR
2. Updates the PR branch by merging the base branch into it

This handles repos like purchases-flutter that require branches to be
up-to-date before merging.

Made-with: Cursor
@RCGitBot
Copy link
Copy Markdown
Contributor

RCGitBot commented Apr 9, 2026

Your development orb has been published. It will expire in 30 days.
You can preview what this will look like on the CircleCI Orb Registry at the following link:
https://circleci.com/developer/orbs/orb/revenuecat/sdks-common-config?version=dev:3cafe27d3a471e01ac69bed80d2378c050c2fc62

@ajpallares ajpallares marked this pull request as ready for review April 9, 2026 08:09
@RCGitBot
Copy link
Copy Markdown
Contributor

RCGitBot commented Apr 9, 2026

Your development orb has been published. It will expire in 30 days.
You can preview what this will look like on the CircleCI Orb Registry at the following link:
https://circleci.com/developer/orbs/orb/revenuecat/sdks-common-config?version=dev:3cbc6fbe36928e01cb20dbf22869dbc9a92a429c

@ajpallares ajpallares requested review from a team and facumenzella April 9, 2026 08:09
Copy link
Copy Markdown
Member

@rickvdl rickvdl left a comment

Choose a reason for hiding this comment

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

Smart solution :) LGTM!

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