-
-
Notifications
You must be signed in to change notification settings - Fork 108
feat: Add GitLab auto merge support #6865
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
Conversation
Signed-off-by: Olblak <[email protected]>
|
From my experience with GitLab API, there will be required some sort of handling before running AcceptMergeRequest. There might occur some race condition, when you create a merge request, and it's pipeline is not scheduled yet - running AcceptMergeRequest immediately will just throw some random errors from API. EDIT: Maybe some polling with a small timeout watching for a head pipeline? |
|
Created a pull request with possible solution at this PR. |
|
Thanks for the PR and for testing. Your code is probably in the right direction, I'll test it later today |
|
After additional tests, it appears that I needed an access token with at least the maintainer permission and scope set to API I think the retry you are mentioning is already handled by this https://github.com/olblak/updatecli/blob/eac7e4b42a6aa3ab21e96c96a9c2ef1b5c3d8f85/pkg/plugins/resources/gitlab/mergerequest/create.go#L101 Which is the code snippet heavily inspired from https://pkg.go.dev/gitlab.com/gitlab-org/api/client-go#example-WithRequestRetry-CreateMergeRequestAndSetAutoMerge |
|
Yup, this might be sufficient, needs testing simulating "slow" environment |
|
I am going to merge this PR. We can always improve in the future |
Fix #6083
Test
/
Additional Information
Checklist
Tradeoff
Potential improvement