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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-05-26 18:08:09 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-26 18:08:09 +0300
commita8c410f8a115b82a614b81cfd1036498838a5a5b (patch)
tree79df1c932df3ba86ef91e864ff5d476833251420 /config
parentd94409aaafb4b59464ebddfaa7821a286a8d1531 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'config')
-rw-r--r--config/feature_flags/development/openai_moderation.yml8
-rw-r--r--config/initializers/carrierwave_performance_patch.rb47
-rw-r--r--config/initializers/carrierwave_s3_encryption_headers_patch.rb (renamed from config/initializers/carrierwave_patch.rb)0
3 files changed, 47 insertions, 8 deletions
diff --git a/config/feature_flags/development/openai_moderation.yml b/config/feature_flags/development/openai_moderation.yml
deleted file mode 100644
index 97915ceac41..00000000000
--- a/config/feature_flags/development/openai_moderation.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: openai_moderation
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119050
-rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/409452
-milestone: '16.0'
-type: development
-group: group::ai-enablement
-default_enabled: false
diff --git a/config/initializers/carrierwave_performance_patch.rb b/config/initializers/carrierwave_performance_patch.rb
new file mode 100644
index 00000000000..a7b56cdb5ba
--- /dev/null
+++ b/config/initializers/carrierwave_performance_patch.rb
@@ -0,0 +1,47 @@
+# frozen_string_literal: true
+
+require "carrierwave/uploader/url"
+
+if Gem::Version.create(CarrierWave::VERSION) >= Gem::Version.create('2.0')
+ raise ScriptError,
+ "CarrierWave was upgraded to #{CarrierWave::VERSION} and this patch is not required anymore"
+end
+
+# rubocop: disable Style/GuardClause
+module CarrierWave
+ module Uploader
+ module Url
+ ##
+ # === Parameters
+ #
+ # [Hash] optional, the query params (only AWS)
+ #
+ # === Returns
+ #
+ # [String] the location where this file is accessible via a url
+ #
+ def url(options = {})
+ if file.respond_to?(:url)
+ tmp_url = file.method(:url).arity == 0 ? file.url : file.url(options)
+
+ return tmp_url if tmp_url.present?
+ end
+
+ if file.respond_to?(:path)
+ path = encode_path(file.path.sub(File.expand_path(root), ''))
+
+ if host = asset_host
+ if host.respond_to? :call
+ "#{host.call(file)}#{path}"
+ else
+ "#{host}#{path}"
+ end
+ else
+ (base_path || "") + path
+ end
+ end
+ end
+ end
+ end
+end
+# rubocop: enable Style/GuardClause
diff --git a/config/initializers/carrierwave_patch.rb b/config/initializers/carrierwave_s3_encryption_headers_patch.rb
index 449f4b4a607..449f4b4a607 100644
--- a/config/initializers/carrierwave_patch.rb
+++ b/config/initializers/carrierwave_s3_encryption_headers_patch.rb