Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: return correct base_sha when merge_group event happens #145

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

paulo9mv
Copy link

@paulo9mv paulo9mv commented Mar 14, 2024

Context

As reported in #140, the current solution for merge-queue works only when the queue size 1. When more commits are added to the queue, the action keeps setting the same NX_BASE for all of them.

Problem
When new commits are added to the queue, we expect the NX_BASE commit to be the last commit in the queue. However, it sets the last commit in master. This image from #140 (comment) represents well the problem.

Solution proposed
The NX_BASE commit should be main branch HEAD commit when merge-queue has size 1. When size > 1, NX_BASE should be the HEAD commit of the last merge branch that current commit is on top of.

@paulo9mv paulo9mv closed this Mar 14, 2024
@paulo9mv
Copy link
Author

paulo9mv commented Oct 16, 2024

Closed since I couldn't test enough scenarios

@paulo9mv paulo9mv reopened this Dec 19, 2024
return result ? result.at(1) : undefined;
}

async function findMergeQueueBranch(): Promise<string> {
Copy link
Author

Choose a reason for hiding this comment

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

In merge-queue scenario, base will always be the previous commit in the queue. That's why we can remove these functions here.

@paulo9mv paulo9mv marked this pull request as ready for review December 19, 2024 12:32
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.

1 participant