I’m quite new to GitLab & please accept my apologies if I’ve posted this in the wrong area.
I’ve been tasked with investigating whether we can add something to our MR approval process to highlight whether proposed Merge Requests (MRs), which are C++ based code, contain any new unit tests or modifications to existing tests. The overall aim is to remind developers and approvers that they need to think about unit testing.
Ideally a small script would run and detect the presence of additional tests or changes (I accept that there’s a limit to how much can be done here) and display a warning on the MR if they weren’t detected.
An addition step, if possible, would be to block the MR until either, changes were pushed that meet the criteria, or an (extra) field is completed explaining why unit testing is not appropriate for this change. We accept that this is not foolproof but are hoping to use this as part of a bigger push for more test coverage.
We can easily write a script in, say, Python to check for unit tests in the commit(s), but what I don’t know is whether/how we can hook this into the GitLab MR process and whether GitLab is extensible enough for us to achieve the additional step above. Any thoughts? Can this be done, and if so, how would I go about it?