feat: Add GitLab auto merge support#6865
Conversation
Signed-off-by: Olblak <me@olblak.com>
|
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