diff --git a/.rubocop.yml b/.rubocop.yml index a92ab7129c959f7734bfd8366fa9cb1fc6f453a4..2adbb1a270ced7ceb0412ea352a35a1bee310fa8 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -69,6 +69,11 @@ Rails: - 'tooling/danger/**/*' - 'rubocop/**/*' +Rails/Date: + Exclude: + # See https://gitlab.com/gitlab-org/gitlab/-/issues/502580 + - danger/database/Dangerfile + RSpec: Language: Includes: diff --git a/.rubocop_todo/style/if_unless_modifier.yml b/.rubocop_todo/style/if_unless_modifier.yml index b1273e54a51eff3f276529f669a2bc96f67dc727..0b9f598d44442f54d350629c3b4f48159dbf36d9 100644 --- a/.rubocop_todo/style/if_unless_modifier.yml +++ b/.rubocop_todo/style/if_unless_modifier.yml @@ -224,7 +224,6 @@ Style/IfUnlessModifier: - 'config/initializers/validate_database_config.rb' - 'config/initializers_before_autoloader/002_sidekiq.rb' - 'config/routes.rb' - - 'danger/database/Dangerfile' - 'ee/app/controllers/admin/emails_controller.rb' - 'ee/app/controllers/admin/geo/application_controller.rb' - 'ee/app/controllers/admin/geo/settings_controller.rb' diff --git a/.rubocop_todo/style/mutable_constant.yml b/.rubocop_todo/style/mutable_constant.yml index c38c4357ec46e6b623a48b4293814a69029df4a1..b9360631e0d55993e30b0338d133e38db8a1dd3b 100644 --- a/.rubocop_todo/style/mutable_constant.yml +++ b/.rubocop_todo/style/mutable_constant.yml @@ -11,7 +11,6 @@ Style/MutableConstant: - 'app/services/packages/maven/metadata/append_package_file_service.rb' - 'app/workers/concerns/worker_context.rb' - 'danger/architecture/Dangerfile' - - 'danger/database/Dangerfile' - 'ee/app/services/elastic/indexing_control_service.rb' - 'ee/app/services/security/ingestion/tasks/ingest_vulnerability_statistics.rb' - 'ee/app/services/vulnerabilities/statistics/adjustment_service.rb' diff --git a/danger/database/Dangerfile b/danger/database/Dangerfile index b7f2151dcf9bceae132e179fde1af4bdc04ad23f..ae2a37d68fe3f58e07baaa024dd40423b764e694 100644 --- a/danger/database/Dangerfile +++ b/danger/database/Dangerfile @@ -2,7 +2,7 @@ SCHEMA_NOT_UPDATED_MESSAGE_SHORT = "New %<migrations>s added but %<schema>s wasn't updated" -SCHEMA_NOT_UPDATED_MESSAGE_FULL = <<~MSG +SCHEMA_NOT_UPDATED_MESSAGE_FULL = <<~MSG.freeze **#{SCHEMA_NOT_UPDATED_MESSAGE_SHORT}** Usually, when adding new %<migrations>s, %<schema>s should be @@ -25,7 +25,7 @@ DB_FILES_MESSAGE = <<~MSG The following files require a review from the Database team: MSG -DB_REMOVE_MESSAGE = <<~MSG +DB_REMOVE_MESSAGE = <<~MSG.freeze If you no longer require a database review, you can remove this suggestion by removing the ~database label and re-running the [`danger-review` job](#{ENV['CI_JOB_URL']}). MSG @@ -91,9 +91,7 @@ if helper.mr_labels.include?('database') || database.changes.any? markdown(DB_REMOVE_MESSAGE) end - unless helper.has_scoped_label_with_scope?("database") - helper.labels_to_add << 'database::review pending' - end + helper.labels_to_add << 'database::review pending' unless helper.has_scoped_label_with_scope?("database") end cutoff = Date.today - 21 # Three weeks ago