Class: Gitlab::Analytics::CycleAnalytics::StageEvents::PlanStageStart

Inherits:
MetricsBasedStageEvent show all
Defined in:
lib/gitlab/analytics/cycle_analytics/stage_events/plan_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/plan_stage_start.rb', line 12

def self.identifier
  :plan_stage_start
end

.nameObject


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

def self.name
  s_("CycleAnalyticsEvent|Issue first associated with a milestone or issue first added to a board")
end

Instance Method Details

#apply_query_customization(query) ⇒ Object

rubocop: disable CodeReuse/ActiveRecord


33
34
35
36
37
# File 'lib/gitlab/analytics/cycle_analytics/stage_events/plan_stage_start.rb', line 33

def apply_query_customization(query)
  super
    .where(issue_metrics_table[:first_added_to_board_at].not_eq(nil).or(issue_metrics_table[:first_associated_with_milestone_at].not_eq(nil)))
    .where(issue_metrics_table[:first_mentioned_in_commit_at].not_eq(nil))
end

#column_listObject


25
26
27
28
29
30
# File 'lib/gitlab/analytics/cycle_analytics/stage_events/plan_stage_start.rb', line 25

def column_list
  [
    issue_metrics_table[:first_associated_with_milestone_at],
    issue_metrics_table[:first_added_to_board_at]
  ]
end

#object_typeObject


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

def object_type
  Issue
end

#timestamp_projectionObject


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

def timestamp_projection
  Arel::Nodes::NamedFunction.new('COALESCE', column_list)
end