[AINFRA-1406] Fix deletion of intermediate branch if nothing to backmerge#665
Merged
AliSoftware merged 2 commits intotrunkfrom Oct 14, 2025
Merged
[AINFRA-1406] Fix deletion of intermediate branch if nothing to backmerge#665AliSoftware merged 2 commits intotrunkfrom
AliSoftware merged 2 commits intotrunkfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does it do?
Fixes the issue during
create_release_backmerge_pull_requestwhen there is nothing to backmerge but the automation already created the intermediatemerge/…backmerge branch and is now trying to delete that branch to cancel the process and clean things up.So far in that specific case we were still checked out on the
merge/…intermediate when we were trying to delete that branch, butgitdoesn't allow to delete the current branch:The fix is to
git checkoutthe previous branch (the head branch we were potentially trying to backmerge) before deleting the intermediate branch, so that we're sure we're not in the branch we're deleting.Checklist before requesting a review
bundle exec rubocopto test for code style violations and recommendations.Add Unit Tests (akaspecs/*_spec.rb) if applicable.bundle exec rspecto run the whole test suite and ensure all your tests pass.CHANGELOG.mdfile to describe your changes under the appropriate existing###subsection of the existing## Trunksection.If applicable, add an entry in theMIGRATION.mdfile to describe how the changes will affect the migration from the previous major version and what the clients will need to change and consider.