summaryrefslogtreecommitdiff
path: root/config/application.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-18 19:00:14 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-18 19:00:14 +0000
commit05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch)
tree11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /config/application.rb
parentec73467c23693d0db63a797d10194da9e72a74af (diff)
downloadgitlab-ce-05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2.tar.gz
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'config/application.rb')
-rw-r--r--config/application.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/config/application.rb b/config/application.rb
index a3fe4935fdf..61dfa59a90d 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -59,6 +59,7 @@ module Gitlab
require_dependency Rails.root.join('lib/gitlab/redis/trace_chunks')
require_dependency Rails.root.join('lib/gitlab/redis/rate_limiting')
require_dependency Rails.root.join('lib/gitlab/redis/sessions')
+ require_dependency Rails.root.join('lib/gitlab/redis/repository_cache')
require_dependency Rails.root.join('lib/gitlab/current_settings')
require_dependency Rails.root.join('lib/gitlab/middleware/read_only')
require_dependency Rails.root.join('lib/gitlab/middleware/compressed_json')
@@ -595,6 +596,29 @@ module Gitlab
Gitlab::Color, # https://gitlab.com/gitlab-org/gitlab/-/issues/368844,
Hashie::Array # https://gitlab.com/gitlab-org/gitlab/-/issues/378089
]
+ #
+ # Restore setting the YAML permitted classes for ActiveRecord
+ #
+ # In [94d81c3c39e3ddc441c3af3f874e53b197cf3f54][0] rails upstream removed
+ # the code that copied the values of
+ # config.active_record.yaml_column_permitted_classes to
+ # ActiveRecord.yaml_column_permitted_classes during the
+ # config.after_initialize stage.
+ #
+ # We can not move the setting of
+ # config.active_record.yaml_column_permitted_classes out of the
+ # after_initialize because then the gitlab classes are not loaded yet
+ #
+ # This change was also ported to the 6.1 branch and released in 6.1.7.
+ # Some distributions like Debian even [backported this change to
+ # 6.1.6.1][1].
+ #
+ # This restores the code needed to have gitlab work in those cases.
+ #
+ # [0]: https://github.com/rails/rails/commit/94d81c3c39e3ddc441c3af3f874e53b197cf3f54
+ # [1]: https://salsa.debian.org/ruby-team/rails/-/commit/5663e598b41dc4e2058db22e1ee0d678e5c483ba
+ #
+ ActiveRecord::Base.yaml_column_permitted_classes = config.active_record.yaml_column_permitted_classes
# on_master_start yields immediately in unclustered environments and runs
# when the primary process is done initializing otherwise.