Class: Gitlab::Analytics::CycleAnalytics::StageEvents::CodeStageStart

Inherits:
StageEvent
  • Object
show all
Defined in:
lib/gitlab/analytics/cycle_analytics/stage_events/code_stage_start.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from StageEvent

#initialize, label_based?

Methods included from Utils::Override

#extended, extensions, #included, #method_added, #override, #prepended, #queue_verification, verify!

Methods included from CycleAnalytics::MetricsTables

#build_table, #issue_metrics_table, #issue_table, #mr_closing_issues_table, #mr_diff_commits_table, #mr_diff_table, #mr_metrics_table, #mr_table, #projects_table, #routes_table, #user_table

Constructor Details

This class inherits a constructor from Gitlab::Analytics::CycleAnalytics::StageEvents::StageEvent

Class Method Details

.identifierObject


12
13
14
# File 'lib/gitlab/analytics/cycle_analytics/stage_events/code_stage_start.rb', line 12

def self.identifier
  :code_stage_start
end

.nameObject


8
9
10
# File 'lib/gitlab/analytics/cycle_analytics/stage_events/code_stage_start.rb', line 8

def self.name
  s_("CycleAnalyticsEvent|Issue first mentioned in a commit")
end

Instance Method Details

#apply_query_customization(query) ⇒ Object

rubocop: disable CodeReuse/ActiveRecord


30
31
32
33
34
35
36
37
# File 'lib/gitlab/analytics/cycle_analytics/stage_events/code_stage_start.rb', line 30

def apply_query_customization(query)
  issue_metrics_join = mr_closing_issues_table
    .join(issue_metrics_table)
    .on(mr_closing_issues_table[:issue_id].eq(issue_metrics_table[:issue_id]))
    .join_sources

  query.joins(:merge_requests_closing_issues).joins(issue_metrics_join)
end

#column_listObject


25
26
27
# File 'lib/gitlab/analytics/cycle_analytics/stage_events/code_stage_start.rb', line 25

def column_list
  [timestamp_projection]
end

#object_typeObject


16
17
18
# File 'lib/gitlab/analytics/cycle_analytics/stage_events/code_stage_start.rb', line 16

def object_type
  MergeRequest
end

#timestamp_projectionObject


20
21
22
# File 'lib/gitlab/analytics/cycle_analytics/stage_events/code_stage_start.rb', line 20

def timestamp_projection
  issue_metrics_table[:first_mentioned_in_commit_at]
end