Skip to content

Added approver notification setting

Phil Hughes requested to merge ph/12855/addedApproverNotificationSetting into master

What does this MR do and why?

Adds a new notification setting for users to get notified when the are added as an approver. When a merge request gets created there is a delay to make sure that all approval rules are created and then we send notifications and create todos for users that have this notification setting enabled.

Migration up

main: == 20231114152304 AddApproverToNotificationSettings: migrating ================
main: -- add_column(:notification_settings, :approver, :boolean, {:default=>false, :null=>false})
main:    -> 0.0030s
main: == 20231114152304 AddApproverToNotificationSettings: migrated (0.0067s) =======

main: == [advisory_lock_connection] object_id: 184460, pg_backend_pid: 7274

Migration down

main: == [advisory_lock_connection] object_id: 184420, pg_backend_pid: 6776
main: == 20231114152304 AddApproverToNotificationSettings: reverting ================
main: -- remove_column(:notification_settings, :approver, :boolean, {:default=>false, :null=>false})
main:    -> 0.0044s
main: == 20231114152304 AddApproverToNotificationSettings: reverted (0.0103s) =======

main: == [advisory_lock_connection] object_id: 184420, pg_backend_pid: 6776

#12855 (closed)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  • Enable Added as approver notification setting under user notifications
  • Add approval rules to a project, either code owners or normal project rules
  • Create a new merge request
  • Todo should get created and email should be sent after a short delay

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Phil Hughes

Merge request reports