Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitLab not sending notifications to merge request approvers

Tags:

gitlab

I have written an entire software development course, and until recently we've been using Bitbucket. I recently rewrote the course to use GitLab instead, mostly because GitLab the username isn't tied to a particular email like Bitbucket. I had heard good things. But I'm running into problems already.

The first is that merge requests (what the other hosting services call "pull requests") are not sending out notifications to approvers. We just had the lesson where I taught my students to create merge requests. I had them add me as "Reporter" to their projects. Then I had them create a merge request, and add me as an "Approver".

Yet I received no email notifying me that two student had created merge requests with me as an approver on each. I double-checked, and my global notifications are set to "Participate".

I reported this issue in a comment to a GitLab ticket, but received no response. I even filed a new official GitLab bug report; someone finally looked at it, and created another ticket for GitLab EE. So far no one has actually found the problem.

So as a workaround I went into my GitLab nofication settings and set the notification level for each student repository to "Watch" so that I (in theory) should be notified of any activity at all. Sure enough, I was notified when my students created merge requests.

Unfortunately even with a notification level of "watch", I was not notified when a student updated a merge request by making a new commitment to the branch and pushing it to GitLab.

Am I doing something wrong? Why am I not getting notifications of merge requests on which I am approver—not even when I'm watching the project? If I can't get this simple, core functionality to work I guess we'll move to Github, now that they introduced private repositories.

like image 213
Garret Wilson Avatar asked Jan 15 '19 02:01

Garret Wilson


People also ask

Can override approvers and approvals required per merge request?

If approvals are activated at the project level, the default configuration (number of required approvals and approvers) can be overridden for each merge request in that project.

What happens after merge request is approved?

After setting the approval, you will see an Approve button on merge requests, rather than an Accept button. Once the merge request has enough approvals, you will be able to merge it as usual.


1 Answers

Role "Reporter" cannot accept/manager Merge Requests in the repository. See the whole list of permissions but basically they are:

Guest: Read only access

Reporter: Issues and comments

Developer: Push, actions to the repository

Maintainer: Admin

I did not test myself but maybe GitLab notifications check this internally. My recommendation is to protect the master branch or develop depending on your Git Workflow. Ideally only Maintainers can push or merge to protected branches after code review, so you should be assigned this role in the repos to approved things and hopefully receive the notifications. The global notification should be "Participate" and this is propagated to all your repos to avoid be overwhelmed by notifications ("Watch" notify all the activities in the repos). Developers should create feature or bugfix branches from master/develop and push always to this branch.

Suggestion

I would research some Git Workflow: Github, GitLab or GitFlow are very good examples to analyse. You can adapt the workflow to your own needs. Another MUST should be to configure GitLab CI/CD before merging into the protected branches to assure the robustness and quality of the code and teach the students good practices from the beginning.

UPDATE 2

This is happening in the CE and EE. No emails are sent when pushing new commits to Merge Requests. I tested with "Watch", "Custom", "Participate", "Developer", "Maintainer" and no emails have been sent. Actually "Custom" has an specific option for "Push to Merge Requests". However even not ideal, there is a workaround if you want to use it. Actually it also sends the diff between commits inside the email. In Settings/Integration there is an option Emails on push. You can configure there a list of emails to send the notifications. See the image below. If you want to be informed when someone push new commits to the MR another workaround is to configure the CI pipeline. You will receive an email if the pipeline fails or succeeds (this is the way we are doing). Let's wait until GitLab people answers to your GitLab ticket. If this is a NO GO issue for you and none of the workarounds work for you, I would move to GitHub Private Repositories.

enter image description here

enter image description here

like image 172
Carlos Cavero Avatar answered Sep 19 '22 14:09

Carlos Cavero