gitlab-org--gitlab-foss/lib/gitlab/cycle_analytics/production_stage.rb

39 lines
828 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Gitlab
module CycleAnalytics
class ProductionStage < BaseStage
include ProductionHelper
def start_time_attrs
@start_time_attrs ||= issue_table[:created_at]
end
2016-12-02 16:09:29 +00:00
def end_time_attrs
@end_time_attrs ||= mr_metrics_table[:first_deployed_to_production_at]
end
def name
2016-12-02 16:09:29 +00:00
:production
end
def title
s_('CycleAnalyticsStage|Production')
end
def legend
2017-05-03 17:40:21 +00:00
_("Related Issues")
end
2016-12-02 16:09:29 +00:00
def description
_("From issue creation until deploy to production")
end
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
end
end
end