-
Notifications
You must be signed in to change notification settings - Fork 136
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
Marge-bot get's stuck in loop due to This project requires squashing commits when merge requests are accepted
#326
Comments
I had a similar problem (with a different error report) a while ago. I never managed to track down the bug that caused it, but it was fixed by restarting and updating |
@snim2 I was running with latest marge-bot. I ended up restarting our GitLab-rails instances ( I think this is an error with GitLab and not with marge-bot that can cause marge-bot to loop forever. It would be nice for marge-bot to handle this somehow though; maybe confirm that the merge request was actually successful or not. I'll look at submitting an MR for this when I can get the time. |
@cmavromichalis thanks. I think your diagnosis that it's a GitLab problem makes a lot of sense. |
My company uses the "squash commits" option and there is no way to make the marge-bot working.
We are on Gitlab.com and we are using the latest version of marge bot. |
@bpuertolas Yes I am sure. We are self-hosted. In the logs I provided you can see that GitLab returned a successful http code on merging when in fact it did not merge which is the error with GitLab.
Your logs are giving a different warning so I think it is a different situation. |
We have both the same JSON result which contains |
So one issue is that GitLab will return success in the API call to merge the branch. But that doesn't mean that it is merged as it is an asynchronous operation. In our functional tests for python-gitlab we do the merge request but then loop checking the status of the merge request to make sure it gets merged. |
Sure it's a issue. |
From my understanding a Project can set what the squash option should be, also when an MR is created it can set the squash option, and finally when the Merge Request Accept occurs it can set the squash option. If the squash option is not set in the MR Accept, it should then use what the value is set from when the MR is created, and if that is not set it should use the Project default. I wonder if the MR for some reason got set to not squashing. https://docs.gitlab.com/ee/api/merge_requests.html#create-mr |
Yes it should be like that. Unfornutaly, I just try on a test project:
I will open an issue on the Gitlab project to ask if it's intentional. |
Hello,
Our setup:
Version: GitLab 14.2.0-ee
The project setting has
Squash commits when merging
as required, users can't deselect the check box.Our marge-bot user is called merge-bot
We have had marge-bot running fine for over a year now. It might be due to a GitLab error but thought I would open an issue here to handle the looping.
Marge-bot is stuck in a loop when:
'merge_error': 'This project requires squashing commits when merge requests are accepted.',
I am able to click merge button and it works fine in the UI.
I can see the same error in the UI so I think GitLab is having issues but is causing Marge-bot to infinitely loop
Here is the log shortened to show the loop:
The text was updated successfully, but these errors were encountered: