smarkets / marge-bot

A merge-bot for GitLab
BSD 3-Clause "New" or "Revised" License
700 stars 136 forks source link

Approvals check broken #258

Open Jellby opened 4 years ago

Jellby commented 4 years ago

It looks like Marge is not able to tell if a MR has sufficient approvals any more, she just believes it does, proceeds to merge, and then GitLab rejects it.

I believe this is the culprit (in approvals.py):

        if gitlab_version.is_ee:
            self._info = self._api.call(GET(approver_url))
        else:
            self._info = dict(self._info, approvals_left=0, approved_by=[])

but https://gitlab.com/api/v4/version returns:

{
   "revision" : "18190683c8d",
   "version" : "13.0.0-pre"
}

with no sign of ee.

nejch commented 4 years ago

Probably a result of GitLab's migration to a single codebase (gitlab-ee +gitlab-ce --> gitlab + the gitlab-foss mirror). If you have admin access, you can get the plan from the /license endpoint (only on EE and with an active license: https://docs.gitlab.com/ee/api/license.html). But I'd be interested to see if anyone has a more elegant solution that doesn't require admin access.

Jellby commented 4 years ago

Well, I'm using gitlab.com, so I obviously don't have admin access (or I'd be able to provide a much better solution).

It seems approvals are now a CE feature?