2019-12-04 20:38:33 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module Analytics
|
|
|
|
module CycleAnalytics
|
|
|
|
module StageEvents
|
2019-12-26 22:10:19 +05:30
|
|
|
class MergeRequestFirstDeployedToProduction < MetricsBasedStageEvent
|
2019-12-04 20:38:33 +05:30
|
|
|
def self.name
|
|
|
|
s_("CycleAnalyticsEvent|Merge request first deployed to production")
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.identifier
|
|
|
|
:merge_request_first_deployed_to_production
|
|
|
|
end
|
|
|
|
|
|
|
|
def object_type
|
|
|
|
MergeRequest
|
|
|
|
end
|
2019-12-21 20:55:43 +05:30
|
|
|
|
|
|
|
def timestamp_projection
|
|
|
|
mr_metrics_table[:first_deployed_to_production_at]
|
|
|
|
end
|
|
|
|
|
|
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
|
|
|
def apply_query_customization(query)
|
2019-12-26 22:10:19 +05:30
|
|
|
super.where(timestamp_projection.gteq(mr_table[:created_at]))
|
2019-12-21 20:55:43 +05:30
|
|
|
end
|
|
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
2019-12-04 20:38:33 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|