2018-11-06 04:45:35 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-11-18 15:38:02 +00:00
|
|
|
module Gitlab
|
|
|
|
module CycleAnalytics
|
|
|
|
class ProductionStage < BaseStage
|
2016-12-09 11:41:15 +00:00
|
|
|
include ProductionHelper
|
|
|
|
|
2017-01-12 11:48:01 +00:00
|
|
|
def start_time_attrs
|
|
|
|
@start_time_attrs ||= issue_table[:created_at]
|
|
|
|
end
|
2016-12-02 16:09:29 +00:00
|
|
|
|
2017-01-12 11:48:01 +00:00
|
|
|
def end_time_attrs
|
|
|
|
@end_time_attrs ||= mr_metrics_table[:first_deployed_to_production_at]
|
2016-11-21 16:15:25 +00:00
|
|
|
end
|
|
|
|
|
2016-12-09 11:41:15 +00:00
|
|
|
def name
|
2016-12-02 16:09:29 +00:00
|
|
|
:production
|
|
|
|
end
|
|
|
|
|
2017-05-04 02:05:38 +00:00
|
|
|
def title
|
|
|
|
s_('CycleAnalyticsStage|Production')
|
|
|
|
end
|
|
|
|
|
2017-02-10 08:41:39 +00:00
|
|
|
def legend
|
2017-05-03 17:40:21 +00:00
|
|
|
_("Related Issues")
|
2017-02-10 08:41:39 +00:00
|
|
|
end
|
|
|
|
|
2016-12-02 16:09:29 +00:00
|
|
|
def description
|
2017-05-04 02:05:38 +00:00
|
|
|
_("From issue creation until deploy to production")
|
2016-11-18 15:38:02 +00:00
|
|
|
end
|
2016-12-09 11:41:15 +00:00
|
|
|
|
|
|
|
def query
|
|
|
|
# Limit to merge requests that have been deployed to production after `@from`
|
|
|
|
query.where(mr_metrics_table[:first_deployed_to_production_at].gteq(@from))
|
|
|
|
end
|
2016-11-18 15:38:02 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|