Track changes in merge request approval settings in the audit log
_"Rules" aspect moved to https://gitlab.com/gitlab-org/gitlab/-/issues/209222_ ### Problem to solve Tracking changes in merge request approval settings ~~and rules~~ in the audit log ### Further details Client proposed change in Zendesk ticket: https://gitlab.zendesk.com/agent/tickets/103355 (Internal use only) They asked if the audit logs could address changes to required approvers (how many, enabled/disabled). ### Important Note As of %"12.7" `Administrators` will be able to [set instance-wide rules](https://gitlab.com/gitlab-org/gitlab/issues/39060) for MR approvals that will restrict these settings at the project level for any non-admins. Currently scheduled for %"12.8" is an iteration to bring this functionality to the [group level](https://gitlab.com/gitlab-org/gitlab/issues/119344) for `.com` customers and will follow similar logic: only `Group Owners` can modify the settings at the project level. This activity - the modification of MR approval settings - should still be logged, though this detail may affect how it's logged and with what supplemental data. ### Proposal We should log, at the **group level** the three most important details of the MR approval settings and iterate to include additional settings later. Those three settings, as defined in https://gitlab.com/gitlab-org/gitlab/issues/39060 are: * Prevent approval of merge requests by merge request author * e.g. `User` modified `Project` to `allow` merge request authors to `approve` their own merge requests * e.g. `User` modified `Project` to `deny` merge request authors from approving their own merge requests * Prevent approval of merge requests by merge request committers * e.g. `User` modified `Project` to `allow` merge request committers to `approve` their own merge request * e.g. `User` modified `Project` to `deny` merge request authors from approving their own merge requests * Approvers List changes * e.g. `User` modified approvers for `Project` to `1` from `2` * e.g. `User` modified approvers for `Project` to `4` from `2` These events should contain a **default** sort order of **Newest to Oldest**. <!-- This detail should be moved to a second iteration UPDATE: This detail was moved to a second iteration: https://gitlab.com/gitlab-org/gitlab/-/issues/336211 Audit logs will contain information on changes in merge request approval settings such as how many approvers and if they are enabled/disabled. We should also track all project settings changes, including those in "Merge request settings". These include: * Changing the merge method strategy for a project * Changing the default MR template * Changing settings: * Merge request approvals * Only allow merge requests to be merged if the pipeline succeeds * Only allow merge requests to be merged if all discussions are resolved * Automatically resolve merge request diff discussions when they become outdated * Show link to create/view merge request when pushing from the command line * Approvers List Changes * e.g. `User` modified `Project` to `add` `User` as an approver for merge requests * e.g. `User` modified `Project` to `add` merge request approval rule: `rule title` -->
issue