2019-12-21 20:55:43 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module Analytics
|
|
|
|
module CycleAnalytics
|
|
|
|
module StageEvents
|
2019-12-26 22:10:19 +05:30
|
|
|
class ProductionStageEnd < StageEvent
|
2019-12-21 20:55:43 +05:30
|
|
|
def self.name
|
2020-11-24 15:15:51 +05:30
|
|
|
_("Issue first deployed to production")
|
2019-12-21 20:55:43 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def self.identifier
|
|
|
|
:production_stage_end
|
|
|
|
end
|
|
|
|
|
|
|
|
def object_type
|
|
|
|
Issue
|
|
|
|
end
|
|
|
|
|
|
|
|
def timestamp_projection
|
|
|
|
mr_metrics_table[:first_deployed_to_production_at]
|
|
|
|
end
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
override :column_list
|
|
|
|
def column_list
|
|
|
|
[timestamp_projection]
|
|
|
|
end
|
|
|
|
|
2019-12-21 20:55:43 +05:30
|
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
|
|
|
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
|
|
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|