diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-05 16:47:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-05 16:47:14 +0300 |
commit | 022f9b6b0c3771d0c8f1c4cb5d15258119fddc2a (patch) | |
tree | 4c205cedfd196fb0fe23a794bc6effb8f8d6ef21 /app | |
parent | 88bbc405d6b46a477d6dddf4f1416240640f70d1 (diff) |
Add latest changes from gitlab-org/gitlab@16-3-stable-ee
Diffstat (limited to 'app')
-rw-r--r-- | app/workers/all_queues.yml | 9 | ||||
-rw-r--r-- | app/workers/ci/initialize_pipelines_iid_sequence_worker.rb | 19 |
2 files changed, 28 insertions, 0 deletions
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index 1664add1ac9..60f233b8289 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -2541,6 +2541,15 @@ :weight: 1 :idempotent: true :tags: [] +- :name: ci_initialize_pipelines_iid_sequence + :worker_name: Ci::InitializePipelinesIidSequenceWorker + :feature_category: :continuous_integration + :has_external_dependencies: false + :urgency: :low + :resource_boundary: :unknown + :weight: 1 + :idempotent: true + :tags: [] - :name: ci_job_artifacts_expire_project_build_artifacts :worker_name: Ci::JobArtifacts::ExpireProjectBuildArtifactsWorker :feature_category: :build_artifacts diff --git a/app/workers/ci/initialize_pipelines_iid_sequence_worker.rb b/app/workers/ci/initialize_pipelines_iid_sequence_worker.rb new file mode 100644 index 00000000000..95b58814e08 --- /dev/null +++ b/app/workers/ci/initialize_pipelines_iid_sequence_worker.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Ci + class InitializePipelinesIidSequenceWorker + include Gitlab::EventStore::Subscriber + + data_consistency :always + feature_category :continuous_integration + idempotent! + + def handle_event(event) + Project.find_by_id(event.data[:project_id]).try do |project| + next if project.internal_ids.ci_pipelines.any? + + ::Ci::Pipeline.track_project_iid!(project, 0) + end + end + end +end |