Class: Gitlab::Analytics::CycleAnalytics::StageEvents::IssueDeployedToProduction

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from StageEvent

#apply_negated_query_customization, #hash_code, #html_description, #initialize, label_based?, #timestamp_projection

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/issue_deployed_to_production.rb', line 12

def self.identifier
  :issue_deployed_to_production
end

.nameObject



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

def self.name
  _("Issue first deployed to production")
end

Instance Method Details

#apply_query_customization(query) ⇒ Object

rubocop: disable CodeReuse/ActiveRecord



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

def apply_query_customization(query)
  query.joins(merge_requests_closing_issues: { merge_request: [:metrics] }).where(mr_metrics_table[:first_deployed_to_production_at].gteq(mr_table[:created_at]))
end

#column_listObject



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

def column_list
  [mr_metrics_table[:first_deployed_to_production_at]]
end

#include_in(query) ⇒ Object

rubocop: enable CodeReuse/ActiveRecord



30
31
32
# File 'lib/gitlab/analytics/cycle_analytics/stage_events/issue_deployed_to_production.rb', line 30

def include_in(query)
  query.left_joins(merge_requests_closing_issues: { merge_request: [:metrics] })
end

#object_typeObject



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

def object_type
  Issue
end