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/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-11-18 06:13:25 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-11-18 06:13:25 +0300
commitee34c4523b1d028a206d4a27d45c02bbce572c2e (patch)
tree3c9edcea87d1d6a6d7ed79a37b9dc2852a8cf96b /app
parentda4f753e76a4fd162d35c0c79d1241583e88b685 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/models/ci/pipeline.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index b9823bd4a07..0a910d6b125 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -42,7 +42,7 @@ module Ci
sha_attribute :source_sha
sha_attribute :target_sha
- partitionable scope: ->(_) { Ci::Pipeline.current_partition_value }
+ partitionable scope: ->(pipeline) { Ci::Pipeline.current_partition_value(pipeline.project) }
# Ci::CreatePipelineService returns Ci::Pipeline so this is the only place
# where we can pass additional information from the service. This accessor
# is used for storing the processed metadata for linting purposes.
@@ -588,8 +588,14 @@ module Ci
@auto_devops_pipelines_completed_total ||= Gitlab::Metrics.counter(:auto_devops_pipelines_completed_total, 'Number of completed auto devops pipelines')
end
- def self.current_partition_value
- INITIAL_PARTITION_VALUE
+ def self.current_partition_value(project = nil)
+ Gitlab::SafeRequestStore.fetch(:ci_current_partition_value) do
+ if Feature.enabled?(:ci_current_partition_value_101, project)
+ NEXT_PARTITION_VALUE
+ else
+ INITIAL_PARTITION_VALUE
+ end
+ end
end
def self.object_hierarchy(relation, options = {})