Add an instance-level setting to require Jira association in Merge Requests
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Problem to solve
As a follow-up to #235616 (closed), enterprise customers do not have the ability to require this particular attribute of a merge request. In most regulated environments a change cannot ship unless it has an associated change ticket from Jira, ServiceNow, or other services. The lack of this feature creates a gap in an organization's compliance posture and creates problems for them during an audit when reviewing chain of custody and the SDLC.
Intended users
- Cameron (Compliance Manager)
- Delaney (Development Team Lead)
- Sasha (Software Developer)
- Devon (DevOps Engineer)
- Sidney (Systems Administrator)
- Rachel (Release Manager)
User experience goal
An admin and/or group owner can optionally require the Jira ticket field in an MR be populated before the MR can be merged.
Proposal
This will need to be broken down into smaller pieces
- Add a toggle at the instance-level to require an MR (in a regulated project) have a
Jira ticketentered - The MR should not be mergeable until this entry exists
This should be enforceable only for projects that have a compliance framework label
Further details
We should reduce the scope of this enforcement based on compliance project labels.
Implementation plan
Notes:
- Any approval restrictions we impose will need to be applied to both the GUI and API. It is worth noting that the current Vue implementation uses our v4 API to get it's data already so the below implementation plan takes this into account.
- This is limited to only regulated (compliance-labelled) projects
- Add new
:prevent_merge_requests_approval_if_no_change_idto:application_settingsDB table - Add this setting to
ee/lib/ee/api/helpers/settings_helpers.rb(this should automatically be picked up by the compliance framework limitations) - Add new policy to
MergeRequestPolicyto block approvals (setsprevent :approve_merge_request) if this setting is on and optionally (if a compliance framework label limitation is applied) compare the projects compliance framework label with the settings compliance framework limitation- This will automatically set the
user_can_approvetofalsewithin the API
- This will automatically set the
- Update tests
- Add new toggle to
/admin/push_ruleto enable/disable this restriction - Update tests