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(manage-merge-queue): ensure queued for merge label is applied #652

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

danadajian
Copy link
Contributor

@danadajian danadajian commented Aug 9, 2024

📝 Description

  • Fixes an issue with the merge queue manager where PRs that have READY FOR MERGE without a "queued for merge" label screws up queue assignment.

@danadajian danadajian requested a review from a team as a code owner August 9, 2024 15:44
@danadajian danadajian merged commit 4d4ad3d into main Aug 9, 2024
3 checks passed
@danadajian danadajian deleted the fix-merge-queue branch August 9, 2024 15:50
@danadajian
Copy link
Contributor Author

🎉 This PR is included in version 1.62.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@@ -63,7 +63,7 @@ export const manageMergeQueue = async ({
return removePrFromQueue(pullRequest);
}
const queuedPrs = await getQueuedPullRequests();
const queuePosition = queuedPrs.length;
const queuePosition = queuedPrs.length + 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Length isn't an offset. Why the + 1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

getQueuedPullRequests() will now return a list of open PRs with both the READY FOR MERGE and QUEUED FOR MERGE #X labels. Before, this was including the PR we are running this for

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So now, if there are 2 PRs in the queue, and this runs for a new PR that just got READY FOR MERGE, queuedPrs.length should be 2, and thus queuePosition for this new PR should be 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants