Break pipeline and disable a merge if coverage is less then X%

Description

I have a Karma job that executes unit tests and at the end of this job I have the coverage extracted. This coverage however is only informational. It does not seem to participate on any logic that determines the further execution of the pipeline. I also have deploy jobs and what I want is for the job/stage/pipeline to fail/break in case my coverage is less than, let's say 80%. Further on I would like to prevent a merge request in case the coverage is less then this 80%. A nice thing is that already the coverage is visible on the MR page, however I need the reason to be seen by the reviewers. The merge action be impossible so even approvers would not force the merge.

Proposal

Add a min_coverage option for a job that has coverage: and make the job fail if coverage < min_coverage. Also disable a Merge if coverage < min_coverage.

Edited by braykov