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/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-07-31 18:11:19 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-07-31 18:11:19 +0300
commit7f98cf51aa49426815fe943a5a8dae2a96b59c01 (patch)
tree89047dcbc3bdddcc28895c1ac950cf080b363d1b /lib
parent74ecf758e30be848144df1672b5080a29fafbc0a (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r--lib/api/concerns/packages/npm_endpoints.rb9
-rw-r--r--lib/gitlab/ci/pipeline/chain/ensure_environments.rb2
-rw-r--r--lib/gitlab/redis/cache.rb5
-rw-r--r--lib/gitlab/redis/feature_flag.rb1
-rw-r--r--lib/gitlab/redis/repository_cache.rb1
5 files changed, 12 insertions, 6 deletions
diff --git a/lib/api/concerns/packages/npm_endpoints.rb b/lib/api/concerns/packages/npm_endpoints.rb
index ec20440f013..a045a3d4828 100644
--- a/lib/api/concerns/packages/npm_endpoints.rb
+++ b/lib/api/concerns/packages/npm_endpoints.rb
@@ -96,9 +96,8 @@ module API
track_package_event(:list_tags, :npm, project: project, namespace: project.namespace)
- metadata = generate_metadata_service(packages).execute(only_dist_tags: true)
- present ::Packages::Npm::PackagePresenter.new(metadata),
- with: ::API::Entities::NpmPackageTag
+ metadata = generate_metadata_service(packages).execute(only_dist_tags: true).payload
+ present metadata, with: ::API::Entities::NpmPackageTag
end
params do
@@ -229,8 +228,8 @@ module API
enqueue_sync_metadata_cache_worker(project, package_name)
end
- present ::Packages::Npm::PackagePresenter.new(generate_metadata_service(packages).execute),
- with: ::API::Entities::NpmPackage
+ metadata = generate_metadata_service(packages).execute.payload
+ present metadata, with: ::API::Entities::NpmPackage
end
end
diff --git a/lib/gitlab/ci/pipeline/chain/ensure_environments.rb b/lib/gitlab/ci/pipeline/chain/ensure_environments.rb
index ebea6a538ef..3ff9aff68ac 100644
--- a/lib/gitlab/ci/pipeline/chain/ensure_environments.rb
+++ b/lib/gitlab/ci/pipeline/chain/ensure_environments.rb
@@ -16,7 +16,7 @@ module Gitlab
private
def ensure_environment(build)
- ::Environments::CreateForBuildService.new.execute(build)
+ ::Environments::CreateForJobService.new.execute(build)
end
end
end
diff --git a/lib/gitlab/redis/cache.rb b/lib/gitlab/redis/cache.rb
index 60944268f91..6121555e435 100644
--- a/lib/gitlab/redis/cache.rb
+++ b/lib/gitlab/redis/cache.rb
@@ -8,9 +8,14 @@ module Gitlab
class << self
# Full list of options:
# https://api.rubyonrails.org/classes/ActiveSupport/Cache/RedisCacheStore.html#method-c-new
+ # pool argument event not documented in the link above is handled by RedisCacheStore see:
+ # https://github.com/rails/rails/blob/593893c901f87b4ed205751f72df41519b4d2da3/activesupport/lib/active_support/cache/redis_cache_store.rb#L165
+ # and
+ # https://github.com/rails/rails/blob/ad790cb2f6bc724a89e4266b505b3c57d5089dae/activesupport/lib/active_support/cache.rb#L206
def active_support_config
{
redis: pool,
+ pool: false,
compress: Gitlab::Utils.to_boolean(ENV.fetch('ENABLE_REDIS_CACHE_COMPRESSION', '1')),
namespace: CACHE_NAMESPACE,
expires_in: default_ttl_seconds
diff --git a/lib/gitlab/redis/feature_flag.rb b/lib/gitlab/redis/feature_flag.rb
index 441ff669035..395805792d7 100644
--- a/lib/gitlab/redis/feature_flag.rb
+++ b/lib/gitlab/redis/feature_flag.rb
@@ -14,6 +14,7 @@ module Gitlab
def cache_store
@cache_store ||= FeatureFlagStore.new(
redis: pool,
+ pool: false,
compress: Gitlab::Utils.to_boolean(ENV.fetch('ENABLE_REDIS_CACHE_COMPRESSION', '1')),
namespace: Cache::CACHE_NAMESPACE,
expires_in: 1.hour
diff --git a/lib/gitlab/redis/repository_cache.rb b/lib/gitlab/redis/repository_cache.rb
index 966c6584aa5..6d0c35a6829 100644
--- a/lib/gitlab/redis/repository_cache.rb
+++ b/lib/gitlab/redis/repository_cache.rb
@@ -15,6 +15,7 @@ module Gitlab
def cache_store
@cache_store ||= RepositoryCacheStore.new(
redis: pool,
+ pool: false,
compress: Gitlab::Utils.to_boolean(ENV.fetch('ENABLE_REDIS_CACHE_COMPRESSION', '1')),
namespace: Cache::CACHE_NAMESPACE,
expires_in: Cache.default_ttl_seconds