Welcome to mirror list, hosted at ThFree Co, Russian Federation.

00_deprecations.rb « initializers « config - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bfbd57c99fef2d908d4c8dfd50f11b39a67d653e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# frozen_string_literal: true

# Disallowed deprecation warnings are silenced in production. For performance
# reasons we even skip the definition of disallowed warnings in production.
#
# See
# * https://gitlab.com/gitlab-org/gitlab/-/issues/368379 for a follow-up
# * https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92557#note_1032212676
#   for benchmarks
#
# In Rails 7 we will use `config.active_support.report_deprecations = false`
# instead of this early return.
if Rails.env.production?
  ActiveSupport::Deprecation.silenced = true
  return
end

# Ban the following deprecation warnings and turn them into runtime errors
# in `development` and `test` environments.
#
# This way we prevent already fixed warnings from sneaking back into the codebase silently.
rails7_deprecation_warnings = [
  # https://gitlab.com/gitlab-org/gitlab/-/issues/339739
  /ActiveModel::Errors#keys is deprecated/,
  # https://gitlab.com/gitlab-org/gitlab/-/issues/342492
  /Rendering actions with '\.' in the name is deprecated/,
  # https://gitlab.com/gitlab-org/gitlab/-/issues/333086
  /default_hash is deprecated/,
  # https://gitlab.com/gitlab-org/gitlab/-/issues/369970
  /Passing an Active Record object to `\w+` directly is deprecated/
]

ActiveSupport::Deprecation.disallowed_warnings.concat rails7_deprecation_warnings