FR: Enforce the linking of MRs to an issue via a merge request approval policy
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Proposal
The reason this has been requested is to help customers achieve SOX compliance, which requires that they can enforce linking issues to Merge Requests so that they can see why changes are being made/where the request for the change is coming from.
Something like this is roughly how customers would imagine being able to use it:
approval_policy:
- name: Require linked issue
description: Merge requests into protected branches require a linked issue.
enabled: true
actions:
- type: require_linked_issue
linked_issues_required: 1
rules:
- type: any_merge_request
branch_type: protected
commits: any
policy_scope:
projects:
including:
- id: 5719
- id: 5792
We would like it scope-able (via rules) by protected/default like other MR approval policies, but being able to scope by branch name regex in the rules would be ideal too.
So if a merge request is made on a project that has not been linked to an issue, and it has this policy applied to it, it will be blocked until it is linked to an issue.