Skip to content

Add report_approver to approval_merge_request_rules

What does this MR do?

  • Add report_approver enum to approval_merge_request_rules

Initially there is only 1 report_type (security) however this can later be expanded to include other rules tied to report_approvers; i.e. code_quality or license_management.

This also includes some shims to the ApprovalRuleLike logic ensuring compatibility between the existing ApprovalProjectRule and ApprovalMergeRequestRule types

One of series of several MRs to fully address #9928 (closed).

Migration plan

== 20190521174505 AddReportTypeToApprovalMergeRequestRules: migrating =========
-- change_table(:approval_merge_request_rules)
   -> 0.0048s
== 20190521174505 AddReportTypeToApprovalMergeRequestRules: migrated (0.0049s)

Database checklist

When adding migrations:

  • Updated db/schema.rb
  • Added a down method so the migration can be reverted
  • Added the output of the migration(s) to the MR body
  • [-] Added tests for the migration in spec/migrations if necessary (e.g. when migrating data)

When adding or modifying queries to improve performance:

  • Included data that shows the performance improvement, preferably in the form of a benchmark
  • Included the output of EXPLAIN (ANALYZE, BUFFERS) of the relevant queries

When adding foreign keys to existing tables:

  • Included a migration to remove orphaned rows in the source table before adding the foreign key
  • Removed any instances of dependent: ... that may no longer be necessary

When adding tables:

  • Ordered columns based on the Ordering Table Columns guidelines
  • Added foreign keys to any columns pointing to data in other tables
  • Added indexes for fields that are used in statements such as WHERE, ORDER BY, GROUP BY, and JOINs

When removing columns, tables, indexes or other structures:

  • Removed these in a post-deployment migration
  • Made sure the application no longer uses (or ignores) these structures

General checklist

Edited by Lucas Charles

Merge request reports