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

downstream_pipeline_helpers.rb « ci « concerns « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 39c0adb6e4e3c587e96ab341e5b0b1c1114f6355 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

module Ci
  module DownstreamPipelineHelpers
    def log_downstream_pipeline_creation(downstream_pipeline)
      return unless downstream_pipeline&.persisted?

      hierarchy_size = downstream_pipeline.all_pipelines_in_hierarchy.count
      root_pipeline = downstream_pipeline.upstream_root

      ::Gitlab::AppLogger.info(
        message: "downstream pipeline created",
        class: self.class.name,
        root_pipeline_id: root_pipeline.id,
        downstream_pipeline_id: downstream_pipeline.id,
        downstream_pipeline_relationship: downstream_pipeline.parent_pipeline? ? :parent_child : :multi_project,
        hierarchy_size: hierarchy_size,
        root_pipeline_plan: root_pipeline.project.actual_plan_name,
        root_pipeline_namespace_path: root_pipeline.project.namespace.full_path,
        root_pipeline_project_path: root_pipeline.project.full_path
      )
    end
  end
end