Skip to content

Sync approval settings for groups for reauth setting

What does this MR do and why?

Sync approval settings for groups for reauth setting

  • Migrate enabled reauthentication (require_password_to_approve) on group_merge_request_approval_settings to the new field require_reauthentication_to_approve where it's enabled The table default is for it to be false so those entries do not need to be synced.

  • Execution explain results from Joe instance Time: 30.862 ms (planning: 0.324 ms, execution: 30.538 ms)

  • Refs: #431346

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

❯ rails db:migrate
main: == [advisory_lock_connection] object_id: 128820, pg_backend_pid: 52490
main: == 20240708161802 SyncGroupMergeRequestSettings: migrating ====================
main: -- execute("UPDATE group_merge_request_approval_settings\nSET require_reauthentication_to_approve = true\nWHERE require_password_to_approve = true;\n")
main:    -> 0.0018s
main: == 20240708161802 SyncGroupMergeRequestSettings: migrated (0.0062s) ===========

main: == [advisory_lock_connection] object_id: 128820, pg_backend_pid: 52490
ci: == [advisory_lock_connection] object_id: 129020, pg_backend_pid: 52492
ci: == 20240708161802 SyncGroupMergeRequestSettings: migrating ====================
ci: -- The migration is skipped since it modifies the schemas: [:gitlab_main].
ci: -- This database can only apply migrations in one of the following schemas: [:gitlab_ci, :gitlab_internal, :gitlab_shared].
ci: == 20240708161802 SyncGroupMergeRequestSettings: migrated (0.0070s) ===========

ci: == [advisory_lock_connection] object_id: 129020, pg_backend_pid: 52492
Time: 30.862 ms  
  - planning: 0.324 ms  
  - execution: 30.538 ms  
    - I/O read: 20.912 ms  
    - I/O write: 0.000 ms  
  
Shared buffers:  
  - hits: 1129 (~8.80 MiB) from the buffer pool  
  - reads: 37 (~296.00 KiB) from the OS file cache, including disk I/O  
  - dirtied: 37 (~296.00 KiB)  
  - writes: 3 (~24.00 KiB)  

image

How to set up and validate locally

  1. In console run rails db:migrate
Edited by Sam Figueroa

Merge request reports

Loading