Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot
2025-07-21 15:10:16 +00:00
parent e32e42158a
commit bb1accd44a
179 changed files with 2602 additions and 1213 deletions

View File

@ -7,6 +7,7 @@ class MigrationSchemaValidator
FILENAME = 'db/structure.sql'
MIGRATION_DIRS = %w[db/migrate db/post_migrate].freeze
PARTITION_MANAGER_CONFIG = %w[config/initializers/postgres_partitioning.rb].freeze
SCHEMA_VERSION_DIR = 'db/schema_migrations'
@ -38,8 +39,8 @@ class MigrationSchemaValidator
end
def validate!
if committed_migrations.empty?
puts "\e[32m No migrations found, skipping schema validation\e[0m"
unless committed_migrations.any? || partition_manager_config_changes?
puts "\e[32m No new migrations or partition configuration changes found, skipping schema validation\e[0m"
return
end
@ -184,6 +185,12 @@ class MigrationSchemaValidator
end
end
def partition_manager_config_changes?
git_command = "git diff --name-only #{diff_target} -- #{PARTITION_MANAGER_CONFIG.join(' ')}"
run(git_command).split("\n").any?
end
def diff_target
@diff_target ||= pipeline_for_merged_results? ? target_branch : merge_base
end