diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-20 13:43:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-20 13:43:29 +0300 |
commit | 3b1af5cc7ed2666ff18b718ce5d30fa5a2756674 (patch) | |
tree | 3bc4a40e0ee51ec27eabf917c537033c0c5b14d4 /danger | |
parent | 9bba14be3f2c211bf79e15769cd9b77bc73a13bc (diff) |
Add latest changes from gitlab-org/gitlab@16-1-stable-eev16.1.0-rc42
Diffstat (limited to 'danger')
-rw-r--r-- | danger/database/Dangerfile | 17 | ||||
-rw-r--r-- | danger/plugins/database.rb | 10 | ||||
-rw-r--r-- | danger/roulette/Dangerfile | 5 |
3 files changed, 30 insertions, 2 deletions
diff --git a/danger/database/Dangerfile b/danger/database/Dangerfile index 96134ea66a6..1c0e9d72118 100644 --- a/danger/database/Dangerfile +++ b/danger/database/Dangerfile @@ -35,6 +35,15 @@ DB_MIGRATION_TESTING_REQUIRED_MESSAGE = <<~MSG requesting review to test your migrations against production data. MSG +DB_OLD_MIGRATIONS_MESSAGE = <<~MSG + ⌛ **Migration Timestamp Out of Date** + The following migrations have timestamps that are over three weeks old: + + %<old_migrations>s + + Please double check the timestamps and update them if possible. [Why does this matter?](https://docs.gitlab.com/ee/development/migration_style_guide.html#migration-timestamp-age) +MSG + DATABASE_APPROVED_LABEL = 'database::approved' non_geo_db_schema_updated = !git.modified_files.grep(%r{\Adb/structure\.sql}).empty? @@ -77,3 +86,11 @@ if helper.mr_labels.include?('database') || db_paths_to_review.any? helper.labels_to_add << 'database::review pending' end end + +cutoff = Date.today - 21 # Three weeks ago + +old_migrations = database.find_migration_files_before(git.added_files, cutoff) + +if old_migrations.any? + warn format(DB_OLD_MIGRATIONS_MESSAGE, old_migrations: old_migrations.map { |m| "* #{m}" }.join("\n")) +end diff --git a/danger/plugins/database.rb b/danger/plugins/database.rb new file mode 100644 index 00000000000..77c0a484a59 --- /dev/null +++ b/danger/plugins/database.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +require_relative '../../tooling/danger/database' + +module Danger + class Database < ::Danger::Plugin + # Put the helper code somewhere it can be tested + include Tooling::Danger::Database + end +end diff --git a/danger/roulette/Dangerfile b/danger/roulette/Dangerfile index 5b865498651..a987a98acee 100644 --- a/danger/roulette/Dangerfile +++ b/danger/roulette/Dangerfile @@ -55,9 +55,10 @@ end OPTIONAL_REVIEW_TEMPLATE = '%{role} review is optional for %{category}' NOT_AVAILABLE_TEMPLATES = { default: 'No %{role} available', - product_intelligence: group_not_available_template('#g_analyze_analytics_instrumentation', '@gitlab-org/analytics-section/product-intelligence/engineers'), + analytics_instrumentation: group_not_available_template('#g_analyze_analytics_instrumentation', '@gitlab-org/analytics-section/analytics-instrumentation/engineers'), import_integrate_be: group_not_available_template('#g_manage_import_and_integrate', '@gitlab-org/manage/import-and-integrate'), - import_integrate_fe: group_not_available_template('#g_manage_import_and_integrate', '@gitlab-org/manage/import-and-integrate') + import_integrate_fe: group_not_available_template('#g_manage_import_and_integrate', '@gitlab-org/manage/import-and-integrate'), + remote_development: group_not_available_template('#f_remote_development', '@gitlab-org/remote-development') }.freeze def note_for_spin_role(spin, role, category) |