Cleanup concurrent column rename Pre-receive secret detection to Secret push protection
What does this MR do and why?
We had renamed:
application_settings.pre_receive_secret_detection_enabledproject_security_settings.pre_receive_secret_detection_enabled
To the following (respectively):
application_settings.secret_push_protection_availableproject_security_settings.secret_push_protection_enabled
A few milestones ago, but had some blockers preventing us from cleaning up both columns back then.
The columns are ignored already: here and here.
The only thing remaining is to clean up the column renames concurrently and then next milestone we remove the ignore_column methods.
Migration Output
This is a little outdated (from when the merge request was created a few milestones ago).
I hadn't updated them yet, but let me know if I should.
rails db:migrate output
% rails db:migrate
DEPRECATION WARNING: Support for `config.active_support.cache_format_version = 6.1` has been deprecated and will be removed in Rails 7.2.
Check the Rails upgrade guide at https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#new-activesupport-cache-serialization-format
for more information on how to upgrade.
(called from initialize at /Users/serena/Work/gdk/gitlab/lib/gitlab/patch/redis_cache_store.rb:16)
main: == [advisory_lock_connection] object_id: 135260, pg_backend_pid: 10563
main: == 20250430025629 CleanupApplicationSettingsPreReceiveSecretDetectionEnabledRename: migrating
main: -- column_exists?(:application_settings, :pre_receive_secret_detection_enabled)
main: -> 0.2169s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- quote_table_name(:application_settings)
main: -> 0.0000s
main: -- execute("DROP TRIGGER IF EXISTS trigger_b9839c6d713f\nON \"application_settings\";\n\nDROP FUNCTION IF EXISTS function_for_trigger_b9839c6d713f;\n")
main: -> 0.0011s
main: -- execute("DROP TRIGGER IF EXISTS trigger_1baf8c8e1f66\nON \"application_settings\";\n\nDROP FUNCTION IF EXISTS function_for_trigger_1baf8c8e1f66;\n")
main: -> 0.0010s
main: -- execute("DROP TRIGGER IF EXISTS trigger_7f41427eda69\nON \"application_settings\";\n\nDROP FUNCTION IF EXISTS function_for_trigger_7f41427eda69;\n")
main: -> 0.0007s
main: -- remove_column(:application_settings, :pre_receive_secret_detection_enabled)
main: -> 0.0018s
main: == 20250430025629 CleanupApplicationSettingsPreReceiveSecretDetectionEnabledRename: migrated (0.2475s)
main: == [advisory_lock_connection] object_id: 135260, pg_backend_pid: 10563
main: == [advisory_lock_connection] object_id: 135260, pg_backend_pid: 10565
main: == 20250430025918 CleanupProjectSecuritySettingsPreReceiveSecretDetectionEnabledRename: migrating
main: -- column_exists?(:project_security_settings, :pre_receive_secret_detection_enabled)
main: -> 0.0021s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- quote_table_name(:project_security_settings)
main: -> 0.0000s
main: -- execute("DROP TRIGGER IF EXISTS trigger_cbecfadbc3e8\nON \"project_security_settings\";\n\nDROP FUNCTION IF EXISTS function_for_trigger_cbecfadbc3e8;\n")
main: -> 0.0007s
main: -- execute("DROP TRIGGER IF EXISTS trigger_7fbecfcdf89a\nON \"project_security_settings\";\n\nDROP FUNCTION IF EXISTS function_for_trigger_7fbecfcdf89a;\n")
main: -> 0.0004s
main: -- execute("DROP TRIGGER IF EXISTS trigger_897f35481f9a\nON \"project_security_settings\";\n\nDROP FUNCTION IF EXISTS function_for_trigger_897f35481f9a;\n")
main: -> 0.0004s
main: -- remove_column(:project_security_settings, :pre_receive_secret_detection_enabled)
main: -> 0.0005s
main: == 20250430025918 CleanupProjectSecuritySettingsPreReceiveSecretDetectionEnabledRename: migrated (0.0114s)
main: == [advisory_lock_connection] object_id: 135260, pg_backend_pid: 10565
rails db:rollback:main output
% rails db:migrate:status
DEPRECATION WARNING: Support for `config.active_support.cache_format_version = 6.1` has been deprecated and will be removed in Rails 7.2.
Check the Rails upgrade guide at https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#new-activesupport-cache-serialization-format
for more information on how to upgrade.
(called from initialize at /Users/serena/Work/gdk/gitlab/lib/gitlab/patch/redis_cache_store.rb:16)
database: gitlabhq_development
Status Migration ID Type Milestone Name
--------------------------------------------------
...
up 20250430025629 post 18.0 CleanupApplicationSettingsPreReceiveSecretDetectionEnabledRename
up 20250430025918 post 18.0 CleanupProjectSecuritySettingsPreReceiveSecretDetectionEnabledRename
% rails db:rollback:main STEP=2
DEPRECATION WARNING: Support for `config.active_support.cache_format_version = 6.1` has been deprecated and will be removed in Rails 7.2.
Check the Rails upgrade guide at https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#new-activesupport-cache-serialization-format
for more information on how to upgrade.
(called from initialize at /Users/serena/Work/gdk/gitlab/lib/gitlab/patch/redis_cache_store.rb:16)
main: == [advisory_lock_connection] object_id: 134940, pg_backend_pid: 8934
main: == 20250430025918 CleanupProjectSecuritySettingsPreReceiveSecretDetectionEnabledRename: reverting
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- columns(:project_security_settings)
main: -> 0.0191s
main: -- column_exists?(:project_security_settings, :project_id)
main: -> 0.0010s
main: -- column_exists?(:project_security_settings, :pre_receive_secret_detection_enabled)
main: -> 0.0008s
main: -- columns(:project_security_settings)
main: -> 0.0007s
main: -- add_column(:project_security_settings, :pre_receive_secret_detection_enabled, :boolean, {:limit=>nil, :precision=>nil, :scale=>nil})
main: -> 0.0010s
main: -- change_column_default(:project_security_settings, :pre_receive_secret_detection_enabled, "false")
main: -> 0.0017s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- exec_query("SELECT COUNT(*) AS count FROM \"project_security_settings\"")
main: -> 0.0007s
main: -- exec_query("SELECT \"project_security_settings\".\"project_id\" FROM \"project_security_settings\" ORDER BY \"project_security_settings\".\"project_id\" ASC LIMIT 1")
main: -> 0.0004s
main: -- exec_query("SELECT \"project_security_settings\".\"project_id\" FROM \"project_security_settings\" WHERE \"project_security_settings\".\"project_id\" >= 1 ORDER BY \"project_security_settings\".\"project_id\" ASC LIMIT 1 OFFSET 1")
main: -> 0.0004s
main: -- transaction(nil)
main: -- execute("SELECT set_config('lock_writes.project_security_settings', 'false', true)")
main: -> 0.0006s
main: -- execute("UPDATE \"project_security_settings\" SET \"pre_receive_secret_detection_enabled\" = \"project_security_settings\".\"secret_push_protection_enabled\" WHERE \"project_security_settings\".\"project_id\" >= 1 AND \"project_security_settings\".\"project_id\" < 2")
main: -> 0.0004s
main: -> 0.0028s
main: -- exec_query("SELECT \"project_security_settings\".\"project_id\" FROM \"project_security_settings\" WHERE \"project_security_settings\".\"project_id\" >= 2 ORDER BY \"project_security_settings\".\"project_id\" ASC LIMIT 1 OFFSET 1")
main: -> 0.0005s
main: -- transaction(nil)
main: -- execute("SELECT set_config('lock_writes.project_security_settings', 'false', true)")
main: -> 0.0006s
main: -- execute("UPDATE \"project_security_settings\" SET \"pre_receive_secret_detection_enabled\" = \"project_security_settings\".\"secret_push_protection_enabled\" WHERE \"project_security_settings\".\"project_id\" >= 2 AND \"project_security_settings\".\"project_id\" < 3")
main: -> 0.0003s
main: -> 0.0012s
main: -- exec_query("SELECT \"project_security_settings\".\"project_id\" FROM \"project_security_settings\" WHERE \"project_security_settings\".\"project_id\" >= 3 ORDER BY \"project_security_settings\".\"project_id\" ASC LIMIT 1 OFFSET 1")
main: -> 0.0003s
main: -- transaction(nil)
main: -- execute("SELECT set_config('lock_writes.project_security_settings', 'false', true)")
main: -> 0.0005s
main: -- execute("UPDATE \"project_security_settings\" SET \"pre_receive_secret_detection_enabled\" = \"project_security_settings\".\"secret_push_protection_enabled\" WHERE \"project_security_settings\".\"project_id\" >= 3 AND \"project_security_settings\".\"project_id\" < 4")
main: -> 0.0003s
main: -> 0.0012s
main: -- exec_query("SELECT \"project_security_settings\".\"project_id\" FROM \"project_security_settings\" WHERE \"project_security_settings\".\"project_id\" >= 4 ORDER BY \"project_security_settings\".\"project_id\" ASC LIMIT 1 OFFSET 1")
main: -> 0.0003s
main: -- transaction(nil)
main: -- execute("SELECT set_config('lock_writes.project_security_settings', 'false', true)")
main: -> 0.0005s
main: -- execute("UPDATE \"project_security_settings\" SET \"pre_receive_secret_detection_enabled\" = \"project_security_settings\".\"secret_push_protection_enabled\" WHERE \"project_security_settings\".\"project_id\" >= 4 AND \"project_security_settings\".\"project_id\" < 5")
main: -> 0.0003s
main: -> 0.0011s
main: -- exec_query("SELECT \"project_security_settings\".\"project_id\" FROM \"project_security_settings\" WHERE \"project_security_settings\".\"project_id\" >= 5 ORDER BY \"project_security_settings\".\"project_id\" ASC LIMIT 1 OFFSET 1")
main: -> 0.0003s
main: -- transaction(nil)
main: -- execute("SELECT set_config('lock_writes.project_security_settings', 'false', true)")
main: -> 0.0005s
main: -- execute("UPDATE \"project_security_settings\" SET \"pre_receive_secret_detection_enabled\" = \"project_security_settings\".\"secret_push_protection_enabled\" WHERE \"project_security_settings\".\"project_id\" >= 5 AND \"project_security_settings\".\"project_id\" < 6")
main: -> 0.0004s
main: -> 0.0012s
main: -- exec_query("SELECT \"project_security_settings\".\"project_id\" FROM \"project_security_settings\" WHERE \"project_security_settings\".\"project_id\" >= 6 ORDER BY \"project_security_settings\".\"project_id\" ASC LIMIT 1 OFFSET 1")
main: -> 0.0003s
main: -- transaction(nil)
main: -- execute("SELECT set_config('lock_writes.project_security_settings', 'false', true)")
main: -> 0.0006s
main: -- execute("UPDATE \"project_security_settings\" SET \"pre_receive_secret_detection_enabled\" = \"project_security_settings\".\"secret_push_protection_enabled\" WHERE \"project_security_settings\".\"project_id\" >= 6 AND \"project_security_settings\".\"project_id\" < 7")
main: -> 0.0003s
main: -> 0.0011s
main: -- exec_query("SELECT \"project_security_settings\".\"project_id\" FROM \"project_security_settings\" WHERE \"project_security_settings\".\"project_id\" >= 7 ORDER BY \"project_security_settings\".\"project_id\" ASC LIMIT 1 OFFSET 1")
main: -> 0.0004s
main: -- transaction(nil)
main: -- execute("SELECT set_config('lock_writes.project_security_settings', 'false', true)")
main: -> 0.0007s
main: -- execute("UPDATE \"project_security_settings\" SET \"pre_receive_secret_detection_enabled\" = \"project_security_settings\".\"secret_push_protection_enabled\" WHERE \"project_security_settings\".\"project_id\" >= 7 AND \"project_security_settings\".\"project_id\" < 8")
main: -> 0.0005s
main: -> 0.0017s
main: -- exec_query("SELECT \"project_security_settings\".\"project_id\" FROM \"project_security_settings\" WHERE \"project_security_settings\".\"project_id\" >= 8 ORDER BY \"project_security_settings\".\"project_id\" ASC LIMIT 1 OFFSET 1")
main: -> 0.0004s
main: -- transaction(nil)
main: -- execute("SELECT set_config('lock_writes.project_security_settings', 'false', true)")
main: -> 0.0007s
main: -- execute("UPDATE \"project_security_settings\" SET \"pre_receive_secret_detection_enabled\" = \"project_security_settings\".\"secret_push_protection_enabled\" WHERE \"project_security_settings\".\"project_id\" >= 8 AND \"project_security_settings\".\"project_id\" < 9")
main: -> 0.0003s
main: -> 0.0014s
main: -- exec_query("SELECT \"project_security_settings\".\"project_id\" FROM \"project_security_settings\" WHERE \"project_security_settings\".\"project_id\" >= 9 ORDER BY \"project_security_settings\".\"project_id\" ASC LIMIT 1 OFFSET 1")
main: -> 0.0004s
main: -- transaction(nil)
main: -- execute("SELECT set_config('lock_writes.project_security_settings', 'false', true)")
main: -> 0.0006s
main: -- execute("UPDATE \"project_security_settings\" SET \"pre_receive_secret_detection_enabled\" = \"project_security_settings\".\"secret_push_protection_enabled\" WHERE \"project_security_settings\".\"project_id\" >= 9 AND \"project_security_settings\".\"project_id\" < 10")
main: -> 0.0003s
main: -> 0.0013s
main: -- exec_query("SELECT \"project_security_settings\".\"project_id\" FROM \"project_security_settings\" WHERE \"project_security_settings\".\"project_id\" >= 10 ORDER BY \"project_security_settings\".\"project_id\" ASC LIMIT 1 OFFSET 1")
main: -> 0.0004s
main: -- transaction(nil)
main: -- execute("SELECT set_config('lock_writes.project_security_settings', 'false', true)")
main: -> 0.0005s
main: -- execute("UPDATE \"project_security_settings\" SET \"pre_receive_secret_detection_enabled\" = \"project_security_settings\".\"secret_push_protection_enabled\" WHERE \"project_security_settings\".\"project_id\" >= 10 AND \"project_security_settings\".\"project_id\" < 11")
main: -> 0.0004s
main: -> 0.0012s
main: -- exec_query("SELECT \"project_security_settings\".\"project_id\" FROM \"project_security_settings\" WHERE \"project_security_settings\".\"project_id\" >= 11 ORDER BY \"project_security_settings\".\"project_id\" ASC LIMIT 1 OFFSET 1")
main: -> 0.0266s
main: -- transaction(nil)
main: -- execute("SELECT set_config('lock_writes.project_security_settings', 'false', true)")
main: -> 0.0008s
main: -- execute("UPDATE \"project_security_settings\" SET \"pre_receive_secret_detection_enabled\" = \"project_security_settings\".\"secret_push_protection_enabled\" WHERE \"project_security_settings\".\"project_id\" >= 11 AND \"project_security_settings\".\"project_id\" < 12")
main: -> 0.0004s
main: -> 0.0017s
main: -- exec_query("SELECT \"project_security_settings\".\"project_id\" FROM \"project_security_settings\" WHERE \"project_security_settings\".\"project_id\" >= 12 ORDER BY \"project_security_settings\".\"project_id\" ASC LIMIT 1 OFFSET 1")
main: -> 0.0005s
main: -- transaction(nil)
main: -- execute("SELECT set_config('lock_writes.project_security_settings', 'false', true)")
main: -> 0.0007s
main: -- execute("UPDATE \"project_security_settings\" SET \"pre_receive_secret_detection_enabled\" = \"project_security_settings\".\"secret_push_protection_enabled\" WHERE \"project_security_settings\".\"project_id\" >= 12 AND \"project_security_settings\".\"project_id\" < 13")
main: -> 0.0004s
main: -> 0.0014s
main: -- exec_query("SELECT \"project_security_settings\".\"project_id\" FROM \"project_security_settings\" WHERE \"project_security_settings\".\"project_id\" >= 13 ORDER BY \"project_security_settings\".\"project_id\" ASC LIMIT 1 OFFSET 1")
main: -> 0.0004s
main: -- transaction(nil)
main: -- execute("SELECT set_config('lock_writes.project_security_settings', 'false', true)")
main: -> 0.0005s
main: -- execute("UPDATE \"project_security_settings\" SET \"pre_receive_secret_detection_enabled\" = \"project_security_settings\".\"secret_push_protection_enabled\" WHERE \"project_security_settings\".\"project_id\" >= 13 AND \"project_security_settings\".\"project_id\" < 14")
main: -> 0.0003s
main: -> 0.0019s
main: -- exec_query("SELECT \"project_security_settings\".\"project_id\" FROM \"project_security_settings\" WHERE \"project_security_settings\".\"project_id\" >= 14 ORDER BY \"project_security_settings\".\"project_id\" ASC LIMIT 1 OFFSET 1")
main: -> 0.0004s
main: -- transaction(nil)
main: -- execute("SELECT set_config('lock_writes.project_security_settings', 'false', true)")
main: -> 0.0005s
main: -- execute("UPDATE \"project_security_settings\" SET \"pre_receive_secret_detection_enabled\" = \"project_security_settings\".\"secret_push_protection_enabled\" WHERE \"project_security_settings\".\"project_id\" >= 14 AND \"project_security_settings\".\"project_id\" < 15")
main: -> 0.0003s
main: -> 0.0011s
main: -- exec_query("SELECT \"project_security_settings\".\"project_id\" FROM \"project_security_settings\" WHERE \"project_security_settings\".\"project_id\" >= 15 ORDER BY \"project_security_settings\".\"project_id\" ASC LIMIT 1 OFFSET 1")
main: -> 0.0003s
main: -- transaction(nil)
main: -- execute("SELECT set_config('lock_writes.project_security_settings', 'false', true)")
main: -> 0.0005s
main: -- execute("UPDATE \"project_security_settings\" SET \"pre_receive_secret_detection_enabled\" = \"project_security_settings\".\"secret_push_protection_enabled\" WHERE \"project_security_settings\".\"project_id\" >= 15 AND \"project_security_settings\".\"project_id\" < 16")
main: -> 0.0003s
main: -> 0.0011s
main: -- exec_query("SELECT \"project_security_settings\".\"project_id\" FROM \"project_security_settings\" WHERE \"project_security_settings\".\"project_id\" >= 16 ORDER BY \"project_security_settings\".\"project_id\" ASC LIMIT 1 OFFSET 1")
main: -> 0.0003s
main: -- transaction(nil)
main: -- execute("SELECT set_config('lock_writes.project_security_settings', 'false', true)")
main: -> 0.0005s
main: -- execute("UPDATE \"project_security_settings\" SET \"pre_receive_secret_detection_enabled\" = \"project_security_settings\".\"secret_push_protection_enabled\" WHERE \"project_security_settings\".\"project_id\" >= 16 AND \"project_security_settings\".\"project_id\" < 17")
main: -> 0.0009s
main: -> 0.0018s
main: -- exec_query("SELECT \"project_security_settings\".\"project_id\" FROM \"project_security_settings\" WHERE \"project_security_settings\".\"project_id\" >= 17 ORDER BY \"project_security_settings\".\"project_id\" ASC LIMIT 1 OFFSET 1")
main: -> 0.0004s
main: -- transaction(nil)
main: -- execute("SELECT set_config('lock_writes.project_security_settings', 'false', true)")
main: -> 0.0006s
main: -- execute("UPDATE \"project_security_settings\" SET \"pre_receive_secret_detection_enabled\" = \"project_security_settings\".\"secret_push_protection_enabled\" WHERE \"project_security_settings\".\"project_id\" >= 17 AND \"project_security_settings\".\"project_id\" < 18")
main: -> 0.0003s
main: -> 0.0012s
main: -- exec_query("SELECT \"project_security_settings\".\"project_id\" FROM \"project_security_settings\" WHERE \"project_security_settings\".\"project_id\" >= 18 ORDER BY \"project_security_settings\".\"project_id\" ASC LIMIT 1 OFFSET 1")
main: -> 0.0003s
main: -- transaction(nil)
main: -- execute("SELECT set_config('lock_writes.project_security_settings', 'false', true)")
main: -> 0.0005s
main: -- execute("UPDATE \"project_security_settings\" SET \"pre_receive_secret_detection_enabled\" = \"project_security_settings\".\"secret_push_protection_enabled\" WHERE \"project_security_settings\".\"project_id\" >= 18")
main: -> 0.0003s
main: -> 0.0011s
main: -- indexes(:project_security_settings)
main: -> 0.0012s
main: -- foreign_keys(:project_security_settings)
main: -> 0.0024s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- column_exists?(:project_security_settings, :secret_push_protection_enabled)
main: -> 0.0010s
main: -- column_exists?(:project_security_settings, :pre_receive_secret_detection_enabled)
main: -> 0.0008s
main: -- current_schema(nil)
main: -> 0.0001s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- execute("ALTER TABLE project_security_settings\nADD CONSTRAINT check_f314ec702d\nCHECK ( (pre_receive_secret_detection_enabled IS NOT NULL) )\nNOT VALID;\n")
main: -> 0.0007s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0004s
main: -- execute("ALTER TABLE project_security_settings VALIDATE CONSTRAINT check_f314ec702d;")
main: -> 0.0005s
main: -- execute("RESET statement_timeout")
main: -> 0.0003s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- quote_table_name(:project_security_settings)
main: -> 0.0000s
main: -- quote_column_name(:pre_receive_secret_detection_enabled)
main: -> 0.0000s
main: -- quote_column_name(:secret_push_protection_enabled)
main: -> 0.0000s
main: -- columns(:project_security_settings)
main: -> 0.0010s
main: -- execute("CREATE OR REPLACE FUNCTION function_for_trigger_cbecfadbc3e8()\nRETURNS trigger\nLANGUAGE plpgsql\nAS $$\nBEGIN\n IF NEW.\"pre_receive_secret_detection_enabled\" IS NOT DISTINCT FROM 'false' AND NEW.\"secret_push_protection_enabled\" IS DISTINCT FROM 'false' THEN\n NEW.\"pre_receive_secret_detection_enabled\" = NEW.\"secret_push_protection_enabled\";\n END IF;\n\n IF NEW.\"secret_push_protection_enabled\" IS NOT DISTINCT FROM 'false' AND NEW.\"pre_receive_secret_detection_enabled\" IS DISTINCT FROM 'false' THEN\n NEW.\"secret_push_protection_enabled\" = NEW.\"pre_receive_secret_detection_enabled\";\n END IF;\n\n RETURN NEW;\nEND\n$$;\n\nDROP TRIGGER IF EXISTS trigger_cbecfadbc3e8\nON \"project_security_settings\";\n\nCREATE TRIGGER trigger_cbecfadbc3e8\nBEFORE INSERT ON \"project_security_settings\"\nFOR EACH ROW EXECUTE FUNCTION function_for_trigger_cbecfadbc3e8();\n")
main: -> 0.0023s
main: -- execute("CREATE OR REPLACE FUNCTION function_for_trigger_7fbecfcdf89a()\nRETURNS trigger\nLANGUAGE plpgsql\nAS $$\nBEGIN\n NEW.\"pre_receive_secret_detection_enabled\" := NEW.\"secret_push_protection_enabled\";\n RETURN NEW;\nEND\n$$;\n\nDROP TRIGGER IF EXISTS trigger_7fbecfcdf89a\nON \"project_security_settings\";\n\nCREATE TRIGGER trigger_7fbecfcdf89a\nBEFORE UPDATE OF \"secret_push_protection_enabled\" ON \"project_security_settings\"\nFOR EACH ROW EXECUTE FUNCTION function_for_trigger_7fbecfcdf89a();\n")
main: -> 0.0005s
main: -- execute("CREATE OR REPLACE FUNCTION function_for_trigger_897f35481f9a()\nRETURNS trigger\nLANGUAGE plpgsql\nAS $$\nBEGIN\n NEW.\"secret_push_protection_enabled\" := NEW.\"pre_receive_secret_detection_enabled\";\n RETURN NEW;\nEND\n$$;\n\nDROP TRIGGER IF EXISTS trigger_897f35481f9a\nON \"project_security_settings\";\n\nCREATE TRIGGER trigger_897f35481f9a\nBEFORE UPDATE OF \"pre_receive_secret_detection_enabled\" ON \"project_security_settings\"\nFOR EACH ROW EXECUTE FUNCTION function_for_trigger_897f35481f9a();\n")
main: -> 0.0004s
main: == 20250430025918 CleanupProjectSecuritySettingsPreReceiveSecretDetectionEnabledRename: reverted (0.1365s)
main: == 20250430025629 CleanupApplicationSettingsPreReceiveSecretDetectionEnabledRename: reverting
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- columns(:application_settings)
main: -> 0.1885s
main: -- column_exists?(:application_settings, :id)
main: -> 0.1871s
main: -- column_exists?(:application_settings, :pre_receive_secret_detection_enabled)
main: -> 0.1894s
main: -- columns(:application_settings)
main: -> 0.1922s
main: -- add_column(:application_settings, :pre_receive_secret_detection_enabled, :boolean, {:limit=>nil, :precision=>nil, :scale=>nil})
main: -> 0.0016s
main: -- change_column_default(:application_settings, :pre_receive_secret_detection_enabled, "false")
main: -> 0.1923s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- exec_query("SELECT COUNT(*) AS count FROM \"application_settings\"")
main: -> 0.0017s
main: -- exec_query("SELECT \"application_settings\".\"id\" FROM \"application_settings\" ORDER BY \"application_settings\".\"id\" ASC LIMIT 1")
main: -> 0.0006s
main: -- exec_query("SELECT \"application_settings\".\"id\" FROM \"application_settings\" WHERE \"application_settings\".\"id\" >= 1 ORDER BY \"application_settings\".\"id\" ASC LIMIT 1 OFFSET 1")
main: -> 0.0006s
main: -- transaction(nil)
main: -- execute("SELECT set_config('lock_writes.application_settings', 'false', true)")
main: -> 0.0006s
main: -- execute("UPDATE \"application_settings\" SET \"pre_receive_secret_detection_enabled\" = \"application_settings\".\"secret_push_protection_available\" WHERE \"application_settings\".\"id\" >= 1")
main: -> 0.0009s
main: -> 0.0019s
main: -- indexes(:application_settings)
main: -> 0.0049s
main: -- foreign_keys(:application_settings)
main: -> 0.0017s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- column_exists?(:application_settings, :secret_push_protection_available)
main: -> 0.1884s
main: -- column_exists?(:application_settings, :pre_receive_secret_detection_enabled)
main: -> 0.1891s
main: -- current_schema(nil)
main: -> 0.0003s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- execute("ALTER TABLE application_settings\nADD CONSTRAINT check_868c63cb89\nCHECK ( (pre_receive_secret_detection_enabled IS NOT NULL) )\nNOT VALID;\n")
main: -> 0.0008s
main: -- execute("ALTER TABLE application_settings VALIDATE CONSTRAINT check_868c63cb89;")
main: -> 0.0261s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- quote_table_name(:application_settings)
main: -> 0.0000s
main: -- quote_column_name(:pre_receive_secret_detection_enabled)
main: -> 0.0000s
main: -- quote_column_name(:secret_push_protection_available)
main: -> 0.0000s
main: -- columns(:application_settings)
main: -> 0.1878s
main: -- execute("CREATE OR REPLACE FUNCTION function_for_trigger_b9839c6d713f()\nRETURNS trigger\nLANGUAGE plpgsql\nAS $$\nBEGIN\n IF NEW.\"pre_receive_secret_detection_enabled\" IS NOT DISTINCT FROM 'false' AND NEW.\"secret_push_protection_available\" IS DISTINCT FROM 'false' THEN\n NEW.\"pre_receive_secret_detection_enabled\" = NEW.\"secret_push_protection_available\";\n END IF;\n\n IF NEW.\"secret_push_protection_available\" IS NOT DISTINCT FROM 'false' AND NEW.\"pre_receive_secret_detection_enabled\" IS DISTINCT FROM 'false' THEN\n NEW.\"secret_push_protection_available\" = NEW.\"pre_receive_secret_detection_enabled\";\n END IF;\n\n RETURN NEW;\nEND\n$$;\n\nDROP TRIGGER IF EXISTS trigger_b9839c6d713f\nON \"application_settings\";\n\nCREATE TRIGGER trigger_b9839c6d713f\nBEFORE INSERT ON \"application_settings\"\nFOR EACH ROW EXECUTE FUNCTION function_for_trigger_b9839c6d713f();\n")
main: -> 0.0024s
main: -- execute("CREATE OR REPLACE FUNCTION function_for_trigger_1baf8c8e1f66()\nRETURNS trigger\nLANGUAGE plpgsql\nAS $$\nBEGIN\n NEW.\"pre_receive_secret_detection_enabled\" := NEW.\"secret_push_protection_available\";\n RETURN NEW;\nEND\n$$;\n\nDROP TRIGGER IF EXISTS trigger_1baf8c8e1f66\nON \"application_settings\";\n\nCREATE TRIGGER trigger_1baf8c8e1f66\nBEFORE UPDATE OF \"secret_push_protection_available\" ON \"application_settings\"\nFOR EACH ROW EXECUTE FUNCTION function_for_trigger_1baf8c8e1f66();\n")
main: -> 0.0006s
main: -- execute("CREATE OR REPLACE FUNCTION function_for_trigger_7f41427eda69()\nRETURNS trigger\nLANGUAGE plpgsql\nAS $$\nBEGIN\n NEW.\"secret_push_protection_available\" := NEW.\"pre_receive_secret_detection_enabled\";\n RETURN NEW;\nEND\n$$;\n\nDROP TRIGGER IF EXISTS trigger_7f41427eda69\nON \"application_settings\";\n\nCREATE TRIGGER trigger_7f41427eda69\nBEFORE UPDATE OF \"pre_receive_secret_detection_enabled\" ON \"application_settings\"\nFOR EACH ROW EXECUTE FUNCTION function_for_trigger_7f41427eda69();\n")
main: -> 0.0005s
main: == 20250430025629 CleanupApplicationSettingsPreReceiveSecretDetectionEnabledRename: reverted (1.5730s)
main: == [advisory_lock_connection] object_id: 134940, pg_backend_pid: 8934
Failed Jobs
Two migrations jobs are currently failing in the latest pipeline:
- https://gitlab.com/gitlab-org/gitlab/-/jobs/10923995148
- https://gitlab.com/gitlab-org/gitlab/-/jobs/10923995145
And I suspect it's because undo_cleanup_concurrent_column_rename tries to add a constraint for pre_receive_secret_detection that we did not have before the rename took place in !177824 (diffs). I had confirmed this by looking at db/structure.sql in v17.8.0.
If you think it makes sense to use the pipeline:skip-check-migrations label therefore, please let me know!
References
MR acceptance checklist
I have evaluated this MR against the MR acceptance checklist.