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

builds_event_helper.rb « cycle_analytics « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c39d41578e9c49cf4d192ffe44c203a9a678ef89 (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
25
26
27
28
29
30
31
32
33
34
35
36
# frozen_string_literal: true

module Gitlab
  module CycleAnalytics
    module BuildsEventHelper
      def initialize(...)
        @projections = [build_table[:id]]
        @order = build_table[:created_at]

        super(...)
      end

      def fetch
        Updater.update!(event_result, from: 'id', to: 'build', klass: ::Ci::Build)

        super
      end

      def events_query
        base_query.join(build_table).on(mr_metrics_table[:pipeline_id].eq(build_table[:commit_id]))

        super
      end

      private

      def allowed_ids
        nil
      end

      def serialize(event)
        AnalyticsBuildSerializer.new.represent(event['build'])
      end
    end
  end
end