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

feat(gitlab): add merge method check #5567

Merged
merged 1 commit into from Feb 25, 2020
Merged

Conversation

viceice
Copy link
Member

@viceice viceice commented Feb 24, 2020

If merge_methodis not merge we need to force rebase our branches.

Closes #5565

@viceice viceice requested a review from rarkins February 24, 2020 16:29
@viceice
Copy link
Member Author

viceice commented Feb 24, 2020

No live test yet. Maybe safe anyway?

@rarkins rarkins merged commit 763e444 into master Feb 25, 2020
@rarkins rarkins deleted the feat/gitlab-merge-type branch February 25, 2020 05:34
@rarkins
Copy link
Collaborator

rarkins commented Feb 25, 2020

I just realized something - we need to check when this field was introduced. Otherwise if there's older GitLab versions which don't support the field then they'll start always rebasing.

@viceice
Copy link
Member Author

viceice commented Feb 25, 2020

ok, i'll look at the api

@viceice
Copy link
Member Author

viceice commented Feb 25, 2020

https://docs.gitlab.com/ee/policy/maintenance.html

looks like they only support the latest 3 versions.

I can't find when try introduced the property, but i think it was long time ago. (at least readonly)

but to be safe, we can check existance.

@github-actions
Copy link
Contributor

🎉 This PR is included in version 19.148.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@viceice
Copy link
Member Author

viceice commented Feb 25, 2020

looks like https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/14272 introduced it in version 10.1.

Older versions have had other properties. Should we support older versions than 10.1, which are no longer supported?

@rarkins
Copy link
Collaborator

rarkins commented Feb 25, 2020

We should support whatever GitLab says is supported, but ideally not break older stuff also if we can avoid it.

@viceice
Copy link
Member Author

viceice commented Feb 25, 2020

We do not break it, we only force a rebase if we fall behind on version less than 10.1 🙈

@viceice
Copy link
Member Author

viceice commented Feb 25, 2020

a simple fix for older versions would be config.mergeMethod = res.body.merge_method || 'merge';

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autodetect GitLab fast-forward branch controls
2 participants