diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-02 18:08:56 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-02 18:08:56 +0300 |
commit | 6f998d352988f93f875db862353e814e95db1fe3 (patch) | |
tree | 3596c4b8cbc4d426c3aaf571ea5ba1a57ffe031e /config | |
parent | 3eec6c2511af2b10cd25be64dcd84c4a35a7bcdb (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'config')
-rw-r--r-- | config/feature_flags/experiment/member_areas_of_focus.yml | 8 | ||||
-rw-r--r-- | config/initializers/0_log_deprecations.rb | 22 |
2 files changed, 30 insertions, 0 deletions
diff --git a/config/feature_flags/experiment/member_areas_of_focus.yml b/config/feature_flags/experiment/member_areas_of_focus.yml new file mode 100644 index 00000000000..e728ee7e3d3 --- /dev/null +++ b/config/feature_flags/experiment/member_areas_of_focus.yml @@ -0,0 +1,8 @@ +--- +name: member_areas_of_focus +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/65273 +rollout_issue_url: https://gitlab.com/gitlab-org/growth/team-tasks/-/issues/406 +milestone: '14.2' +type: experiment +group: group::expansion +default_enabled: false diff --git a/config/initializers/0_log_deprecations.rb b/config/initializers/0_log_deprecations.rb new file mode 100644 index 00000000000..20fb5144937 --- /dev/null +++ b/config/initializers/0_log_deprecations.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +def log_deprecations? + via_env_var = Gitlab::Utils.to_boolean(ENV['GITLAB_LOG_DEPRECATIONS']) + # enable by default during development unless explicitly turned off + via_env_var.nil? ? Rails.env.development? : via_env_var +end + +if log_deprecations? + # Log deprecation warnings emitted through Kernel#warn, such as from gems or + # the Ruby VM. + Warning.process(/.+is deprecated$/) do |warning| + Gitlab::DeprecationJsonLogger.info(message: warning.strip, source: 'ruby') + # Returning :default means we continue emitting this to stderr as well. + :default + end + + # Log deprecation warnings emitted from Rails (see ActiveSupport::Deprecation). + ActiveSupport::Notifications.subscribe('deprecation.rails') do |name, start, finish, id, payload| + Gitlab::DeprecationJsonLogger.info(message: payload[:message].strip, source: 'rails') + end +end |